:root {
  --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-1: #00d4ff;
  --accent-2: #7c3aed;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --danger: #ef4444;
}

[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2, #e0eafc);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.1);
  --accent-1: #0072ff;
  --accent-2: #7c3aed;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}

/* Drag Overlay */
#drag-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.drag-content {
  border: 4px dashed var(--accent-1);
  padding: 4rem;
  border-radius: 16px;
  background: var(--glass-bg);
}

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

.screen {
  display: flex;
  flex: 1;
  width: 100vw;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* Auth Screen */
#auth-screen {
  justify-content: center;
  align-items: center;
}

.login-card {
  padding: 3rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  background: -webkit-linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(128,128,128,0.2);
  color: var(--text-primary);
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

input:focus, select:focus {
  border-color: var(--accent-1);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.primary-btn {
  background: linear-gradient(45deg, var(--accent-2), var(--accent-1));
  color: white;
  width: 100%;
}

.secondary-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

a.breadcrumb-link {
  color: var(--accent-1);
  text-decoration: none;
  cursor: pointer;
}
a.breadcrumb-link:hover {
  text-decoration: underline;
}

/* Main Screen Layout */
#main-screen {
  display: flex;
  padding: 1rem;
  gap: 1rem;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  background: -webkit-linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-item {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background: var(--glass-bg);
  color: white;
}

.storage-info {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin: 0.5rem 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-1));
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  flex: 1;
  max-width: 400px;
}

.search-bar input {
  margin: 0;
  border: none;
  background: transparent;
  padding-left: 0.5rem;
}

.actions {
  display: flex;
  gap: 1rem;
}

.actions .btn {
  width: auto;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-list-header {
  display: flex;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.file-list {
  flex: 1;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  transition: background 0.2s;
}

.file-item:hover {
  background: rgba(255,255,255,0.03);
}

.col-name { flex: 2; display: flex; align-items: center; gap: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-size { flex: 1; }
.col-date { flex: 1; color: var(--text-secondary); }
.col-actions { flex: 1; display: flex; gap: 0.5rem; justify-content: flex-end; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--glass-bg);
  color: white;
}

/* Modals */
.modal {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  padding: 2rem;
  width: 90%;
  max-width: 500px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #main-screen {
    flex-direction: column;
    padding: 0;
    gap: 0;
  }
  
  .sidebar {
    width: 100%;
    order: 2; /* Bottom tab */
    flex-direction: row;
    padding: 0.5rem;
    border-radius: 0;
    border-top: 1px solid var(--glass-border);
  }
  
  .sidebar h2, .storage-info { display: none; }
  
  .sidebar nav {
    display: flex;
    width: 100%;
    justify-content: space-around;
  }
  
  .nav-item {
    margin: 0;
    flex-direction: column;
    font-size: 0.75rem;
    padding: 0.5rem;
  }
  
  .content {
    order: 1;
    padding: 1rem;
    height: calc(100vh - 60px);
  }
  
  .topbar {
    flex-direction: column;
    gap: 1rem;
  }
  
  .search-bar { max-width: 100%; }
  
  .col-date { display: none; }
}
