/* Light Mode Colors/Settings */
:root {
  /* Background/Text Colors */
  --bg: #F4F7FB;
  --text: #1f2937;
  --muted: #6b7280;
  --surface: #ffffff;
  --border: #e5eaf2;
  --shadow: rgba(0,0,0,0.05);

  /* Brand Colors (Identical to UFKSA page) */
  --primary: #08415C;
  --primary-600: #063246;
  --accent: #F7B478;
  --accent-600: #E2A467;
  --cta: #E169A7;
  --info: #10BBD8;
  --success: #69B578;
  --success-600: #4f9e63;
  --neutral-900: #474347;

  
  --radius: 14px;
  --radius-sm: 10px;
  
  --page-pad-x: 2rem;
}

/* Dark Mode Colors/Settings */
[data-theme="dark"] {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --surface: #0f172a;
  --border: #1f2a44;
  --shadow: rgba(0,0,0,0.30);

  --primary: #08415C;
  --primary-600: #063246;
  --accent: #F7B478;
  --accent-600: #E2A467;
  --cta: #E169A7;
  --info: #10BBD8;
  --success: #69B578;
  --success-600: #4f9e63;
  --neutral-900: #d3d3d3;
}

/* Base Styles Section */

/* Applies box-sizing to all elements */
* { 
  box-sizing: border-box; 
}

/* Makes HTML and body take up full page height */
html, body { 
  height: 100%; 
}

/* Body Styling Section */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  
  /* Makes text look smoother on different browsers */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings Font Section */
.header h1,
h1, h2, h3,
.card-title,
.modal-title {
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header Section */
/* Main Header Container */
.header {
  position: relative;
  background:
    radial-gradient(1200px 600px at 0% -20%, rgba(255,255,255,0.10), transparent 60%),
    linear-gradient(135deg, #063246 0%, #0b5678 100%);
  
  color: #fff;
  padding: 2.6rem var(--page-pad-x) 2.3rem;
  box-shadow: 0 6px 18px var(--shadow);
  overflow: hidden;
  text-align: center;
}

/* Hides before and after pseudo-elements */
.header::before { 
  display: none; 
  content: none; 
}

.header::after { 
  display: none; 
  content: none; 
}

/* Header Title Section */
.header h1 {
  font-size: 2.2rem;
  letter-spacing: .3px;
  margin: 0 0 .5rem 0;
  position: relative;
  color: transparent; 
}

/* Creates gradient text effect for title */
.header h1::after {
  content: 'UF K?Market';
  display: inline-block;
  
  /* Gradient colors for the text */
  background: linear-gradient(90deg, var(--accent), var(--info), #ffffff);
  
  /* Applies gradient to text instead of background */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  
  /* Adds subtle shadow effect */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

/* Adjusts gradient for Dark Mode */
[data-theme="dark"] .header h1::after {
  background: linear-gradient(90deg, #F7B478, #10BBD8, #e5e7eb);
}

/* Header Paragraph */
.header p { 
  margin: 0; 
  opacity: .95; 
  font-size: 1rem; 
}

/* Badge Container Section */
.header-badges { 
  margin-top: .6rem; 
  display: inline-flex; 
  gap: .4rem; 
}

/* Individual Badges */
.badge {
  display: inline-block;
  padding: .28rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Alternative Badge Style */
.badge.alt { 
  background: rgba(255,255,255,.06); 
}

/* Logo Section */

/* UF K-Market Logo */
.header .logo {
  position: absolute;
  left: var(--page-pad-x);
  top: 50%;
  transform: translateY(-50%); 
  height: 72px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); 
}

/* Shrinks logo for mobile phones */
@media (max-width: 480px) {
  .header .logo { 
    height: 56px; 
    left: .75rem; 
  }
}

/* Theme Toggle Button Section */

/* Positions toggle button in header */
.header .theme-toggle { 
  position: absolute; 
  right: var(--page-pad-x); 
  top: 50%; 
  transform: translateY(-50%);
}

/* Toggle Button when Hovered */
.header .theme-toggle:hover { 
  transform: translateY(-50%) scale(1.03); 
}

/* Theme Toggle Button Styles */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  border-radius: 999px; 
  backdrop-filter: blur(6px); 
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
  width: 74px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(72, 89, 121, 0.35);
  background: rgba(168, 171, 175, 0.28);
  display: inline-block;
  position: absolute;
  --thumb-x: 0px;
  overflow: hidden;
}

/* Toggle button hover effect */
.theme-toggle:hover { 
  transform: scale(1.03); 
}

/* Sun and Moon Icons (match HTML classes) */
.theme-toggle .sunIcon,
.theme-toggle .moonIcon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0; /* hide any fallback text */
  width: 16px;
  height: 16px;
  line-height: 1;
  opacity: 0; /* default hidden; sun shown by default below */
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
  z-index: 3; /* ensure icons sit above the thumb */
  pointer-events: none;
}

/* Place icons left/right inside the track */
.theme-toggle .sunIcon { left: 10px; opacity: .85; }
.theme-toggle .moonIcon { right: 10px; }

/* Sliding Thumb */
.theme-toggle .thumb { 
  position: absolute; 
  top: 50%; 
  left: 2px; 
  width: 32px; 
  height: 32px; 
  border-radius: 999px; 
  
  background: linear-gradient(180deg, #cfd6e4 0%, #a9b6c9 100%); 
  border: 1px solid rgba(17,25,40,.18);
  box-shadow: 0 6px 16px rgba(0,0,0,.22), inset 0 1px 0 rgba(200,210,230,.55), inset 0 -1px 0 rgba(0,0,0,.08); 
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease; 
  transform: translate(var(--thumb-x), -50%); 
  z-index: 2;
}

/* Adds highlight effect to thumb */
.theme-toggle .thumb::after { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  border-radius: inherit; 
  
  /* Creates a light reflection effect */
  background: radial-gradient(60% 50% at 30% 25%, rgba(200,210,230,.45), transparent 60%); 
  pointer-events: none; 
}

[data-theme="dark"] .theme-toggle .moonIcon { 
  opacity: 1; 
}

/* When in dark theme, hide sun explicitly */
[data-theme="dark"] .theme-toggle .sunIcon {
  opacity: 0;
}

/* Moves thumb to the right */
[data-theme="dark"] .theme-toggle { 
  /* 74(track) - 2(left) - 32(width) - 2(margin) -> translate from base left(2px) */
  --thumb-x: 36px; 
}

/* Darker Thumb for Dark Mode */
[data-theme="dark"] .theme-toggle .thumb { 
  background: linear-gradient(180deg, #4a5b7a 0%, #384a6a 100%); 
  border-color: rgba(17,25,40,.35); 
  box-shadow: 0 8px 20px rgba(0,0,0,.5), inset 0 1px 0 rgba(200,210,230,.12), inset 0 -1px 0 rgba(0,0,0,.35); 
}

/* Focuses outline when navigating with keyboard */
.theme-toggle:focus-visible { 
  outline: none; 
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 45%, transparent); 
}

/* Adjusts toggle button border and background for Dark Mode */
[data-theme="dark"] .theme-toggle { 
  border-color: rgba(140,160,200,.28); 
  background: rgba(35,45,75,.50);
}

/* Provide SVG icons via CSS so they always render */
.theme-toggle .sunIcon::before,
.theme-toggle .moonIcon::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Light theme icons (dark ink) */
.theme-toggle .sunIcon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2430' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}
.theme-toggle .moonIcon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a2430'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

/* Dark theme icons (light ink) */
[data-theme="dark"] .theme-toggle .sunIcon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}
[data-theme="dark"] .theme-toggle .moonIcon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

/* Header Section */
.header { 
  background: #08415C; 
  padding: 2.2rem var(--page-pad-x) 2rem; 
  min-height: 140px; 
}

/* Title */
.header h1 { 
  color: inherit; 
  font-size: 2rem; 
  margin: 0 0 .4rem 0; 
  letter-spacing: .3px; 
}

.header h1::after { 
  content: none !important; 
}

/* Paragraph */
.header p { 
  margin: 0; 
  opacity: .92; 
  font-size: .95rem; 
}

/* Hides Badges */
.header-badges { 
  display: none; 
}

/* Header Inner Container */
.header-inner { 
  position: relative; 
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 0; 
}

/* Larger logo for header */
.header .logo { 
  left: var(--page-pad-x); 
  height: 120px; 
}

/* Theme toggle position in header */
.header .theme-toggle { 
  right: var(--page-pad-x); 
}

/* Smaller logo for mobile in header */
@media (max-width: 480px) { 
  .header .logo { 
    height: 90px; 
  } 
}
