/* ==========================================================================
   MINIMALIST ACADEMIC PORTAL — DR. RAGINI GUPTA, ITM GORAKHPUR
   Design System: Refined Swiss / Academic Editorial
   ========================================================================== */

:root {
  /* Clean Light Academic Theme (Default) */
  --bg-body: #fafafa;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-hover: #f9fafb;

  --border-color: #e5e7eb;
  --border-strong: #d1d5db;

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --accent: #1e3a8a; /* Refined Academic Navy */
  --accent-light: #eff6ff;
  --accent-text: #1d4ed8;

  --success: #15803d;
  --success-bg: #f0fdf4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg-body: #0d1117;
  --bg-surface: #161b22;
  --bg-subtle: #21262d;
  --bg-hover: #1f242c;

  --border-color: #30363d;
  --border-strong: #484f58;

  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-faint: #6e7681;

  --accent: #58a6ff;
  --accent-light: rgba(56, 139, 253, 0.1);
  --accent-text: #58a6ff;

  --success: #3fb950;
  --success-bg: rgba(46, 160, 67, 0.12);
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  display: block;
}

.brand-desc {
  font-size: 0.813rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text-main);
}

/* Clear, Intuitive Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.813rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.theme-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.theme-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Intro Section */
.intro-section {
  margin-bottom: 48px;
}

.term-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.page-headline {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 14px;
}

.intro-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 24px;
}

.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-body);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.813rem;
}

.notice-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-text);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 0.875rem;
}

.notice-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-text);
}

.notice-box p {
  color: var(--text-main);
}

/* Main Sections */
.section {
  padding: 36px 0;
  border-top: 1px solid var(--border-color);
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Filters */
.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-main);
}

.filter-btn.active {
  background: var(--text-main);
  color: var(--bg-body);
  border-color: var(--text-main);
}

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s ease;
}

.note-item:hover {
  border-color: var(--border-strong);
}

.note-info {
  flex: 1;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.note-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-text);
}

.note-title-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.note-desc {
  font-size: 0.813rem;
  color: var(--text-muted);
}

.note-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Assignments List */
.assignment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assignment-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.assignment-info {
  flex: 1;
}

.assignment-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.assignment-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.assignment-due {
  font-size: 0.813rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.status-active { background: var(--accent-light); color: var(--accent-text); }
.status-graded { background: var(--success-bg); color: var(--success); }

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.813rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.schedule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.875rem;
}

.schedule-list li {
  display: flex;
  flex-direction: column;
}

.schedule-list strong {
  font-size: 0.813rem;
  color: var(--text-main);
}

.schedule-list span {
  font-size: 0.813rem;
  color: var(--text-muted);
}

.email-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.813rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

.email-link {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 500;
}

.dept-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.813rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-weight: 600;
  color: var(--text-main);
}

.detail-value {
  color: var(--text-muted);
  line-height: 1.5;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.modal-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-top: 2px;
}

.icon-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.icon-close:hover {
  color: var(--text-main);
}

.modal-content {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.938rem;
  color: var(--text-main);
  line-height: 1.7;
}

.modal-content h3 {
  font-size: 1.05rem;
  margin-top: 18px;
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-content ul {
  padding-left: 20px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-content .formula-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-text);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-main);
  margin: 14px 0;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-body);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.813rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.813rem;
  color: var(--text-faint);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* Responsive */
@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .note-item, .assignment-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .note-actions {
    width: 100%;
    margin-top: 8px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
