/* ================================================================
   MechHub — College Institutional Matte Black Design Engine
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Premium Matte Slate & Velvet Dark Palette */
  --background: #06070a;       /* Deep obsidian matte void */
  --surface: #0f111a;          /* Clean structural tiles */
  --surface-2: #161924;        /* Component backdrops */
  --surface-3: #222636;        /* High-contrast element borders */
  
  /* Academic Pop Accents */
  --accent-orange: #f97316;    /* Safety Orange */
  --accent-cyan: #00e5ff;      /* Blueprint Laser Cyan */
  --primary: #3b82f6;          /* Hydraulic Blue */
  
  /* Text Contrast Hierarchy */
  --text: #f8fafc;             /* Clear readable white */
  --text-muted: #5a6578;       /* Muted technical iron slate */
  --border: rgba(255, 255, 255, 0.06);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-smooth: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* ── Reset & Baseline Canvas Layout ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  
  /* Deep Technical Blueprint Grid Overlay */
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.06) 0%, rgba(59, 130, 246, 0.02) 50%, transparent 80%),
}

/* Scrollbar Style */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-orange); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

/* ── Interactive Split Brand Joining Transition ⚙️ ── */
.brand-text { display: inline-flex; overflow: hidden; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.split-mech { color: #ffffff; display: inline-block; transform: translateX(-100%); opacity: 0; animation: slideFromLeftMerge 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards; animation-delay: 0.2s; }
.split-hub { color: var(--accent-orange); display: inline-block; transform: translateX(100%); opacity: 0; animation: slideFromRightMerge 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards; animation-delay: 0.2s; }

@keyframes slideFromLeftMerge {
  0% { transform: translateX(-40px); opacity: 0; filter: blur(4px); }
  70% { transform: translateX(2px); opacity: 1; filter: blur(0); }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideFromRightMerge {
  0% { transform: translateX(40px); opacity: 0; filter: blur(4px); }
  70% { transform: translateX(-2px); opacity: 1; filter: blur(0); }
  100% { transform: translateX(0); opacity: 1; }
}

/* ── Header Navigation Bar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: rgba(6, 7, 10, 0.75);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; cursor: pointer; flex: 1; }
.nav-brand .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.nav-links { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.03); padding: 4px; border-radius: 30px; border: 1px solid var(--border); }
.nav-link {
  padding: 6px 16px; border-radius: 30px; font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: var(--transition-smooth); border: none; background: none;
}
.nav-link:hover, .nav-link.active { color: #ffffff; background: var(--surface-3); }

.nav-cta {
  margin-left: 20px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
  background: transparent; color: #ffffff; border: 1px solid var(--text-muted); cursor: pointer; transition: var(--transition-smooth);
}
.nav-cta:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

/* ── View Routing Shells ── */
.view { display: none; opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease, transform 0.3s ease; }
.view.active { display: block; opacity: 1; transform: translateY(0); }

/* ── Highly Structured Institutional Hero Grid Layout ── */
.hero-section {
 min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 60px;
  position: relative;
  overflow: hidden; /* Keeps the animated image from breaking the page */
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('/static/main-building.jpg');
  background-size: cover;
  background-position: center;
  /* filter: grayscale(30%) contrast(110%); */
  animation: gentleSlowPan 30s ease-in-out infinite alternate;
}

.hero-bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(9, 10, 31, 0.3) 0%,   /* Dropped from 88% darkness to 30% */
    rgba(22, 23, 72, 0.65) 60%,  /* Dropped from 92% darkness to 65% */
    var(--background) 100%
  );
}

@keyframes gentleSlowPan {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.08) translate(-10px, -5px); }
}


.hero-blob { position: absolute; border-radius: 50%; filter: blur(140px); opacity: 0.35; pointer-events: none; }
/* .hero-blob-1 { position: absolute; top: 10%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(249, 93, 155, 0.08) 0%, transparent 70%); filter: blur(100px); z-index: 1; pointer-events: none; } */

/* Minimalist floating elements */
.hero-gear { position: absolute; opacity: 0.01; fill: #ffffff; pointer-events: none; animation: spin linear infinite; }
.hero-gear-1 { width: 220px; height: 220px; top: 15%; left: 8%; animation-duration: 50s; }
.hero-gear-2 { width: 160px; height: 160px; top: 20%; right: 10%; animation-duration: 35s; animation-direction: reverse; }

/* Notice-Board Style Glass Badge Banner */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: rgba(22, 25, 36, 0.6); border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--accent-orange); margin-bottom: 28px;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.hero-badge .badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-orange); box-shadow: 0 0 6px var(--accent-orange); }

/* Structured Clean Typography Headers */
/* ================================================================
   UPGRADED: Sophisticated Script Branding Header Look
   ================================================================ */

.hero-title {
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* Elegant, sophisticated script characteristics */
.hero-title .title-welcome {
  font-family: 'Alex Brush', 'CAC Champagne', cursive;
  font-size: clamp(3.5rem, 7vw, 6.5rem); /* Scaled larger to display script details beautifully */
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
  display: inline-block;
  padding-bottom: 8px;
}

/* Crisp technical geometric contrast balance */
.hero-title .title-hub {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 800;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
}
.hero-subtitle { font-size: clamp(0.92rem, 1.5vw, 1.05rem); color: var(--text-muted); max-width: 580px; margin: 0 auto 40px; line-height: 1.6; font-weight: 400; }

.hero-cta-group { display: flex; gap: 12px; justify-content: center; margin-bottom: 64px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  background: var(--accent-orange); color: white; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; transition: var(--transition-smooth);
}
.btn-primary:hover { transform: translateY(-2px); background: #f97316f0; box-shadow: 0 4px 20px rgba(249,115,22,0.2); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  background: var(--surface); color: var(--text); border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.9rem; cursor: pointer; border: 1px solid var(--border); transition: var(--transition-smooth);
}
.btn-secondary:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.12); }

/* Grid Dashboard Stats Ribbon */
.stats-ribbon {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); padding: 20px 40px; border-radius: var(--radius-lg);
  max-width: 900px; margin: 0 auto; gap: 48px;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #ffffff; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-divider { width: 1px; height: 28px; background: var(--border); }

/* ── Content View Sections ── */
.features-section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--accent-orange); margin-bottom: 10px; display: inline-block; }
.section-title { font-size: clamp(1.6rem, 2.5vw, 2.2rem); font-weight: 700; margin-bottom: 12px; color: #ffffff; }
.section-subtitle { color: var(--text-muted); max-width: 500px; margin-bottom: 40px; font-size: 0.95rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition-smooth); }
.feature-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-2px); }
.feature-icon { width: 40px; height: 40px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 16px; }
.feature-title { font-size: 1rem; font-weight: 600; color: #ffffff; margin-bottom: 6px; }
.feature-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ── Dashboard (Semester Systems Grid) ── */
.dashboard-view { padding: 100px 40px 60px; max-width: 1400px; margin: 0 auto; }
.dashboard-header { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.dash-title { font-size: 1.75rem; font-weight: 700; color: #ffffff; }
.dash-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.search-bar { position: relative; max-width: 400px; margin-top: 20px; }
.search-input { width: 100%; padding: 10px 14px 10px 38px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: #ffffff; font-size: 0.88rem; outline: none; transition: var(--transition-smooth); }
.search-input:focus { border-color: var(--accent-orange); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 0.85rem; }

.semesters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding: 24px 0 60px; }
.semester-card {
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg);
  padding: 24px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform var(--transition-spring), border-color var(--transition-smooth) !important;
}
.semester-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--card-color, var(--text-muted)); opacity: 0.4; }
.semester-card:hover { transform: translateY(-4px); border-color: var(--card-color, var(--accent-orange)) !important; box-shadow: 0 12px 24px rgba(0,0,0,0.4) !important; }

.sem-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sem-number { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.sem-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600; }

.sem-icon-wrap { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }
.sem-card-title { font-size: 1.1rem; font-weight: 600; color: #ffffff; margin-bottom: 4px; }
.sem-card-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 16px; }

.sem-progress { height: 2px; background: var(--surface-3); border-radius: 1px; margin-bottom: 16px; overflow: hidden; }
.sem-progress-fill { height: 100%; transition: width 0.4s ease; }

.sem-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.sem-meta { display: flex; gap: 12px; font-size: 0.78rem; color: var(--text-muted); }
.sem-arrow { font-size: 0.9rem; color: var(--text-muted); transition: var(--transition-smooth); }
.semester-card:hover .sem-arrow { color: var(--accent-orange); transform: translateX(2px); }

/* ── Subject Materials Layout Panels ── */
.subject-view { padding: 100px 40px 60px; max-width: 1400px; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb-item { cursor: pointer; transition: var(--transition-smooth); }
.breadcrumb-item:hover { color: #ffffff; }
.breadcrumb-sep { color: var(--surface-3); }
.breadcrumb-current { color: #ffffff; }

.subject-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.subject-header-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.subject-header-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.subject-header-title { font-size: 1.5rem; font-weight: 700; color: #ffffff; }
.subject-header-desc { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }

.subjects-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 24px; scrollbar-width: none; }
.subject-tab {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 4px !important;
  background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text-muted) !important;
  font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: var(--transition-smooth) !important; white-space: nowrap;
}
.subject-tab:hover { background: var(--surface-2) !important; color: #ffffff !important; }
.subject-tab.active { background: var(--surface-2) !important; color: #ffffff !important; border-color: var(--accent-orange) !important; }

/* ── Resource Materials Pipeline Rows ── */
.resources-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.resources-title { font-size: 1rem; font-weight: 600; color: #ffffff; }
.resources-count { font-size: 0.78rem; color: var(--text-muted); margin-left: 4px; }
.resources-filter { display: flex; gap: 4px; }
.filter-btn { padding: 4px 12px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: var(--transition-smooth); }
.filter-btn:hover, .filter-btn.active { background: var(--surface-2); color: #ffffff; border-color: var(--accent-cyan); }

.resources-list { display: grid; gap: 8px; }
.resource-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  padding: 14px 20px; border-radius: var(--radius); transition: var(--transition-smooth) !important;
}
.resource-card:hover { background: var(--surface-2) !important; border-color: rgba(255, 255, 255, 0.1) !important; }
.resource-type-icon { width: 36px; height: 36px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.resource-info { flex: 1; min-width: 0; }
.resource-title { font-size: 0.88rem; font-weight: 500; color: #ffffff; margin-bottom: 2px; }
.resource-meta { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; color: var(--text-muted); }
.resource-tag { padding: 1px 6px; border-radius: 2px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }

.resource-actions { display: flex; gap: 6px; }
.btn-action { padding: 6px 12px; border-radius: 4px; font-size: 0.78rem; font-weight: 500; cursor: pointer; border: 1px solid var(--border); transition: var(--transition-smooth); }
.btn-webview { background: rgba(0, 229, 255, 0.05); color: var(--accent-cyan); border-color: rgba(0, 229, 255, 0.1); }
.btn-webview:hover { background: var(--accent-cyan); color: var(--background); }
.btn-download { background: rgba(249, 115, 22, 0.05); color: var(--accent-orange); border-color: rgba(249, 115, 22, 0.1); }
.btn-download:hover { background: var(--accent-orange); color: white; }

/* ── PDF Document Viewer Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(6, 7, 10, 0.8); backdrop-filter: blur(10px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: var(--transition-smooth); }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-container { background: var(--background) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; border-radius: var(--radius-lg); width: 100%; max-width: 1000px; height: 80vh; display: flex; flex-direction: column; overflow: hidden; }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-btn { background: var(--surface-2); border: 1px solid var(--border); color: #ffffff; padding: 6px 12px; border-radius: 4px; font-size: 0.78rem; font-weight: 500; cursor: pointer; transition: var(--transition-smooth); }
.modal-btn-close { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.15); color: #f87171; cursor: pointer; }
.modal-btn-close:hover { background: #ef4444; color: white; }

.modal-body { flex: 1; background: #ffffff; }
.pdf-frame { width: 100%; height: 100%; border: none; }

/* Toast Notifications */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: #ffffff; font-size: 0.82rem; box-shadow: 0 8px 24px rgba(0,0,0,0.5); animation: toastIn 0.3s ease both; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast.removing { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Footer */
.footer { padding: 32px 40px; border-top: 1px solid var(--border); text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.footer a { color: var(--accent-cyan); }

/* Color Mappings Mapping Tokens */
.color-blue    { --card-color: #3b82f6; }
.color-violet  { --card-color: #7c3aed; }
.color-emerald { --card-color: #10b981; }
.color-orange  { --card-color: #f97316; }
.color-rose    { --card-color: #f43f5e; }
.color-cyan    { --card-color: #06b6d4; }
.color-amber   { --card-color: #f59e0b; }
.color-indigo  { --card-color: #6366f1; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .semesters-grid { grid-template-columns: 1fr; }
  .resource-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .resource-actions { width: 100%; justify-content: flex-end; }
}

/* ================================================================
   AUTH — Navbar guest / user area
   ================================================================ */
.nav-auth-area { margin-left: 20px; display: flex; align-items: center; }

.nav-guest-btns { display: flex; gap: 8px; align-items: center; }
.nav-btn-login {
  padding: 7px 16px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
  background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer;
  transition: var(--transition-smooth);
}
.nav-btn-login:hover { border-color: rgba(255,255,255,0.3); }
.nav-btn-signup {
  padding: 7px 16px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
  background: linear-gradient(135deg, #478559, #39a0ca); color: #fff; border: none; cursor: pointer;
  transition: var(--transition-smooth);
}
.nav-btn-signup:hover { opacity: 0.85; }

.nav-user-area { display: flex; align-items: center; gap: 8px; }
.nav-user-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-saved-btn, .nav-logout-btn {
  padding: 7px 12px; font-size: 0.8rem; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border); transition: var(--transition-smooth);
}
.nav-saved-btn { background: rgba(255,255,255,0.04); color: var(--text-muted); }
.nav-saved-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.nav-logout-btn { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #fca5a5; }
.nav-logout-btn:hover { background: rgba(239,68,68,0.15); }

/* ================================================================
   AUTH — Login / Register card
   ================================================================ */
.auth-view {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 80px 24px 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 24px; padding: 40px;
}
.auth-icon { font-size: 2.4rem; margin-bottom: 16px; }
.auth-title {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 700;
  color: #fff; margin-bottom: 6px;
}
.auth-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 28px; line-height: 1.6; }
.auth-field { margin-bottom: 16px; }
.auth-label {
  display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s; box-sizing: border-box;
}
.auth-input:focus { outline: none; border-color: rgba(255,255,255,0.2); }
.auth-input::placeholder { color: var(--text-muted); }
.auth-submit {
  width: 100%; padding: 14px; margin-top: 8px;
  background: linear-gradient(135deg, #478559, #39a0ca);
  color: #fff; font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer; transition: opacity 0.2s;
}
.auth-submit:hover { opacity: 0.88; }
.auth-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.auth-link { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.88rem; }
.auth-link span { color: #39a0ca; cursor: pointer; }
.auth-link span:hover { text-decoration: underline; }
.auth-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5; padding: 10px 14px; border-radius: 8px;
  font-size: 0.85rem; margin-bottom: 16px; display: none;
}
.auth-error.visible { display: block; }
.auth-hint {
  background: rgba(71,133,89,0.1); border: 1px solid rgba(71,133,89,0.25);
  color: #6ee7b7; padding: 10px 14px; border-radius: 8px;
  font-size: 0.82rem; margin-bottom: 20px; line-height: 1.5;
}

/* ================================================================
   GENERAL RESOURCES + SAVED — page layouts
   ================================================================ */
.general-page-inner { max-width: 1200px; margin: 0 auto; padding: 80px 48px 80px; }

/* ================================================================
   OFFLINE SAVE BUTTON
   ================================================================ */
.btn-save-offline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-save-offline:hover { background: rgba(71,133,89,0.12); border-color: rgba(71,133,89,0.3); color: #6ee7b7; }
.btn-save-offline.saved { background: rgba(71,133,89,0.15); border-color: rgba(71,133,89,0.4); color: #6ee7b7; }
.btn-save-offline.saving { opacity: 0.6; cursor: wait; }

/* ================================================================
   OFFLINE BADGE on resource cards
   ================================================================ */
.offline-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: rgba(71,133,89,0.15); border: 1px solid rgba(71,133,89,0.3);
  border-radius: 99px; color: #6ee7b7; font-size: 0.72rem; font-weight: 600;
}

/* ================================================================
   REMOVE OFFLINE BUTTON (in saved view)
   ================================================================ */
.btn-remove-offline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px; color: #fca5a5; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s;
}
.btn-remove-offline:hover { background: rgba(239,68,68,0.15); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-desc { color: var(--text-muted); font-size: 0.88rem; }
/* ================================================================
   ME COMMUNITY HUB — General User Page
   ================================================================ */

/* Page wrapper */
.me-hub-page {
  min-height: 100vh;
  padding-top: 64px;
  background: var(--background);
}

/* Welcome bar */
.me-welcome-bar {
  background: linear-gradient(135deg, rgba(71,133,89,0.12) 0%, rgba(57,160,202,0.10) 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.me-welcome-text h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.me-welcome-text p { color: var(--text-muted); font-size: 0.85rem; }
.me-welcome-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(71,133,89,0.15);
  border: 1px solid rgba(71,133,89,0.3);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6ee7b7;
}

/* 3-column layout */
.me-hub-layout {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  align-items: start;
}

/* ── LEFT SIDEBAR ── */
.me-sidebar-left { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

.me-profile-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.me-profile-cover {
  height: 64px;
  background: linear-gradient(135deg, #478559 0%, #39a0ca 100%);
}
.me-profile-body { padding: 0 20px 20px; }
.me-avatar-wrap {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #478559, #39a0ca);
  border: 3px solid var(--surface-2);
  margin-top: -28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #fff;
  font-family: var(--font-display);
  user-select: none;
}
.me-profile-name {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700; color: #fff;
  margin: 10px 0 2px;
}
.me-profile-type {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.me-profile-type span {
  background: rgba(71,133,89,0.15);
  color: #6ee7b7;
  border: 1px solid rgba(71,133,89,0.25);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 0.72rem; font-weight: 600;
}
.me-profile-stats {
  display: flex; gap: 12px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.me-stat-mini { text-align: center; flex: 1; }
.me-stat-mini strong { display: block; font-size: 1rem; font-weight: 700; color: #fff; }
.me-stat-mini small { font-size: 0.7rem; color: var(--text-muted); }

/* Quick nav */
.me-quick-nav { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 8px; }
.me-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-muted); font-size: 0.87rem; font-weight: 500;
  cursor: pointer; transition: all 0.18s; border: none; background: none; width: 100%; text-align: left;
}
.me-nav-item:hover, .me-nav-item.active { background: rgba(255,255,255,0.06); color: #fff; }
.me-nav-item .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

/* Disciplines */
.me-disciplines { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.me-section-title { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.disc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.disc-tag {
  padding: 4px 10px; border-radius: 99px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.76rem; cursor: pointer;
  transition: all 0.18s;
}
.disc-tag:hover, .disc-tag.active {
  background: rgba(71,133,89,0.15);
  border-color: rgba(71,133,89,0.35);
  color: #6ee7b7;
}

/* ── MAIN FEED ── */
.me-main-feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Search + filter bar */
.me-feed-controls {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.me-search-row { display: flex; align-items: center; gap: 10px; }
.me-search-input-wrap { flex: 1; position: relative; }
.me-search-input-wrap .me-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; }
.me-search-input {
  width: 100%; padding: 9px 12px 9px 36px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 99px; color: var(--text); font-family: inherit; font-size: 0.88rem;
}
.me-search-input:focus { outline: none; border-color: rgba(255,255,255,0.2); }
.me-search-input::placeholder { color: var(--text-muted); }
.me-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.me-filter-tab {
  padding: 6px 14px; border-radius: 99px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.me-filter-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.me-filter-tab.active {
  background: linear-gradient(135deg, rgba(71,133,89,0.2), rgba(57,160,202,0.2));
  border-color: rgba(71,133,89,0.5);
  color: #6ee7b7;
}

/* ── NEWS CARD ── */
.me-news-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
  display: block; text-decoration: none;
}
.me-news-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.me-news-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.73rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 10px;
}
.me-news-cat .cat-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.me-news-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1.4;
  margin-bottom: 8px;
}
.me-news-summary { color: var(--text-muted); font-size: 0.87rem; line-height: 1.6; margin-bottom: 14px; }
.me-news-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.me-news-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-news-source { font-size: 0.76rem; color: var(--text-muted); font-weight: 500; }
.me-news-time { font-size: 0.74rem; color: var(--text-muted); }
.me-read-btn {
  padding: 6px 14px; border-radius: 99px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; text-decoration: none; display: inline-block;
}
.me-read-btn:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.me-news-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.me-tag {
  padding: 2px 8px; border-radius: 99px; font-size: 0.72rem; font-weight: 500;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-muted);
}

/* ── RESOURCE CARD (book/paper/video) ── */
.me-resource-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex; gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.me-resource-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.me-res-icon-wrap {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.me-res-body { flex: 1; min-width: 0; }
.me-res-type-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.me-res-type-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 99px;
}
.me-res-title {
  font-family: var(--font-display);
  font-size: 0.98rem; font-weight: 700; color: #fff; margin-bottom: 3px; line-height: 1.35;
}
.me-res-author { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.me-res-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; }
.me-res-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.me-rating { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; }
.me-rating .stars { color: #f59e0b; }
.me-rating .count { color: var(--text-muted); }
.me-res-actions { display: flex; gap: 8px; }
.me-res-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text-muted);
}
.me-res-btn:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.me-res-btn.primary {
  background: rgba(71,133,89,0.15); border-color: rgba(71,133,89,0.35); color: #6ee7b7;
}
.me-res-btn.primary:hover { background: rgba(71,133,89,0.25); }

/* ── RIGHT SIDEBAR ── */
.me-sidebar-right { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

.me-sidebar-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
.me-sidebar-card-title {
  font-family: var(--font-display);
  font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* Trending */
.trending-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-tag { font-size: 0.85rem; font-weight: 600; color: var(--text); transition: color 0.18s; }
.trending-item:hover .trending-tag { color: #39a0ca; }
.trending-count { font-size: 0.72rem; color: var(--text-muted); }

/* Events */
.event-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.event-item:last-child { border-bottom: none; padding-bottom: 0; }
.event-name { font-size: 0.87rem; font-weight: 600; color: #fff; margin-bottom: 3px; }
.event-meta { font-size: 0.76rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.event-type {
  font-size: 0.7rem; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
  background: rgba(57,160,202,0.15); color: #67e8f9;
  border: 1px solid rgba(57,160,202,0.25);
}

/* Community stats card */
.comm-stat { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.comm-stat:last-child { border-bottom: none; }
.comm-stat-label { font-size: 0.82rem; color: var(--text-muted); }
.comm-stat-val { font-size: 0.88rem; font-weight: 700; color: #fff; }

/* Feed card entrance animation */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeSlideUp 0.3s ease both; }

/* Responsive */
@media (max-width: 1100px) {
  .me-hub-layout { grid-template-columns: 220px 1fr; }
  .me-sidebar-right { display: none; }
}
@media (max-width: 768px) {
  .me-hub-layout { grid-template-columns: 1fr; }
  .me-sidebar-left { position: static; }
  .me-welcome-bar { padding: 16px 20px; }
}
