/* =========================================
   Modern Minimalist Dark Theme
   Kartun Audio Indonesia WEB-DL Files
   ========================================= */

:root {
  --bg-base: #0f141a;
  --bg-surface: #1b2230;
  --bg-hover: #212a3a;
  --accent: #60a5f5;
  --accent-hover: #8ec7ff;
  --green: #34d399;
  --green-hover: #6ee7b7;
  --red: #f87171;
  --text-primary: #e6edf3;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.03);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== LOGIN ========== */

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10000;
}

.login-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(96, 165, 245, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin: 0 auto 1.25rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  letter-spacing: -0.3px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  gap: 0.5rem;
}

.login-input-wrap {
  flex: 1;
  position: relative;
}

.login-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.7rem 2.5rem 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden;
}

.login-input::-webkit-textfield-decoration-container {
  display: block !important;
}

#login-password::-webkit-credentials-manage-button {
  display: none !important;
}

#login-password::-ms-reveal {
  display: none !important;
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 245, 0.15);
}

.toggle-pw-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.toggle-pw-btn:hover { opacity: 1; }

.login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background var(--transition);
  flex-shrink: 0;
}

.login-btn:hover { background: var(--accent-hover); }

.login-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* ========== HEADER ========== */

.header {
  background: linear-gradient(135deg, #0f141a 0%, #1a2130 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.header-title-link {
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
  display: block;
}

.header-title-link:hover { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--red);
}

/* ========== MAIN ========== */

#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ========== CONTENT CARD ========== */

.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

/* ========== BREADCRUMB ========== */

.breadcrumb {
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
}

.breadcrumb-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb-item { display: flex; align-items: center; }
.breadcrumb-item::after { content: "/"; margin-left: 0.5rem; color: var(--text-secondary); }
.breadcrumb-item:last-child::after { display: none; }
.breadcrumb-item a { color: var(--accent); text-decoration: none; transition: color var(--transition); cursor: pointer; }
.breadcrumb-item a:hover { color: var(--accent-hover); }
.breadcrumb-item.active { color: var(--text-secondary); }

/* ========== TOOLBAR ========== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.search-box {
  display: flex;
  flex: 1;
  max-width: 340px;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-secondary); }

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.1);
}

.search-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--accent-hover);
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.875rem;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.toolbar-btn-copy {
  background: transparent;
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: var(--green);
}

.toolbar-btn-copy:hover {
  background: rgba(52, 211, 153, 0.1);
}

.toolbar-btn-download {
  background: var(--green);
  border: 1px solid var(--green);
  color: #fff;
}

.toolbar-btn-download:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
}

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

.file-btn, .toolbar-btn, .share-download-btn, .login-btn, .toggle-pw-btn, .logout-btn, .share-file-share-btn {
  -webkit-touch-callout: none;
  user-select: none;
}

/* ========== FILE LIST ========== */

.file-list {
  animation: fadeIn 300ms ease-out;
}

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

.file-list-header {
  display: grid;
  grid-template-columns: 40px 1fr 180px 120px 80px;
  gap: 1rem;
  background: rgba(20, 24, 41, 0.8);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  align-items: center;
}

.file-list-body {
  display: flex;
  flex-direction: column;
}

.file-item {
  display: grid;
  grid-template-columns: 40px 1fr 180px 120px 80px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  transition: background var(--transition);
  animation: slideIn 280ms ease-out both;
}

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

.file-item:hover {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}

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

/* Checkbox */
.check-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.custom-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.5 4.5L6 12 2.5 8.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  animation: checkFade 0.2s ease-out;
}

@keyframes checkFade {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

.share-file-check .custom-checkbox,
.file-list .custom-checkbox {
  border-color: rgba(255, 255, 255, 0.08);
}

/* File name */
.file-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.875rem;
}

.icon-folder { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.icon-file { background: rgba(100, 181, 246, 0.12); color: var(--accent); }

.file-name-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  transition: color var(--transition);
}

.file-preview-link {
  cursor: pointer;
}

.file-item:hover .file-name-text { color: var(--accent); }

.folder-link {
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}

.folder-link:hover { color: var(--accent); }

.file-date, .file-size {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.file-size-mobile {
  display: none;
}

/* Actions */
.file-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.file-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
  text-decoration: none;
}

.file-btn:hover {
  /* no translateY shift on hover */
}

.file-btn-download-action:hover,
.file-btn-download-folder:hover,
.share-btn-dl:hover,
.share-folder-dl-btn:hover {
  border-color: rgba(52, 211, 153, 0.5) !important;
  color: #34d399 !important;
  background: rgba(52, 211, 153, 0.08) !important;
}

.file-btn-copy-action:hover,
.file-btn-copy-folder-link:hover,
.share-copy-btn:hover {
  border-color: rgba(96, 165, 245, 0.5) !important;
  color: var(--accent) !important;
  background: rgba(96, 165, 245, 0.08) !important;
}

/* ========== LIST FOOTER ========== */

.list-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(20, 24, 41, 0.5);
}

/* ========== TOAST ========== */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(200px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.toast-error { background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.toast i { flex-shrink: 0; font-size: 1rem; }

/* ========== LOADING ========== */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text-secondary); font-size: 0.9rem; }

/* ========== ERROR ========== */

.error {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  color: #fca5a5;
}

.error i { flex-shrink: 0; font-size: 1.25rem; }
.error p { margin: 0; }

/* ========== EMPTY STATE ========== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { margin: 0; }

/* ========== PAGINATION ========== */

.pagination {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.load-more-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.load-more-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

/* ========== SHARE PAGE ========== */

.share-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.share-page.no-scroll {
  overflow: hidden;
  height: 100vh;
}

.share-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  width: 100%;
  max-width: 880px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.share-breadcrumb, .share-folder-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.share-breadcrumb a, .share-folder-breadcrumbs .share-crumb-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
  max-width: 310px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.share-breadcrumb a:hover, .share-folder-breadcrumbs .share-crumb-link:hover { color: var(--accent-hover); }

.share-breadcrumb .sep, .share-folder-breadcrumbs .share-crumb-sep { color: var(--text-muted); flex-shrink: 0; margin: 0 0.15rem; }

.share-breadcrumb .current, .share-folder-breadcrumbs .share-crumb-current {
  color: var(--text-secondary);
  max-width: 310px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.share-loading { padding: 1rem 0; }

.share-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fca5a5;
  justify-content: center;
}

.share-error i { font-size: 1.25rem; }

.share-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(96, 165, 245, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem;
}

.share-icon-folder { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }

.share-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  word-break: break-word;
}

.share-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.share-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition);
}

.share-download-btn:hover { background: var(--green-hover); }

.share-download-all { width: 100%; justify-content: center; }

.share-file-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}

.share-file-row {
  display: grid;
  grid-template-columns: 36px 1fr 100px auto;
  gap: 0.6rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  align-items: center;
}

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

.share-file-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(27, 34, 48, 0.98);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.share-file-row-dl .share-file-info {
  grid-column: 1 / -1;
}

.share-file-size {
  color: var(--text-secondary);
  font-size: 0.78rem;
  white-space: nowrap;
  text-align: right;
  padding-left: 0.1rem;
}

.share-file-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text-primary);
}

.share-file-info > i { color: var(--accent); flex-shrink: 0; font-size: 0.8rem; }

.share-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition);
}

.share-file-name:hover { color: var(--accent); }

.share-file-dl {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color var(--transition);
}

.share-file-dl:hover { color: var(--green); }

.share-file-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-file-list > .share-file-row:first-child .share-file-check,
.share-file-list > .share-file-row:first-child .share-file-info,
.share-file-list > .share-file-row:first-child .file-actions {
  display: flex;
  align-items: center;
}

.share-file-list > .share-file-row:first-child .share-file-info {
  text-align: left;
  justify-content: flex-start;
}

.share-file-list > .share-file-row:first-child .file-actions {
  justify-content: flex-end;
  text-align: right;
}

.share-file-list > .share-file-row:first-child .share-file-size {
  padding-left: 0.4rem;
  text-align: right;
}

.share-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.share-toolbar .toolbar-btn {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1.25rem;
}

.share-folder-row .folder-link {
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}

.share-folder-row .folder-link:hover { color: var(--accent); }

/* ========== PREVIEW MODAL ========== */

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.preview-modal.show { opacity: 1; }

.preview-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.preview-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.preview-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  margin-left: 0.75rem;
  transition: color var(--transition);
}

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

.preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 1rem;
}

.preview-body img {
  max-width: 80vw;
  max-height: 75vh;
  border-radius: 8px;
  object-fit: contain;
}

.preview-body video {
  max-width: 80vw;
  max-height: 75vh;
  border-radius: 8px;
  outline: none;
  object-fit: contain;
}

.preview-body .video-js {
  width: 100%;
  max-width: 80vw;
  max-height: 75vh;
  border-radius: 8px;
  object-fit: contain;
}

.preview-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.preview-audio audio {
  width: 300px;
  max-width: 80vw;
}

.preview-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.preview-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 2rem;
}

.share-footer {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 640px) {
  body { font-size: 13px; }

  .header { padding: 0.625rem 0; }
  .header-content { padding: 0 1rem; }
  .header-title { font-size: 0.9rem; letter-spacing: -0.3px; }
  .logout-btn { width: 32px; height: 32px; font-size: 0.8rem; }

  .main { padding: 1rem 0.75rem; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    padding: 0.75rem;
  }

  .search-box { max-width: 100%; }
  .search-input { font-size: 16px; }
  .toolbar-actions { justify-content: flex-end; }

  .file-list-header {
    display: grid !important;
    grid-template-columns: 32px 1fr 60px 50px !important;
    grid-template-areas: "check name size actions" !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.65rem !important;
    align-items: center !important;
    background: rgba(20, 24, 41, 0.95) !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .file-list-header .check-col { grid-area: check; }
  .file-list-header .name-col { grid-area: name; font-size: 0.65rem; }
  .file-list-header .date-col { display: none !important; }
  .file-list-header .size-col { grid-area: size; font-size: 0.65rem; text-align: right; justify-self: end; }
  .file-list-header .action-col { grid-area: actions; font-size: 0.65rem; text-align: right; }

   .file-item {
    grid-template-columns: 32px 1fr 60px 50px;
    grid-template-areas: "check name size actions";
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
  }

   .check-col { grid-area: check; }
   .file-name { grid-area: name; }
   .file-date { display: none; }
   .file-size-mobile { display: none; }

   .file-size {
     grid-area: size;
     display: block;
     font-size: 0.7rem;
     white-space: nowrap;
     text-align: right;
     color: var(--text-secondary);
     justify-self: end;
     min-width: 45px;
   }

  .file-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: flex-end;
  }

  .file-icon { width: 24px; height: 24px; font-size: 0.7rem; border-radius: 6px; }

  .file-name-text {
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .file-btn { width: 26px; height: 26px; font-size: 0.65rem; }
  .load-more-btn { width: 100%; justify-content: center; }

  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1rem;
    justify-content: flex-start;
    word-break: break-word;
  }

  .login-card { padding: 2rem 1.5rem; }
  .login-title { font-size: 1.1rem; }

.share-card { padding: 1.25rem 0.5rem 1rem; max-width: 100%; }
.share-title { font-size: 0.95rem; }
.share-meta { font-size: 0.7rem; }
.share-file-list { max-height: 380px; }
.share-file-row {
  display: grid !important;
  grid-template-columns: 18px 1fr auto auto !important;
  gap: 0.25rem !important;
  padding: 0.5rem 0.35rem !important;
  font-size: 0.72rem !important;
  align-items: center !important;
  grid-template-areas: none !important;
}
.share-file-check {
  width: 18px !important;
  grid-area: auto !important;
  align-self: center !important;
}
.share-file-info {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  min-width: 0 !important;
  overflow: hidden !important;
  grid-area: auto !important;
  align-self: center !important;
}
.share-file-name {
  font-size: 0.74rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  align-self: center !important;
}
.share-file-size {
  font-size: 0.68rem !important;
  text-align: right !important;
  white-space: nowrap !important;
  padding-right: 0.15rem !important;
  grid-area: auto !important;
  align-self: center !important;
  justify-self: end !important;
}
.share-file-info-header,
.share-file-size-header,
.file-actions-header {
  font-size: 0.62rem !important;
  white-space: nowrap !important;
  grid-area: auto !important;
  align-self: center !important;
}
.custom-checkbox { width: 13px; height: 13px; margin: 0; align-self: center; }
.custom-checkbox:checked::after { background-size: 8px; }
.share-toolbar .toolbar-btn { padding: 0.4rem 0.75rem; font-size: 0.7rem; }
.share-breadcrumb, .share-folder-breadcrumbs { font-size: 0.65rem; gap: 0.2rem; flex-wrap: nowrap !important; white-space: nowrap !important; overflow: hidden !important; max-width: 100% !important; justify-content: center !important; }
.share-breadcrumb a, .share-breadcrumb .current, .share-folder-breadcrumbs .share-crumb-link, .share-folder-breadcrumbs .share-crumb-current { max-width: 32vw !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: inline-block !important; }
.file-icon { width: 18px; height: 18px; font-size: 0.58rem; border-radius: 4px; flex-shrink: 0; align-self: center; }
.file-btn, .share-btn-icon { width: 22px; height: 22px; font-size: 0.62rem; padding: 0; display: inline-flex !important; align-items: center !important; justify-content: center !important; flex-shrink: 0; margin: 0 !important; align-self: center !important; }
.file-actions { display: flex !important; gap: 0.15rem !important; justify-content: flex-end !important; flex-shrink: 0 !important; white-space: nowrap !important; grid-area: auto !important; align-self: center !important; margin: 0 !important; }
}

/* Standalone Share Folder View (Matching Root Page Theme) */
.share-page-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base, #0f141a);
  padding: 2rem 1rem;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.share-card {
  background: var(--bg-surface, #1b2230);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius, 16px);
  padding: 2rem 1.5rem 1.75rem;
  width: 100%;
  max-width: 880px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  margin: auto;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.share-folder-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.share-folder-icon-wrap > i {
  color: #eab308;
  font-size: 1.8rem;
}

.share-folder-breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-secondary, #9ca3af);
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: 0.65rem;
  line-height: 1.4;
  word-break: break-word;
  padding: 0 0.25rem;
  font-family: 'Inter', sans-serif !important;
}

.share-crumb-link {
  color: #60a5f5;
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms ease;
}

.share-crumb-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.share-crumb-sep {
  color: #4b5563;
  margin: 0 0.35rem;
}

.share-crumb-current {
  color: #9ca3af;
  font-weight: 500;
}

.share-folder-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: 0.45rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  padding: 0 0.25rem;
  font-family: 'Inter', sans-serif !important;
}

.share-folder-meta {
  font-size: 0.85rem;
  color: var(--text-secondary, #9ca3af);
  text-align: center;
  margin-bottom: 1.25rem;
  font-family: 'Inter', sans-serif !important;
}

.share-file-list {
  background: #232b3b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  max-height: 430px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.share-file-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  align-items: center;
  font-family: 'Inter', sans-serif !important;
  box-sizing: border-box;
  width: 100%;
}

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

.share-file-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #232b3b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary, #9ca3af);
  letter-spacing: 0.05em;
}

.share-file-info-header {
  text-align: left;
  font-family: 'Inter', sans-serif !important;
}

.share-file-size-header {
  text-align: right;
  font-family: 'Inter', sans-serif !important;
  padding-right: 0.25rem;
}

.file-actions-header {
  text-align: right;
  font-family: 'Inter', sans-serif !important;
}

.share-file-size {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  white-space: nowrap;
  font-family: 'Inter', sans-serif !important;
  padding-right: 0.25rem;
}

.share-file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.share-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-primary, #f8fafc);
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.share-file-list::-webkit-scrollbar {
  width: 6px;
}

.share-file-list::-webkit-scrollbar-track {
  background: transparent;
}

.share-file-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.share-file-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.share-file-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-file-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text-primary);
}

.share-file-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(96, 165, 245, 0.12);
  color: var(--accent, #60a5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.share-file-name {
  color: var(--text-primary, #f8fafc);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition, 200ms ease);
  font-family: 'Inter', sans-serif !important;
}

.share-file-name:hover {
  color: var(--accent, #60a5f5) !important;
}

.share-file-row .file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.share-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #9ca3af);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition, 200ms ease);
  text-decoration: none;
}

.share-btn-dl:hover {
  border-color: #10b981 !important;
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}

.share-copy-btn:hover {
  border-color: #3b82f6 !important;
  color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.15) !important;
}

.share-btn-primary {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: none;
  background: var(--green, #10b981);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition, 200ms ease);
  margin-bottom: 0.75rem;
  font-family: 'Inter', sans-serif !important;
}

.share-btn-primary:hover:not(.disabled):not(:disabled) {
  background: var(--green-hover, #34d399);
}

.share-btn-primary.disabled,
.share-btn-primary:disabled,
.share-btn-outline.disabled,
.share-btn-outline:disabled,
.toolbar-btn.disabled,
.toolbar-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
}

.share-btn-primary.disabled:hover,
.share-btn-primary:disabled:hover,
.share-btn-outline.disabled:hover,
.share-btn-outline:disabled:hover,
.toolbar-btn.disabled:hover,
.toolbar-btn:disabled:hover {
  background: inherit !important;
  border-color: inherit !important;
  color: inherit !important;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.share-btn-outline {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #ffffff !important;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition, 200ms ease);
  font-family: 'Inter', sans-serif !important;
}

.share-btn-outline:hover:not(.disabled):not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .share-page-body {
    padding: 0.75rem 0.35rem;
  }

  .share-card {
    width: 96%;
    max-width: 100%;
    margin: 0 auto;
    padding: 1.1rem 0.65rem 0.75rem;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
  }

  .share-folder-icon-wrap {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.55rem;
  }

  .share-folder-icon-wrap > i {
    font-size: 1.15rem;
  }

  .share-folder-breadcrumbs {
    font-size: 0.64rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    padding: 0 0.15rem;
  }

  .share-folder-heading {
    font-size: 0.8rem;
    padding: 0 0.15rem;
    margin-bottom: 0.1rem;
    line-height: 1.25;
  }

  .share-folder-meta {
    font-size: 0.66rem;
    margin-bottom: 0.45rem;
  }

  .share-file-list {
    border-radius: 6px;
    margin-bottom: 0.5rem;
    max-height: 300px;
  }

  .share-file-row {
    display: grid;
    grid-template-columns: 16px 1fr auto auto !important;
    gap: 0.2rem !important;
    padding: 0.32rem 0.2rem !important;
    font-size: 0.66rem !important;
  }

  .share-file-header {
    padding: 0.32rem 0.2rem !important;
    font-size: 0.6rem !important;
  }

  .share-file-check {
    width: 16px !important;
  }

  .custom-checkbox {
    width: 12px;
    height: 12px;
  }

  .share-file-info {
    gap: 0.25rem;
    min-width: 0;
  }

  .file-icon {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
    border-radius: 4px;
  }

  .share-file-name {
    font-size: 0.66rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .share-file-size {
    font-size: 0.64rem;
  }

  .file-actions-header {
    font-size: 0.58rem;
    padding-right: 0;
  }

  .share-file-row .file-actions {
    gap: 0.15rem;
    justify-content: flex-end;
  }

  .share-btn-icon {
    width: 22px;
    height: 22px;
    font-size: 0.58rem;
    border-radius: 4px;
  }

  .share-btn-primary, .share-btn-outline {
    padding: 0.48rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 7px;
    margin-bottom: 0.38rem;
  }
}
