/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ===================== Auth Pages ===================== */
.auth-page {
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container { width: 100%; max-width: 400px; padding: 1rem; }

.auth-card { border: none; border-radius: 12px; }

/* ===================== App Layout ===================== */
.app-page { background: #f8f9fa; min-height: 100vh; }

.app-layout {
  display: flex;
  padding-top: 56px; /* navbar height */
  height: 100vh;
}

/* ===================== Sidebar ===================== */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #1e2329;
  color: #c9d1d9;
  padding: 1rem 0.5rem;
  height: calc(100vh - 56px);
  overflow-y: auto;
  position: sticky;
  top: 56px;
  flex-shrink: 0;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  color: #c9d1d9;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item:hover { background: #2d333b; color: #fff; }
.sidebar-item.active { background: #0d6efd; color: #fff; }

.sidebar-section { padding: 0 0.25rem; }

/* ===================== Main Content ===================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.toolbar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.6rem 1rem;
  flex-shrink: 0;
}

.breadcrumb { font-size: 0.85rem; }
.breadcrumb-item a { text-decoration: none; color: #0d6efd; }
.breadcrumb-item.active { color: #495057; }

/* ===================== File Listing ===================== */
.file-listing {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.file-table {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.file-table thead th {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
}

.file-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
  cursor: default;
}

.file-table tbody tr:last-child { border-bottom: none; }
.file-table tbody tr:hover { background: #f8f9fa; }

.file-table tbody td {
  padding: 0.55rem 1rem;
  vertical-align: middle;
  font-size: 0.88rem;
}

.file-row-dir { cursor: pointer; }
.file-row-dir:hover .file-name { color: #0d6efd; text-decoration: underline; }

.file-icon { font-size: 1.1rem; margin-right: 0.5rem; }
.file-icon-dir { color: #ffc107; }
.file-icon-img { color: #28a745; }
.file-icon-video { color: #dc3545; }
.file-icon-audio { color: #6f42c1; }
.file-icon-pdf { color: #dc3545; }
.file-icon-archive { color: #fd7e14; }
.file-icon-code { color: #20c997; }
.file-icon-doc { color: #0d6efd; }
.file-icon-default { color: #6c757d; }

.file-name { font-weight: 500; }
.file-meta { color: #6c757d; font-size: 0.8rem; }

.badge-lock { font-size: 0.7rem; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #adb5bd;
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 0.75rem; }

/* ===================== Drop Overlay ===================== */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 110, 253, 0.12);
  border: 3px dashed #0d6efd;
  border-radius: 8px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay-inner {
  text-align: center;
  color: #0d6efd;
  font-size: 1.1rem;
}

/* ===================== Action Buttons ===================== */
.action-btn {
  background: none;
  border: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  color: #6c757d;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}
.action-btn:hover { background: #f0f0f0; color: #212529; }
.action-btn.danger:hover { background: #ffe0e0; color: #dc3545; }
.action-btn.primary:hover { background: #e7f0ff; color: #0d6efd; }

/* ===================== Progress ===================== */
.progress { height: 8px; border-radius: 4px; }
.progress-bar { border-radius: 4px; }

/* ===================== Preview Modal ===================== */
#previewModal .modal-content { border: none; }
#previewModal .modal-body { background: #1a1a1a; }
#previewModal img { box-shadow: 0 4px 24px rgba(0,0,0,0.5); }
#previewModal video { box-shadow: 0 4px 24px rgba(0,0,0,0.5); }

/* ===================== Responsive ===================== */
@media (max-width: 768px) {
  .sidebar { width: 180px; min-width: 180px; }
  .file-table .hide-mobile { display: none; }
}

@media (max-width: 576px) {
  .sidebar { display: none; }
  .app-layout { padding-top: 56px; }
}
