:root {
  /* Theme: Forest Geek */
  --bg-dark: #05100e;
  --bg-panel: rgba(22, 44, 40, 0.6);
  --bg-card: rgba(255, 255, 255, 0.03);
  --primary: #00ffa3; /* Tech Green */
  --secondary: #4facfe; /* Sky Blue */
  --accent: #ffd700; /* Gold */
  --text-main: #ffffff;
  --text-muted: #8b9bb4;
  --border: rgba(255, 255, 255, 0.1);
  --glass: blur(20px);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --sidebar-width: 260px;
  --header-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 255, 163, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(79, 172, 254, 0.05) 0%, transparent 20%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-panel);
  backdrop-filter: var(--glass);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--primary);
  letter-spacing: 1px;
}

.brand i { font-size: 1.5rem; }

.nav-menu { list-style: none; }

.nav-item {
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
  background: rgba(0, 255, 163, 0.1);
  color: var(--primary);
}

.nav-link.active {
  box-shadow: 0 0 15px rgba(0, 255, 163, 0.1);
}

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

header {
  height: var(--header-height);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.page-title h2 { font-size: 1.5rem; font-weight: 600; }
.page-title span { color: var(--text-muted); font-size: 0.9rem; margin-left: 10px; }

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border-radius: 50%;
  padding: 2px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; background: #000; }

/* === Views === */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }

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

/* === Dashboard Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
}

.stat-header { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-muted); font-size: 0.85rem; }
.stat-value { font-size: 2rem; font-weight: 700; margin-bottom: 5px; }
.stat-trend { font-size: 0.8rem; }
.stat-trend.up { color: var(--primary); }
.stat-trend.down { color: #ff4757; }

/* === Material Grid === */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s;
  position: relative;
}

.material-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 255, 163, 0.1);
}

.card-preview {
  height: 160px;
  background: #111;
  position: relative;
  overflow: hidden;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.material-card:hover .card-preview img { opacity: 1; }

.status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.card-body { padding: 20px; }
.card-title { font-size: 1.1rem; margin-bottom: 8px; color: #fff; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; min-height: 40px; }

.card-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover { background: #00cc82; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.btn-sm { padding: 4px 10px; font-size: 0.75rem; }

/* === AI Studio === */
.ai-layout {
  display: flex;
  gap: 30px;
  height: calc(100vh - 140px);
}

.ai-controls {
  width: 350px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  flex-direction: column;
}

.ai-preview {
  flex: 1;
  background: #000;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.control-group { margin-bottom: 25px; }
.label { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 0.9rem; }

.input-area {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: white;
  resize: none;
  min-height: 100px;
  font-size: 0.95rem;
}
.input-area:focus { border-color: var(--primary); outline: none; }

.style-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}
.chip.active {
  background: rgba(0, 255, 163, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.prompt-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--secondary);
  background: rgba(79, 172, 254, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.prompt-tag:hover {
  background: rgba(79, 172, 254, 0.2);
  border-color: var(--secondary);
}

.progress-bar {
  display: none;
  width: 60%;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--primary);
}

/* === Calendar === */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cal-day {
  background: var(--bg-dark);
  min-height: 120px;
  padding: 10px;
  position: relative;
}

.cal-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
}

.cal-event {
  background: rgba(79, 172, 254, 0.2);
  color: var(--secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 5px;
  border-left: 2px solid var(--secondary);
}

.cal-event.urgent {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border-color: #ff4757;
}

.cal-event.done {
  background: rgba(0, 255, 163, 0.1);
  color: #888;
  border-color: #555;
  text-decoration: line-through;
}
