:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f35;
  --bg-secondary-rgb: 15, 31, 53;
  --bg-tertiary: #152642;
  --bg-hover: #1c3252;
  --bg-active: #243d5f;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-hover: #2563eb;

  --border-color: #1e3a5f;
  --border-light: #2d4a6f;

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  --folder-color: #60a5fa;

  --sidebar-width: 280px;
  --header-height: 60px;
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  --logo-filter: none;
  --loading-overlay-bg: rgba(10, 22, 40, 0.85);
  --preview-overlay-bg: rgba(0, 0, 0, 0.95);
  --overlay-bg: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-secondary-rgb: 255, 255, 255;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-active: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-hover: #1d4ed8;

  --border-color: #e2e8f0;
  --border-light: #cbd5e1;

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;

  --folder-color: #3b82f6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

  --logo-filter: brightness(0) saturate(100%) invert(15%) sepia(30%) saturate(1000%) hue-rotate(190deg) brightness(95%) contrast(95%);
  --loading-overlay-bg: rgba(248, 250, 252, 0.9);
  --preview-overlay-bg: rgba(241, 245, 249, 0.98);
  --overlay-bg: rgba(0, 0, 0, 0.4);
}

.logo-img {
  filter: var(--logo-filter);
}

body,
body * {
  transition:
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    color var(--transition-fast);
}

body.no-transition,
body.no-transition * {
  transition: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-logo .logo-img {
  height: 40px;
  width: auto;
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-primary);
  margin-left: 4px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.verification-steps {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.verification-steps h4 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.verification-steps ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.verification-steps li {
  font-size: 14px;
}

.drive-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo .logo-img {
  height: 32px;
  width: auto;
}

.new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px;
  padding: 12px 20px;
  background: var(--accent-primary);
  color: white;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.new-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.new-btn:active {
  transform: translateY(0);
}

.new-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.new-btn:disabled:hover {
  background: var(--bg-tertiary);
  transform: none;
  box-shadow: none;
}

.new-menu {
  display: none;
  position: absolute;
  left: 16px;
  top: 130px;
  width: calc(var(--sidebar-width) - 32px);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.new-menu.show {
  display: block;
}

.new-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.new-menu-item:hover {
  background: var(--bg-hover);
}

.new-menu-item i {
  width: 20px;
  color: var(--text-secondary);
}

.new-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-active);
}

.nav-item.drop-target {
  position: relative;
}

.nav-item.drop-target::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px dashed var(--danger);
  border-radius: var(--border-radius);
  pointer-events: none;
  opacity: 0.5;
}

.nav-item.drop-over {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.nav-item.drop-over::after {
  opacity: 1;
  border-style: solid;
}

.nav-item i {
  width: 20px;
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.storage-info {
  margin-bottom: 16px;
}

.storage-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.storage-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width var(--transition-slow);
}

.storage-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: white;
  font-weight: 600;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  padding: 8px;
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.breadcrumb-toolbar-row {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-toolbar-row .breadcrumb {
  flex: 0 1 80%;
  min-width: 0;
  padding: 0;
  border-bottom: none;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.breadcrumb-toolbar-row .breadcrumb::-webkit-scrollbar {
  display: none;
}

.breadcrumb-toolbar-row .toolbar {
  flex: 0 0 auto;
  padding: 0;
  border-bottom: none;
  margin-left: auto;
}

.file-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

.file-list {
  min-width: 100%;
}

.file-list-header {
  display: flex;
  align-items: center;
  padding: 12px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
}

.file-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-row:hover {
  background: var(--bg-hover);
}

.file-row:active {
  background: var(--bg-active);
}

.file-row.selected {
  background: rgba(59, 130, 246, 0.1);
  border-left: 2px solid var(--accent-primary);
  margin-left: -2px;
}

.file-row.dragging {
  opacity: 0.5;
  background: rgba(59, 130, 246, 0.2);
}

.file-row.drop-target {
  position: relative;
}

.file-row.drop-target::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--accent-primary);
  border-radius: var(--border-radius);
  pointer-events: none;
  opacity: 0.5;
}

.file-row.drop-over {
  background: rgba(59, 130, 246, 0.15);
}

.file-row.drop-over::after {
  opacity: 1;
  border-style: solid;
}

.file-cell {
  display: flex;
  align-items: center;
}

.file-checkbox {
  width: 40px;
  justify-content: center;
}

.file-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.file-checkbox input:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
}

.file-checkbox input:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.file-checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: checkmark 0.15s ease-out forwards;
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: rotate(45deg) scale(0);
  }
  100% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

.file-checkbox input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.file-name {
  flex: 1;
  gap: 12px;
  min-width: 0;
}

.file-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.file-icon i {
  font-size: 16px;
  color: var(--text-secondary);
}

.folder-icon {
  background: transparent;
}

.folder-icon i {
  color: var(--folder-color);
  font-size: 20px;
}

.file-icon.image-icon {
  background: rgba(34, 197, 94, 0.15);
}
.file-icon.image-icon i {
  color: #22c55e;
}

.file-icon.video-icon {
  background: rgba(239, 68, 68, 0.15);
}
.file-icon.video-icon i {
  color: #ef4444;
}

.file-icon.audio-icon {
  background: rgba(168, 85, 247, 0.15);
}
.file-icon.audio-icon i {
  color: #a855f7;
}

.file-icon.pdf-icon {
  background: rgba(239, 68, 68, 0.15);
}
.file-icon.pdf-icon i {
  color: #dc2626;
}

.file-icon.document-icon {
  background: rgba(59, 130, 246, 0.15);
}
.file-icon.document-icon i {
  color: #3b82f6;
}

.file-icon.spreadsheet-icon {
  background: rgba(34, 197, 94, 0.15);
}
.file-icon.spreadsheet-icon i {
  color: #22c55e;
}

.file-icon.archive-icon {
  background: rgba(245, 158, 11, 0.15);
}
.file-icon.archive-icon i {
  color: #f59e0b;
}

.file-icon.code-icon {
  background: rgba(99, 102, 241, 0.15);
}
.file-icon.code-icon i {
  color: #6366f1;
}

.file-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shared-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 6px;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--border-radius-sm);
  font-size: 11px;
  flex-shrink: 0;
}

.shared-badge i {
  font-size: 10px;
}

.file-modified {
  width: 280px;
  color: var(--text-secondary);
  font-size: 13px;
}

.file-size {
  width: 100px;
  color: var(--text-secondary);
  font-size: 13px;
}

.file-actions {
  width: 80px;
  justify-content: flex-end;
  gap: 4px;
}

.action-btn {
  padding: 8px;
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-active);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.empty-icon {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

.empty-icon i {
  font-size: 42px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 300px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.dialog-overlay.show {
  display: flex;
  opacity: 1;
}

.dialog {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.dialog-overlay.show .dialog {
  transform: scale(1) translateY(0);
}

.dialog-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  margin: 0 auto 16px;
}

.dialog-icon i {
  font-size: 24px;
  color: var(--accent-primary);
}

.dialog-icon.danger i {
  color: var(--danger);
}

.dialog-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.dialog-message {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.dialog-input-container {
  margin-bottom: 24px;
}

.dialog-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
}

.dialog-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dialog-actions {
  display: flex;
  gap: 12px;
}

.dialog-actions .btn {
  flex: 1;
}

.move-dialog {
  max-width: 480px;
}

.folder-tree {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  padding: 8px;
}

.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.folder-tree-item:hover {
  background: var(--bg-hover);
}

.folder-tree-item.selected {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-primary);
}

.folder-tree-item i {
  color: var(--folder-color);
}

.preview-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--preview-overlay-bg);
  z-index: 2000;
  flex-direction: column;
}

.preview-overlay.show {
  display: flex;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.preview-filename {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.preview-action-btn {
  padding: 8px 12px;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.preview-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}

.preview-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius);
}

.preview-content video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--border-radius);
}

.preview-content audio {
  width: 100%;
  max-width: 500px;
}

.preview-content iframe {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: var(--border-radius);
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  z-index: 10;
  opacity: 0.7;
}

.preview-nav:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  opacity: 1;
}

.preview-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.preview-nav-prev {
  left: 24px;
}

.preview-nav-next {
  right: 24px;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.preview-counter {
  font-size: 13px;
  color: var(--text-muted);
}

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

.preview-loading .spinner {
  width: 48px;
  height: 48px;
}

.preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
}

.preview-error i {
  font-size: 48px;
  color: var(--danger);
}

.preview-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  text-align: center;
  padding: 40px;
}

.preview-unsupported > i {
  font-size: 72px;
}

.preview-unsupported p {
  font-size: 16px;
  margin: 0;
}

.preview-unsupported audio {
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}

.preview-unsupported .btn {
  margin-top: 8px;
  padding: 12px 32px;
  font-size: 15px;
}

.preview-unsupported .btn i {
  font-size: 16px;
}

.upload-progress {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.upload-progress.show {
  display: block;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.upload-progress-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-progress-header-left i {
  color: var(--accent-primary);
  animation: uploadPulse 1.5s ease-in-out infinite;
}

@keyframes uploadPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.upload-progress-header span {
  font-weight: 600;
}

.upload-progress-close {
  padding: 6px;
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.upload-progress-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.upload-progress-list {
  max-height: 320px;
  overflow-y: auto;
}

.upload-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.upload-progress-item:hover {
  background: var(--bg-hover);
}

.upload-progress-item:last-child {
  border-bottom: none;
}

.upload-progress-item.complete {
  background: rgba(16, 185, 129, 0.05);
}

.upload-progress-item.error {
  background: rgba(239, 68, 68, 0.05);
}

.upload-progress-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.upload-progress-item.complete .upload-progress-icon {
  background: rgba(16, 185, 129, 0.15);
}

.upload-progress-item.complete .upload-progress-icon i {
  color: var(--success);
}

.upload-progress-item.error .upload-progress-icon {
  background: rgba(239, 68, 68, 0.15);
}

.upload-progress-item.error .upload-progress-icon i {
  color: var(--danger);
}

.upload-progress-icon i {
  font-size: 15px;
  color: var(--text-secondary);
}

.upload-progress-info {
  flex: 1;
  min-width: 0;
}

.upload-progress-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.upload-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.2s ease;
  position: relative;
}

.upload-progress-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.upload-progress-bar-fill.success {
  background: var(--success);
}

.upload-progress-bar-fill.success::after {
  animation: none;
}

.upload-progress-bar-fill.error {
  background: var(--danger);
}

.upload-progress-bar-fill.error::after {
  animation: none;
}

.upload-progress-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

.upload-progress-status.complete {
  color: var(--success);
}

.upload-progress-status.error {
  color: var(--danger);
}

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  animation: toastSlideUp 0.3s ease forwards;
  pointer-events: auto;
  max-width: 400px;
}

.toast.hiding {
  animation: toastSlideDown 0.3s ease forwards;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast i {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.success i {
  color: var(--success);
}

.toast.error i {
  color: var(--danger);
}

.toast.info i {
  color: var(--info);
}

.toast.warning i {
  color: var(--warning);
}

.toast-message {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastSlideDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.error-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.error-card {
  text-align: center;
}

.error-icon {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 50%;
  margin: 0 auto 24px;
}

.error-icon i {
  font-size: 48px;
  color: var(--text-muted);
}

.error-icon.error i {
  color: var(--danger);
}

.error-card h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--loading-overlay-bg);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.share-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.share-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.share-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.share-file-icon {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  margin-bottom: 24px;
}

.share-file-icon i {
  font-size: 48px;
  color: var(--accent-primary);
}

.share-filename {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
  word-break: break-word;
}

.share-info {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.days-remaining {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-left: 1rem;
}

.restore-btn:hover {
  color: var(--success) !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.delete-btn:hover {
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

.selection-bar {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  align-items: center;
  gap: 20px;
  animation: slideUp 0.3s ease;
}

.selection-bar.show {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.selection-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selection-bar-close {
  padding: 8px;
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.selection-bar-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.selection-bar-count {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.selection-bar-actions {
  display: flex;
  gap: 8px;
}

.selection-bar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.selection-bar-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.selection-bar-btn.danger {
  color: var(--danger);
}

.selection-bar-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

.selection-bar-btn i {
  font-size: 14px;
}

.shortcuts-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.shortcuts-overlay.show {
  display: flex;
}

.shortcuts-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.shortcuts-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.shortcuts-close {
  padding: 8px;
  color: var(--text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.shortcuts-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-label {
  color: var(--text-primary);
}

.shortcut-keys {
  display: flex;
  gap: 6px;
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(.disabled) {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.loading-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.loading-modal-overlay.show {
  display: flex;
}

.loading-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.loading-modal-spinner .spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-modal-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
