/* Clean, Modern Light Mode PC File Explorer & Gateway Lock CSS */
:root {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #059669;
  --danger: #dc2626;
  --vip-color: #7c3aed;
  --vip-bg: #f5f3ff;
  --vip-border: #ddd6fe;
  --folder-color: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 960px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= 1. GATEWAY LOCK SCREEN ================= */
.gateway-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--bg-body);
}

.gateway-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
}

.gateway-icon {
  width: 52px;
  height: 52px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 1rem;
}

.gateway-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.gateway-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.gateway-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gateway-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  background-color: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.gateway-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-gateway {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-gateway:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
}

.btn-gateway:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ================= 2. MAIN PC EXPLORER ================= */
.explorer-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  animation: fadeIn 0.25s ease;
}

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

/* Top Action Bar */
.top-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
}

.portal-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.btn-lock-portal {
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-lock-portal:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.vip-status-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-vip-trigger {
  background-color: var(--vip-bg);
  border: 1px solid var(--vip-border);
  color: var(--vip-color);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-vip-trigger:hover {
  background-color: #ede9fe;
}

.vip-active-badge {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.vip-exit-btn {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.25rem;
  text-decoration: underline;
}

/* VIP Access Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.15s ease;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.35rem;
  cursor: pointer;
}

.vip-modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  margin-bottom: 0.85rem;
}

.vip-modal-input:focus {
  border-color: var(--vip-color);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.btn-unlock-submit {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-unlock-submit:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
}

.modal-alert {
  display: none;
  padding: 0.65rem 0.85rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.modal-alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.modal-alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

/* Central Search Bar */
.central-search-wrapper {
  margin: 0.5rem 0 1.5rem;
  position: relative;
}

.central-search-input {
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 2.85rem;
  font-size: 1rem;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.central-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-lens-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.15rem;
  display: none;
}

/* Breadcrumbs Bar */
.explorer-nav-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  overflow-x: auto;
  white-space: nowrap;
}

.crumb-item {
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.crumb-item:hover {
  text-decoration: underline;
}

.crumb-separator {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.crumb-current {
  color: var(--text-main);
  font-weight: 700;
}

.btn-back-folder {
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.btn-back-folder:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 1.25rem 0 0.65rem 0.25rem;
}

/* Folder Grid (PC Style) */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.folder-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  user-select: none;
}

.folder-card:hover {
  background-color: var(--bg-hover);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.folder-icon {
  font-size: 1.75rem;
  color: var(--folder-color);
  line-height: 1;
  flex-shrink: 0;
}

.folder-details {
  flex: 1;
  min-width: 0;
}

.folder-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.file-row {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.file-row:hover {
  border-color: #cbd5e1;
}

.file-main-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.file-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.file-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-title-wrap {
  flex: 1;
  min-width: 0;
}

.file-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.file-meta-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.badge-vip {
  background-color: var(--vip-bg);
  color: var(--vip-color);
  border: 1px solid var(--vip-border);
}

.badge-platform {
  background-color: var(--primary-light);
  color: var(--primary);
}

.btn-download-file {
  background-color: var(--primary);
  color: #fff !important;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-download-file:hover {
  background-color: var(--primary-hover);
}

.state-box {
  text-align: center;
  padding: 2.5rem 1rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.btn-pagination {
  background-color: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-pagination:hover:not(:disabled) {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-pagination:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

.pagination-info {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Alert Boxes */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .gateway-card {
    padding: 1.75rem 1.25rem;
  }
  .explorer-container {
    padding: 0.85rem 0.75rem 2.5rem;
  }
  .folder-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .folder-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .folder-icon {
    font-size: 1.45rem;
  }
  .folder-name {
    font-size: 0.825rem;
  }
  .file-row {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .btn-download-file {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
  }
  .central-search-input {
    font-size: 0.925rem;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
  }
}
