/* Base CSS Variables & Reset */
:root {
  --bg-color: #ffffff;
  --text-color: #1e293b;
  --primary-color: #0f172a;
  --accent-color: #2563eb;
  --border-color: #e2e8f0;
  --card-bg: #f8fafc;
  --pill-bg: #e0e7ff;
  --pill-text: #3730a3;
  --nav-bg: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --primary-color: #f1f5f9;
  --accent-color: #60a5fa;
  --border-color: #334155;
  --card-bg: #1e293b;
  --pill-bg: #3730a3;
  --pill-text: #e0e7ff;
  --nav-bg: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin-bottom: 1rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
header {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
}
.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.75rem; /* Make it large and tappable */
  line-height: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  color: var(--text-color);
  cursor: pointer;
}

.search-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Main Content */
main {
  padding: 3rem 0;
  min-height: calc(100vh - 64px - 100px); /* calc header and footer */
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-color);
  opacity: 0.8;
  font-size: 0.875rem;
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* Hide on mobile by default */
  }
  .mobile-menu-btn {
    display: block;
  }
}

/* Dropdown CSS for Navigation */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: none;
  border: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: inherit;
}

.dropbtn:hover {
  color: var(--accent-color);
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-bg);
  min-width: 200px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  border-radius: 8px;
  top: 100%;
  left: 0;
  padding: 0.5rem 0;
  border: 1px solid var(--border-color);
}

.dropdown-content a {
  color: var(--text-color);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
}

.dropdown-content a:hover {
  background-color: var(--bg-color);
  color: var(--accent-color);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Print Styles for Exporting to PDF */
@media print {
  body {
    background-color: white !important;
    color: black !important;
  }
  header, footer, .mobile-menu-btn, .theme-toggle, .search-btn, #mobile-drawer, #drawer-overlay, .btn {
    display: none !important;
  }
  main {
    padding: 0 !important;
  }
  .card, .task-item {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
  .progress-container, #progress-text {
    display: none !important;
  }
  h1, h2, h3 {
    color: black !important;
  }
}

/* Print-only elements */
.print-only-footer {
  display: none;
}
@media print {
  .print-only-footer {
    display: block !important;
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 2px solid #ccc;
    font-size: 1rem;
    font-weight: 600;
    color: black !important;
    page-break-inside: avoid;
  }
}

/* Mobile Utilities */
.mobile-only {
  display: none;
}
@media (max-width: 768px) {
  .mobile-only {
    display: inline;
  }
}
