:root {
  --bg-main: #060911;
  --bg-sidebar: #090e1a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border: rgba(56, 189, 248, 0.2);
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent: #818cf8;
  --success: #10b981;
  --danger: #ef4444;
  --amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.sidebar-header {
  margin-bottom: 28px;
  padding-left: 8px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-name h2 span { color: var(--primary); }
.brand-name p { font-size: 11px; color: var(--text-muted); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
}

.sidebar-storage {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}
.storage-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.status-online { color: var(--success); font-size: 11px; }
.storage-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.storage-fill { height: 100%; background: var(--primary); border-radius: 99px; }
.storage-sub { font-size: 10.5px; color: var(--text-muted); }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.04) 0%, transparent 50%);
}

.topbar {
  height: 70px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-search {
  flex: 1;
  max-width: 450px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.topbar-search input:focus { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.user-menu {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

.gallery-header { padding: 28px 32px 16px; }
.gallery-title-wrap h1 { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.gallery-title-wrap p { font-size: 13px; color: var(--text-muted); }

/* Media Grid */
.media-grid {
  padding: 0 32px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.file-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
}

.card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
.card-preview img { width: 100%; height: 100%; object-fit: cover; }
.card-preview-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--primary);
  background: rgba(15, 23, 42, 0.9);
}

.card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.35; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: 10px; }
.card-actions { display: flex; gap: 6px; margin-top: auto; }

/* Buttons */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: none; transition: all 0.2s ease; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); color: #cbd5e1; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.active { display: flex; }
.modal-box {
  width: 100%; max-width: 540px; background: #0f172a;
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); overflow: hidden;
}
.modal-header { padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-family: 'Outfit', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 24px; }

.dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.3); border-radius: 12px;
  padding: 36px 20px; text-align: center; background: rgba(56, 189, 248, 0.03);
}
.drop-icon { font-size: 40px; color: var(--primary); margin-bottom: 12px; }
.dropzone h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.dropzone p { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 700; color: #cbd5e1; }
.form-group input {
  width: 100%; padding: 10px 14px; background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px;
  color: #fff; font-size: 13px; outline: none;
}
.form-group input:focus { border-color: var(--primary); }

.selection-bar {
  margin: 0 32px 14px;
  padding: 10px 16px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
