/* ==========================================================================
   VCAP — School of Computer Science and Engineering (SCOPE), VIT
   Clean, standalone stylesheet matching the exact design specification
   Palette: Academic Paper, Sapphire Navy, and Warm Brass
   ========================================================================== */

/* --------------------------------------------------------------------------
   Core Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Academic palette: paper, navy, and brass (exact tokens from sourcecode_ritika) */
  --background: oklch(97.5% 0.006 95);           /* #f8f7f2 - Warm paper background */
  --foreground: oklch(22% 0.025 255);            /* #131b26 - Slate charcoal foreground */
  --card: oklch(98.5% 0.005 95);                 /* #fbfaf6 - Crisp warm card paper surface */
  --card-foreground: oklch(20% 0.025 255);       /* #111822 - Card text */
  --primary: oklch(42% 0.07 245);                /* #295171 - Signature academic navy */
  --primary-foreground: oklch(97% 0.006 95);     /* #f6f5f1 - Light primary text */
  --secondary: oklch(93% 0.012 95);              /* #eae8df - Warm secondary paper button */
  --secondary-foreground: oklch(26% 0.025 255);  /* #1c2530 - Secondary button text */
  --muted: oklch(92% 0.009 95);                  /* #e6e5de - Muted background */
  --muted-foreground: oklch(46% 0.02 255);       /* #515963 - Academic muted grey */
  --accent: oklch(74% 0.16 75);                  /* #e49900 - Warm brass/gold accent */
  --accent-foreground: oklch(26% 0.03 255);      /* #1c2530 - Brass accent foreground */
  --border: oklch(89% 0.008 95);                 /* #dcdbd5 - Subtle paper border */
  --input: oklch(90% 0.008 95);                  /* #dfded8 - Input border */
  --ring: oklch(42% 0.07 245);                   /* #295171 - Focus ring */

  /* VCAP Branding Sapphire & Icon Palette */
  --blue-600: #2563eb;                           /* Brand blue for VCAP word & icons */
  --blue-50: #eff6ff;                            /* Soft blue icon container */

  /* Radii from sourcecode_ritika design system */
  --radius: 0.35rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);

  /* Typography */
  --font-serif: 'EB Garamond', Georgia, serif;
  --font-sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  font-feature-settings: 'liga' 1, 'kern' 1;
  letter-spacing: -0.005em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

::selection {
  background: color-mix(in oklch, var(--accent) 40%, var(--primary) 35%);
  color: var(--primary-foreground);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  letter-spacing: -0.015em;
  font-weight: 700;
}

h3, h4 {
  font-weight: 600;
}

p, li {
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   1. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  height: 3.5rem; /* 56px */
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 84rem; /* 1344px */
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .header-container {
    padding: 0 1.5rem;
  }
}

.header-brand {
  display: inline-flex;
  align-items: center;
}

.header-logo-img {
  height: 1.35rem; /* ~22px */
  width: auto;
  object-fit: contain;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .header-title {
    font-size: 0.9375rem;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  background-color: var(--secondary);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.header-home-btn:hover {
  background-color: color-mix(in oklch, var(--secondary) 82%, black);
}

.home-icon {
  width: 1rem;
  height: 1rem;
}

/* --------------------------------------------------------------------------
   2. Main Container
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .main-wrapper {
    padding: 1.5rem 1.5rem 2.5rem;
  }
}

/* Large Bordered Hero Card Container */
.hero-card {
  position: relative;
  width: 100%;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem; /* rounded-2xl */
  padding: 1.5rem 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

@media (min-width: 640px) {
  .hero-card {
    padding: 2rem 2rem;
  }
}

@media (min-width: 1024px) {
  .hero-card {
    padding: 2.25rem 2.75rem 2.5rem;
  }
}

/* VIT Logo positioned at top-left */
.vit-logo {
  height: auto;
  width: 8.5rem; /* ~136px */
  margin-bottom: 1rem;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .vit-logo {
    position: absolute;
    left: 2.5rem;
    top: 2rem;
    width: 9.5rem;
    margin-bottom: 0;
    z-index: 10;
  }
}

/* --------------------------------------------------------------------------
   TOP SECTION: VCAP Branding & Intro (Centered above cards)
   -------------------------------------------------------------------------- */
.top-intro-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

@media (min-width: 1024px) {
  .top-intro-section {
    padding: 0.5rem 3rem 0;
    margin-bottom: 2.25rem;
  }
}

/* VCAP Logo Row: Cap/V Mark + Serif "VCAP" */
.vcap-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.vcap-logo-mark-wrap {
  position: relative;
  width: 4.25rem; /* ~68px */
  height: 4.25rem;
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 640px) {
  .vcap-logo-mark-wrap {
    width: 4.75rem; /* ~76px */
    height: 4.75rem;
  }
}

.vcap-logo-mark-img {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: auto;
  max-width: none;
}

.vcap-brand-name {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--blue-600);
  line-height: 1;
}

@media (min-width: 640px) {
  .vcap-brand-name {
    font-size: 3.75rem;
  }
}

/* Introductory Paragraph */
.vcap-intro-text {
  max-width: 48rem; /* ~768px */
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
  text-align: center;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .vcap-intro-text {
    font-size: 0.9375rem;
  }
}

/* --------------------------------------------------------------------------
   BELOW INTRODUCTION: Scrollable Portal Grid Area
   -------------------------------------------------------------------------- */
.portals-scroll-container {
  width: 100%;
  max-height: 42rem; /* Comfortably displays 6 cards (all 3 rows) without any clipping or scrollbars; becomes scrollable when 10+ cards are added */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0.35rem 0.5rem 0.125rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Webkit Scrollbar Styling (Minimal, Academic, Blends Seamlessly) */
.portals-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.portals-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.portals-scroll-container::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 9999px;
  transition: background-color 0.15s ease;
}

.portals-scroll-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .portals-scroll-container {
    max-height: none; /* Flow naturally on mobile screens to prevent nested scroll trapping */
    overflow-y: visible;
  }
}

/* --------------------------------------------------------------------------
   Portal Cards Grid
   -------------------------------------------------------------------------- */
.portal-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.125rem;
  width: 100%;
}

@media (min-width: 768px) {
  .portal-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

/* Individual Portal Card */
.portal-card {
  position: relative;
  min-height: 170px;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem; /* rounded-xl (12px) */
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-card:hover {
  border-color: color-mix(in oklch, var(--border) 60%, var(--primary) 40%);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

/* Card Header: Icon + Title */
.card-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon-box {
  width: 2.5rem; /* size-10 (40px) */
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem; /* rounded-lg (8px) */
  background-color: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-600);
}

@media (min-width: 640px) {
  .card-icon-box {
    width: 2.75rem; /* size-11 (44px) */
    height: 2.75rem;
  }
}

.card-icon-box svg {
  width: 1.25rem; /* size-5 (20px) */
  height: 1.25rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--foreground);
}

@media (min-width: 1024px) {
  .card-title {
    font-size: 1.25rem; /* 20px */
  }
}

/* Card Description */
.card-description {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .card-description {
    font-size: 0.9375rem;
  }
}

/* Card Bottom Action Bar */
.card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.875rem;
}

/* Guidelines Text Link */
.link-guidelines {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.15s ease;
}

.link-guidelines:hover {
  opacity: 0.8;
}

/* Primary "Proceed →" Button */
.btn-proceed {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem; /* h-9 (36px) */
  padding: 0 0.875rem;
  border-radius: 0.375rem; /* rounded-md (6px) */
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-proceed:hover {
  background-color: color-mix(in oklch, var(--primary) 85%, black);
}

.btn-proceed:active {
  transform: translateY(1px);
}

.btn-proceed svg {
  width: 1rem; /* size-4 (16px) */
  height: 1rem;
}

/* Card: Schedule Lookup Dual Buttons */
.schedule-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 0.875rem;
  width: 100%;
}

.btn-faculty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem; /* h-9 */
  min-width: 7rem; /* min-w-28 (112px) */
  padding: 0 0.875rem;
  border-radius: 0.375rem;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-faculty:hover {
  background-color: color-mix(in oklch, var(--secondary) 85%, black);
}

.btn-faculty:active {
  transform: translateY(1px);
}

.btn-faculty svg {
  width: 1rem; /* size-4 */
  height: 1rem;
}

.btn-student {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem; /* h-9 */
  min-width: 7rem; /* min-w-28 (112px) */
  padding: 0 0.875rem;
  border-radius: 0.375rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-student:hover {
  background-color: color-mix(in oklch, var(--primary) 85%, black);
}

.btn-student:active {
  transform: translateY(1px);
}

.btn-student svg {
  width: 1rem; /* size-4 */
  height: 1rem;
}

