:root {
  --bg-color: #0d0d12;
  --panel-bg: rgba(22, 22, 30, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #eef0f4;
  --text-muted: #8b8d98;
  
  --primary: #8a2be2;
  --primary-hover: #9c40f5;
  --accent: #00e5ff;
  --success: #00e676;
  --warning: #ffb300;
  --danger: #ff1744;

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.08) 0%, transparent 25%);
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5 { font-weight: 600; color: var(--text-main); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }
p { line-height: 1.5; }
.subtitle { color: var(--text-muted); font-size: 0.85rem; }
.highlight { color: var(--accent); font-weight: 500; }

/* Layout Elements */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

.pane.glass, .stat-card, .task-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: rgba(13, 13, 18, 0.8);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.brand .logo-icon {
  color: var(--primary);
  width: 28px;
  height: 28px;
  animation: pulse 3s infinite alternate;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 10px;
  transition: var(--transition);
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(138, 43, 226, 0.2) 0%, transparent 100%);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.energy-selector {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--panel-border);
}
.energy-selector h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.energy-options {
  display: flex;
  gap: 0.5rem;
}

.energy-btn {
  flex: 1;
  padding: 0.6rem 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.energy-btn:hover { background: rgba(255, 255, 255, 0.1); }
.energy-btn.active.low { background: var(--success); color: #000; border-color: var(--success); }
.energy-btn.active.medium { background: var(--warning); color: #000; border-color: var(--warning); }
.energy-btn.active.high { background: var(--danger); color: #fff; border-color: var(--danger); }

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

.app-header {
  height: var(--header-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(13, 13, 18, 0.5);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.notification-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.notification-btn:hover { color: var(--text-main); transform: scale(1.1); }
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

/* Pages Visibility */
.page-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}
.page-section.active { display: block; }

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

/* Dashboard Page */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon i { width: 24px; height: 24px; }
.stat-info h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.3rem; font-weight: 500;}
.stat-info p { font-size: 1.5rem; font-weight: 700; }

.section-header { margin-bottom: 1.5rem; }
.schedule-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Task Cards */
.task-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--text-muted);
  transition: var(--transition);
}
.task-card:hover { background: rgba(255, 255, 255, 0.05); }
.task-card.priority-high { border-left-color: var(--danger); }
.task-card.priority-medium { border-left-color: var(--warning); }
.task-card.priority-low { border-left-color: var(--success); }
.task-card.completed { opacity: 0.6; filter: grayscale(0.8); }

.task-info h4 { margin-bottom: 0.3rem; }
.task-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.task-meta span { display: flex; align-items: center; gap: 0.3rem; }
.task-meta i { width: 14px; height: 14px; }

.task-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0.5rem;
}
.task-actions button:hover { color: var(--primary); }

/* Planner Page */
.planner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.pane { padding: 1.5rem; }

.form-group { margin-bottom: 1.25rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(138,43,226,0.2); }

.energy-options-input { display: flex; gap: 1rem; }
.energy-options-input label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--text-main);}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(138,43,226,0.3); }
.w-100 { width: 100%; }

/* Chat Page */
.chat-container {
  height: calc(100vh - var(--header-height) - 4rem);
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--panel-border);
}
.ai-avatar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.chat-messages {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.message { display: flex; max-width: 80%; }
.ai-message { align-self: flex-start; }
.user-message { align-self: flex-end; flex-direction: row-reverse; }

.msg-bubble {
  padding: 1rem;
  border-radius: 16px;
  line-height: 1.5;
}
.ai-message .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border-top-left-radius: 0;
}
.user-message .msg-bubble {
  background: var(--primary);
  color: white;
  border-top-right-radius: 0;
}

.chat-input-area form {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
}
.icon-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--primary-hover); transform: scale(1.05); }

/* Progress Page */
.chart-container {
  margin-top: 2rem;
  height: 400px;
  width: 100%;
}

/* Notifications Overlay */
.notification-panel {
  position: absolute;
  top: var(--header-height);
  right: 2rem;
  width: 320px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideInDown 0.3s ease;
}
.notification-panel h3 {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  font-size: 1rem;
}
.notif-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  transition: var(--transition);
}
.notif-item:hover { background: rgba(255,255,255,0.05); }
.notif-item:last-child { border-bottom: none; }
.notif-msg { font-size: 0.9rem; margin-bottom: 0.3rem;}
.notif-time { font-size: 0.75rem; color: var(--text-muted); }

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 15px var(--primary); }
}

/* Responsive */
@media (max-width: 768px) {
  .planner-layout { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr; }
}
