:root {
  --bg-primary: #0a0d1a;
  --bg-secondary: #12172a;
  --bg-glass: rgba(18, 23, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background: radial-gradient(circle at top, #141b35 0%, #0a0d1a 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Class */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Common Layout Elements */
.hidden {
  display: none !important;
}

/* Utility Animations */
.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

/* Toast Notifications */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
  transform: translateY(-20px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--danger); }
.toast.info { background-color: var(--info); }

/* Login Page Styling */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: var(--radius-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo {
  color: var(--primary);
  margin-bottom: 16px;
  display: inline-block;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

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

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-danger-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition);
}

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

.btn-block {
  width: 100%;
}

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* App Main Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand svg {
  color: var(--primary);
}

.sidebar-menu {
  flex-grow: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
  background-color: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-user {
  height: 70px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info .username {
  font-size: 14px;
  font-weight: 600;
}

.user-info .role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition);
}

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

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
}

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

.content-header h1 {
  font-size: 26px;
  font-weight: 700;
}

.time-badge {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Tab Panels */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.tab-pane.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

/* Dashboard Tab: Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.stats-card {
  display: flex;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius-md);
  gap: 20px;
  transition: var(--transition);
}

.stats-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
}

.card-icon.blue { background-color: rgba(59, 130, 246, 0.15); color: var(--info); }
.card-icon.purple { background-color: rgba(99, 102, 241, 0.15); color: var(--primary); }
.card-icon.green { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.card-icon.orange { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }

.card-data h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-data .value {
  font-size: 24px;
  font-weight: 700;
}

/* Dashboard Body */
.dashboard-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.info-panel {
  padding: 28px;
  border-radius: var(--radius-md);
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

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

.system-intro {
  line-height: 1.7;
}

.system-intro p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.system-intro ul {
  padding-left: 20px;
  color: var(--text-secondary);
}

.system-intro li {
  margin-bottom: 8px;
}

.system-intro code {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #e2e8f0;
}

/* Search and Filters */
.table-filter-bar {
  display: flex;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.07);
}

/* Tables Styling */
.table-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge.success { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge.secondary { background-color: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

.avatar-nickname {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-img-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-gray { color: var(--text-muted); }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* Pagination Styling */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 0 8px;
}

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

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}

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

/* Album Details File View */
.back-nav-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}

.current-album-title {
  font-size: 18px;
  font-weight: 600;
}

.current-album-title span {
  color: var(--primary);
}

.sub-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  gap: 32px;
}

.sub-tab {
  background: none;
  border: none;
  padding: 12px 4px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.sub-tab:hover, .sub-tab.active {
  color: var(--text-primary);
}

.sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

.subtab-pane {
  display: none;
}

.subtab-pane.active {
  display: block;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  group: true;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.photo-card:hover img {
  transform: scale(1.08);
}

.photo-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 16px 12px 10px;
  opacity: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.photo-card:hover .photo-card-info {
  opacity: 1;
}

.photo-card-info .title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card-info .uploader {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 2px;
}

.photo-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(239, 68, 68, 0.85);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
}

.photo-card:hover .photo-delete-btn {
  opacity: 1;
}

.photo-delete-btn:hover {
  background-color: var(--danger);
  transform: scale(1.1);
}

/* Document List */
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-item {
  display: flex;
  align-items: flex-start;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  gap: 20px;
}

.doc-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-details {
  flex-grow: 1;
}

.doc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.doc-title {
  font-size: 15px;
  font-weight: 600;
}

.doc-metadata {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
}

.doc-summary-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.doc-summary-box strong {
  color: var(--primary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-tag {
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* Lightbox Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(7, 10, 18, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content-wrapper {
  max-width: 90%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-content-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #94a3b8;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: #fff;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }
  .sidebar-brand {
    height: 60px;
  }
  .sidebar-menu {
    flex-direction: row;
    padding: 10px 16px;
  }
  .sidebar-user {
    display: none;
  }
  .main-content {
    padding: 24px;
    max-height: none;
  }
}
