/* ============================================================
   UW MADISON THEME FOR MADCLOUD WEBSITE
   Matches official UW Computer Sciences website design
   https://www.cs.wisc.edu/
   ============================================================ */

/* ============================================================
   ROOT DESIGN TOKENS (UW Madison Official Colors)
   ============================================================ */

:root {
  /* UW Madison Primary Colors (Official Palette) */
  --uw-red: #c5050c;           /* Cardinal Red - Primary */
  --uw-red-dark: #a00408;      /* Darker red for hover */
  --uw-red-light: #d42021;     /* Lighter red for accents */
  --uw-gold: #ffc52e;          /* Wisconsin Gold - Accent */
  --uw-gold-dark: #f5b913;     /* Darker gold for hover */
  
  /* UW Neutral Colors */
  --uw-black: #1a1a1a;         /* Deep black for text */
  --uw-white: #ffffff;         /* Clean white */
  --uw-gray: #f0f0f0;          /* Light gray background */
  --uw-gray-light: #f8f8f8;    /* Lighter gray for sections */
  --uw-gray-dark: #666666;     /* Medium gray for text */
  --uw-gray-darker: #333333;   /* Dark gray for secondary text */
  --uw-gray-border: #e0e0e0;   /* Light border color */
  
  /* Functional Colors */
  --success: #228B22;          /* Green for success */
  --warning: #ff9800;          /* Orange for warning */
  --error: #d32f2f;            /* Red for errors */
  --info: #2196f3;             /* Blue for info */

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-serif: 'Georgia', serif;
  --font-mono: 'Monaco', 'Courier New', monospace;

  /* Spacing Scale */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Border Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.2);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-modal: 1000;
  --z-tooltip: 1100;

  /* Typography Sizes */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 19px;
  --text-2xl: 23px;
  --text-3xl: 28px;
  --text-4xl: 32px;
  --text-5xl: 38px;

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --leading-loose: 2;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

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

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

body {
  font-family: var(--font-sans);
  color: var(--uw-black);
  background-color: var(--uw-white);
  line-height: var(--leading-normal);
  font-size: var(--text-base);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-4);
  color: var(--uw-black);
}

h1 {
  font-size: var(--text-5xl);
  color: var(--uw-red);
}

h2 {
  font-size: var(--text-4xl);
  color: var(--uw-black);
  border-bottom: 3px solid var(--uw-red);
  padding-bottom: var(--sp-3);
  display: inline-block;
}

h3 {
  font-size: var(--text-3xl);
  color: var(--uw-black);
}

h4 {
  font-size: var(--text-2xl);
  color: var(--uw-black);
}

h5 {
  font-size: var(--text-xl);
  color: var(--uw-gray-darker);
}

h6 {
  font-size: var(--text-lg);
  color: var(--uw-gray-darker);
  text-transform: uppercase;
  letter-spacing: 1px;
}

p {
  margin-bottom: var(--sp-4);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--uw-red);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--uw-red-dark);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--uw-gold);
  outline-offset: 2px;
}

strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

/* ============================================================
   TOP BAR (Matches UW CS Design)
   ============================================================ */

.top-bar {
  background-color: var(--uw-red);
  color: var(--uw-white);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  border-bottom: 2px solid var(--uw-red-dark);
}

.top-bar a {
  color: var(--uw-white);
  text-decoration: none;
}

.top-bar a:hover {
  text-decoration: underline;
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */

header {
  background-color: var(--uw-white);
  border-bottom: 1px solid var(--uw-gray-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-1) var(--sp-4);
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--uw-red);
  flex-shrink: 0;
}

.logo:hover {
  color: var(--uw-red-dark);
}

.logo img {
  height: auto;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-madcloud {
  height: 75px !important;
  width: auto !important;
}

.uw-crest-logo {
  height: 75px !important;
  width: auto !important;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.logo-text strong {
  color: var(--uw-red);
  font-size: var(--text-lg);
  font-weight: 700;
}

.logo-text span {
  color: var(--uw-gray-dark);
  font-size: var(--text-xs);
  font-weight: 400;
}
.hero-logo {
  height: 160px;
  width: auto;
  margin-bottom: var(--sp-5);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.footer-logo {
  height: 65px;
  width: auto;
  margin-bottom: var(--sp-3);
  display: block;
}
/* Navigation Menu */
nav {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

nav a {
  color: var(--uw-black);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: var(--sp-1) var(--sp-2);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
}

nav a:hover,
nav a.active {
  color: var(--uw-red);
  border-bottom-color: var(--uw-red);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--text-2xl);
  cursor: pointer;
  color: var(--uw-red);
  padding: var(--sp-2);
}

/* Mobile Navigation */
#main-nav {
  display: flex;
  gap: var(--sp-4);
}

#main-nav.is-open {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--uw-white);
  flex-direction: column;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--uw-gray-border);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
  background: linear-gradient(135deg, var(--uw-red) 0%, var(--uw-red-dark) 100%);
  color: var(--uw-white);
  padding: var(--sp-9) var(--sp-4);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: var(--uw-white);
  font-size: var(--text-5xl);
  margin-bottom: var(--sp-5);
  line-height: var(--leading-tight);
}

.hero p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-5);
}

.hero-cta {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  font-size: var(--text-base);
}

.btn:focus {
  outline: 2px solid var(--uw-gold);
  outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
  background-color: var(--uw-red);
  color: var(--uw-white);
  border-color: var(--uw-red);
}

.btn-primary:hover {
  background-color: var(--uw-red-dark);
  border-color: var(--uw-red-dark);
  box-shadow: var(--shadow-lg);
}

/* Secondary Button */
.btn-secondary {
  background-color: #333333;
  color: var(--uw-white);
  border-color: #333333;
}

.btn-secondary:hover {
  background-color: #444444;
  border-color: #444444;
  box-shadow: var(--shadow-lg);
}

/* Outline Button */
.btn-outline {
  background-color: #333333;
  color: var(--uw-white);
  border-color: #333333;
}

.btn-outline:hover {
  background-color: #444444;
  border-color: #444444;
  box-shadow: var(--shadow-lg);
}

.btn-small {
  padding: var(--sp-2) var(--sp-3) !important;
  font-size: var(--text-sm) !important;
  display: inline-block;
  margin-right: var(--sp-2);
}

/* Team Card Styling */
.team-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--sp-4);
  border: 3px solid var(--uw-red);
}

.role-list {
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0;
  text-align: center;
}

.role-list li {
  color: var(--uw-black);
  font-size: var(--text-sm);
  padding: var(--sp-1) 0;
  border-left: 3px solid var(--uw-red);
  padding-left: var(--sp-2);
  margin: var(--sp-1) 0;
}

.team-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

/* ============================================================
   CONTENT SECTION LAYOUT
   ============================================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.section {
  padding: var(--sp-9) var(--sp-4);
}

.section-light {
  background-color: var(--uw-gray-light);
}

.section-dark {
  background-color: var(--uw-gray);
}

/* ============================================================
   CARD COMPONENTS
   ============================================================ */

.card {
  background-color: var(--uw-white);
  border: 1px solid var(--uw-gray-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--uw-red) 0%, var(--uw-gold) 100%);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--uw-red);
}

.card h3 {
  color: var(--uw-red);
  margin-top: 0;
}

/* ============================================================
   GRID LAYOUT
   ============================================================ */

.grid {
  display: grid;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   FORMS
   ============================================================ */

form {
  margin: var(--sp-6) 0;
}

.form-group {
  margin-bottom: var(--sp-5);
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--uw-black);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
textarea,
select {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--uw-gray-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--uw-red);
  box-shadow: 0 0 0 3px rgba(197, 5, 12, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background-color: #333333;
  color: #cccccc;
  padding: var(--sp-8) var(--sp-4) var(--sp-4);
  margin-top: var(--sp-9);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.footer-section h3 {
  color: #ffffff;
  margin-top: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--sp-2);
}

.footer-section p {
  color: #cccccc;
  line-height: 1.6;
}

.footer-section a {
  color: #cccccc;
  text-decoration: underline;
}

.footer-section a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #555555;
  padding-top: var(--sp-4);
  text-align: center;
  color: #999999;
  font-size: var(--text-sm);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Margin & Padding */
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }

.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

.px-2 { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-red { color: var(--uw-red); }
.text-gold { color: var(--uw-gold); }
.text-gray { color: var(--uw-gray-dark); }
.text-white { color: var(--uw-white); }

/* Text Styles */
.text-bold { font-weight: 700; }
.text-uppercase { text-transform: uppercase; }
.text-italic { font-style: italic; }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }

/* Flexbox Utilities */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .menu-toggle {
    display: block;
    position: absolute;
    right: var(--sp-4);
    top: 50%;
    transform: translateY(-50%);
  }

  #main-nav {
    display: none;
  }

  #main-nav.is-open {
    display: flex;
  }

  nav {
    gap: var(--sp-4);
    flex-direction: column;
    width: 100%;
  }

  nav a {
    padding: var(--sp-3);
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  nav a:hover,
  nav a.active {
    border-left-color: var(--uw-red);
    border-bottom: none;
  }

  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  .hero {
    padding: var(--sp-7) var(--sp-4);
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .section {
    padding: var(--sp-6) var(--sp-4);
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-fade-in {
  animation: fade-in 0.6s ease-out;
}

.animate-slide-up {
  animation: slide-up 0.6s ease-out;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--uw-gold);
  outline-offset: 2px;
}
