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

:root {
  /* Colors */
  --bg: #f8fafc; /* Light gray */
  --bg-gradient: radial-gradient(circle at top, #ffffff 0%, #f1f5f9 100%);
  --surface: #ffffff; /* White surface */
  --surface-card: rgba(255, 255, 255, 0.8);
  --surface-hover: #f1f5f9;
  --text: #0f172a; /* Dark text */
  --text-muted: #64748b; /* Muted text */
  --primary: #8b5cf6; /* Electric Violet */
  --primary-hover: #7c3aed;
  --primary-light: rgba(139, 92, 246, 0.12);
  --accent: #06b6d4; /* Radiant Cyan */
  --accent-light: rgba(6, 182, 212, 0.12);
  --border: rgba(0, 0, 0, 0.1); /* Sophisticated ultra-thin border */
  --success: #10b981; 
  --success-bg: rgba(16, 185, 129, 0.12);
  --danger: #f43f5e; /* Rose red */
  --danger-hover: #e11d48;
  
  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --radius: 16px;
  --shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.4);
}

body {
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  width: min(1500px, 95%);
  margin-inline: auto;
}

/* Sticky Header Styling */
.site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.brand-text {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gradient-glow {
  background: linear-gradient(135deg, #c084fc 0%, #6366f1 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0px 2px 8px rgba(99, 102, 241, 0.4));
}

.note-chapter-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
  flex-shrink: 0;
}

.nav-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--primary-light);
}

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

/* Main Content & Hero Styling */
.main-content {
  padding: 3rem 0 5rem;
}

.hero {
  text-align: center;
  margin-bottom: 3.5rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin-inline: auto;
}

/* Notice Banner */
.notice-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Cards & Layout */
.submit-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 2.25rem;
  backdrop-filter: blur(8px);
}

.wide-card {
  max-width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Form inputs & controls */
input, select, textarea {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  text-align: center;
  display: inline-block;
  text-decoration: none;
  width: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
  filter: brightness(1.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.45);
}

.small-btn {
  width: auto;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Notes Grid (Student View) */
.notes-panel-wide {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  padding: 2.5rem;
  width: 100%;
}

.notes-grid-subjects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
  align-items: start;
}

/* Subject Card */
.subject-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

#group-x-history { animation-delay: 0.1s; }
#group-x-geography { animation-delay: 0.2s; }
#group-x-civics { animation-delay: 0.3s; }
#group-x-economics { animation-delay: 0.4s; }

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

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
}

.subject-card:hover::before {
  opacity: 1;
}

.subject-card .card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.subject-card .card-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.subject-icon {
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.note-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--text);
  transform: translateX(4px) translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.note-sub-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  display: inline-block;
  vertical-align: middle;
}

.notes-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resource-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cbse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.cbse-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.cbse-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(0, 0, 0, 0.02);
}

.cbse-card-icon {
  font-size: 2.5rem;
}

.cbse-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Dashboard Portal Styles */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.login-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.25rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.login-card h1 {
  margin-bottom: 0.5rem;
}

.login-card .subtitle {
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.login-card .form-group {
  text-align: left;
}

.error-text {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 1rem;
}

.panel-header {
  margin-bottom: 2.25rem;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 3.5rem 0 2rem;
}

.section-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.papers-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.paper-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: all 0.2s ease;
}

.paper-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.paper-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.score-pill {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.muted-text {
  color: var(--text-muted);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* Responsiveness */
@media (max-width: 1024px) {
  .notes-grid-subjects {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .notes-grid-subjects {
    grid-template-columns: 1fr;
  }

  .paper-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .paper-card button {
    width: 100%;
  }
}

/* Notification Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.modal-content {
  background: var(--bg);
  background-image: var(--bg-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 95%;
  max-width: 550px;
  padding: 2rem;
  transform: translateY(0);
  transition: transform 0.2s ease;
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-overlay.hidden .modal-content {
  transform: translateY(20px);
}
.notif-tab {
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.2s;
}
.notif-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.notif-item {
  background: var(--surface-card);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border);
}
.notif-item-inst {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.notif-item-title {
  color: var(--text);
  font-weight: 500;
}
.notif-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}


.notes-section.collapsed { display: none !important; }


/* Mobile Fixes */
@media (max-width: 768px) {
  .header-right-actions { gap: 0.5rem !important; }
  .notif-text { display: none !important; }
  .header-dash-link { display: none !important; }
  .header-inner { justify-content: space-between; padding: 0.5rem 1rem; }
  #notif-bell-btn { padding: 0.4rem 0.6rem !important; }
  .mobile-footer { display: block !important; }
  .search-input-wrapper { width: 100%; max-width: 100%; position: relative; }
}
@media (min-width: 769px) {
  .mobile-footer { display: none !important; }
}
.search-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; max-width: 400px; }
.search-input-wrapper .search-icon { position: absolute; left: 12px; font-size: 1.1rem; }
.search-input-wrapper .search-input { padding-left: 2.5rem; width: 100%; }

