/* ========================================
   AI TASKFLOW - UNIFIED COLOR SCHEME
   Primary: #1e3a8a (Blue 800)
   Secondary: #475569 (Slate)
   Background: #f8fafc (Slate 50)
   White: #ffffff
   ======================================== */

:root {
  --primary: #1e3a8a;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --dark: #1e293b;
  --gray: #64748b;
  --light: #f1f5f9;
  --white: #ffffff;
  --bg: #f8fafc;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background: var(--sidebar-bg);
  z-index: 1001;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0,0,0,0.3);
}

.sidebar.open {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-light);
}

.sidebar-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close:hover {
  background: rgba(255,255,255,0.2);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.sidebar-link:hover {
  background: rgba(30, 58, 138, 0.3);
  color: white;
}

.sidebar-link i {
  width: 1.5rem;
  font-size: 1.125rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 0.75rem;
}

.sidebar-user i {
  font-size: 2rem;
  color: var(--sidebar-text);
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  word-break: break-word;
}

.sidebar-logout {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--danger);
  text-decoration: none;
}

.sidebar-logout:hover {
  text-decoration: underline;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.menu-btn {
  background: var(--light);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--primary);
  color: white;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-left: auto;
}

.nav-link {
  text-decoration: none;
  color: var(--gray);
  transition: color 0.2s;
  font-size: 0.875rem;
}

.nav-link:hover {
  color: var(--primary);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray);
  color: var(--gray);
}

.btn-outline:hover {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-large {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ========================================
   AUTH PAGES (Login & Register)
   ======================================== */
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  max-width: 450px;
  width: 100%;
  background: var(--white);
  border-radius: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
  padding: 2rem;
  text-align: center;
}

.auth-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.auth-icon i {
  font-size: 2rem;
  color: white;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.auth-form {
  text-align: left;
}

.auth-input-group {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.auth-input-icon {
  position: relative;
}

.auth-input-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 1rem;
}

.auth-input-icon .auth-input {
  padding-left: 2.5rem;
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.875rem;
  color: var(--gray);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--gray);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ========================================
   CARDS & FORMS (Dashboard)
   ======================================== */
.card {
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========================================
   TASK LIST
   ======================================== */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-item {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.task-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateX(4px);
}

.task-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.task-checkbox {
  margin-top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.task-info {
  flex: 1;
}

.task-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.task-title.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.task-description {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.task-description.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  background: var(--light);
}

.task-badge.overdue {
  background: #fee2e2;
  color: var(--danger);
}

.task-badge.completed {
  background: #d1fae5;
  color: var(--success);
}

.task-delete {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.task-delete:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* ========================================
   FILTER BUTTONS
   ======================================== */
.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.filter-btn-active {
  background: var(--primary);
  color: var(--white);
}

.filter-btn-inactive {
  background: var(--light);
  color: var(--gray);
}

.filter-btn-inactive:hover {
  background: #e2e8f0;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  color: white;
  font-size: 0.875rem;
  z-index: 2000;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification-success { background: var(--success); }
.notification-error { background: var(--danger); }
.notification-warning { background: var(--warning); }
.notification-info { background: var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem;
  }
  
  .navbar {
    padding: 0.5rem 1rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-brand {
    position: static;
    transform: none;
    margin: 0 auto;
  }
  
  .card {
    padding: 1rem;
  }
  
  .auth-card {
    padding: 1.5rem;
    margin: 0 1rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .notification {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
  }
}

@media (min-width: 769px) {
  .menu-btn {
    display: none;
  }
}

/* Stats Bar */
.stats-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
