:root {
  --bg-color: #030712; /* zinc-950 */
  --bg-sidebar: #09090b; /* zinc-950 with slight tint or just pure dark */
  --surface-base: rgba(31, 41, 55, 0.4);
  --surface-hover: rgba(55, 65, 81, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #6366f1; /* Indigo 500 */
  --brand-primary-hover: #4f46e5;
  --brand-glow: rgba(99, 102, 241, 0.35);
  
  --folder-color: #38bdf8; /* sky 400 */
  --file-color: #d8b4fe; /* purple 300 */
  --danger: #ef4444;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 16px var(--brand-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.04), transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.04), transparent 30%);
}

.app-container {
  display: flex;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 40px;
  padding: 0 8px;
}

.logo-icon-wrapper {
  background: linear-gradient(135deg, var(--brand-primary), #a855f7);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-icon {
  width: 18px;
  height: 18px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background-color: var(--surface-base);
  color: var(--text-primary);
}

.nav-links a.active {
  background-color: var(--brand-primary);
  color: white;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.nav-links a i {
  width: 18px;
  height: 18px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 8px;
}

.storage-widget {
  background: var(--surface-base);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.storage-info-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.storage-bar {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, var(--brand-primary), #a855f7);
  border-radius: var(--radius-full);
}

.storage-widget p {
  font-size: 11px;
  color: var(--text-muted);
}

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

.topbar {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(12px);
  z-index: 5;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--surface-base);
  border: 1px solid var(--border-subtle);
  padding: 0 16px;
  border-radius: var(--radius-full);
  width: 400px;
  height: 40px;
  transition: all 0.2s;
}

.search-bar:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background-color: rgba(31, 41, 55, 0.8);
}

.search-bar i {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  margin-left: 10px;
  width: 100%;
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

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

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

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.icon-btn i {
  width: 20px;
  height: 20px;
}

.user-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
  cursor: pointer;
}

/* Scrollable Content */
.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.breadcrumb-item {
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: var(--text-primary);
}

.breadcrumb-separator {
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}

.breadcrumb-current {
  color: var(--text-primary);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn.primary {
  background-color: var(--brand-primary);
  color: white;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.btn.primary:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn.secondary {
  background-color: var(--surface-base);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn.secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-secondary);
}

.btn.text-btn {
  background: transparent;
  color: var(--text-secondary);
}

.btn.text-btn:hover {
  color: var(--text-primary);
  background: var(--surface-base);
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.grid-item {
  background-color: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.grid-item:hover {
  transform: translateY(-4px);
  background-color: rgba(30, 41, 59, 0.8);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.item-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background-color: rgba(0,0,0,0.2);
}

.item-icon {
  width: 24px;
  height: 24px;
}

.grid-item.folder .item-icon-wrapper {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--folder-color);
}
.grid-item.folder .item-icon {
  fill: currentColor;
}

.grid-item.file .item-icon-wrapper {
  background-color: rgba(216, 180, 254, 0.1);
  color: var(--file-color);
}

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

.item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.item-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.grid-item:hover .item-actions {
  opacity: 1;
}

.item-actions:hover {
  color: var(--danger);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
  color: var(--text-secondary);
  animation: fadeIn 0.4s ease;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-base);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.empty-icon i {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  padding: 24px;
  width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  margin-bottom: 24px;
  outline: none;
  transition: border 0.2s;
}

.modal-content input:focus {
  border-color: var(--brand-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.animate-enter {
  animation: fadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .logo {
    margin-bottom: 0;
    margin-right: 24px;
  }
  .logo span {
    display: none;
  }
  .nav-links {
    flex-direction: row;
    gap: 8px;
  }
  .nav-links a {
    padding: 8px 12px;
    white-space: nowrap;
  }
  .sidebar-bottom {
    display: none;
  }
  .topbar {
    padding: 16px;
    gap: 12px;
    height: auto;
    flex-direction: column;
  }
  .department-header {
    position: static !important;
    transform: none !important;
    left: auto !important;
    font-size: 20px !important;
    white-space: normal !important;
    text-align: center;
    margin: 0 !important;
  }
  .search-bar {
    width: 100%;
    flex: none;
  }
  .search-bar input {
    font-size: 13px;
  }
  .content-scrollable {
    padding: 16px;
  }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .breadcrumbs {
    font-size: 18px;
  }
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .user-profile img {
    width: 28px;
    height: 28px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
}
