/* ============================================
   UKEK - University Kousba el Koura
   Official University Website Stylesheet
   Est. Saturday Night / Sunday Morning
   ============================================ */

/* --- CSS Variables (University Brand) --- */
:root {
  --ukek-red: #C8102E;
  --ukek-red-dark: #9B0A20;
  --ukek-green: #00843D;
  --ukek-green-dark: #006B31;
  --ukek-white: #FFFFFF;
  --ukek-black: #1A1A1A;
  --ukek-cream: #FAF8F5;
  --ukek-gold: #C5A55A;
  --ukek-gray-light: #F0EEEB;
  --ukek-gray-mid: #8C8279;
  --ukek-gray-dark: #4A4440;
  --ukek-text: #2D2926;
  --ukek-text-light: #6B6460;

  /* Typography */
  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing */
  --section-padding: 80px 0;
  --container-width: 1200px;
  --nav-height: 80px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--ukek-text);
  background-color: var(--ukek-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ukek-red);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--ukek-red-dark);
}

/* --- Utility Classes --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding);
}

.section--cream {
  background-color: var(--ukek-cream);
}

.section--dark {
  background-color: var(--ukek-black);
  color: var(--ukek-white);
}

.section--green {
  background-color: var(--ukek-green);
  color: var(--ukek-white);
}

.section--red {
  background-color: var(--ukek-red);
  color: var(--ukek-white);
}

.text-center {
  text-align: center;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ukek-black);
}

.section--dark h1, .section--dark h2, .section--dark h3,
.section--green h1, .section--green h2, .section--green h3,
.section--red h1, .section--red h2, .section--red h3 {
  color: var(--ukek-white);
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2.4rem; margin-bottom: 16px; }
h3 { font-size: 1.5rem; margin-bottom: 12px; }
h4 { font-size: 1.15rem; margin-bottom: 8px; }

.section-subtitle {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--ukek-text-light);
  max-width: 640px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.section--dark .section-subtitle,
.section--green .section-subtitle,
.section--red .section-subtitle {
  color: rgba(255,255,255,0.8);
}

.label-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--ukek-red);
  margin-bottom: 12px;
}

.section--dark .label-tag { color: var(--ukek-gold); }
.section--green .label-tag { color: rgba(255,255,255,0.7); }

/* --- News Ticker --- */
.news-ticker {
  background-color: var(--ukek-black);
  color: var(--ukek-white);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  position: relative;
}

.news-ticker::before {
  content: 'BREAKING';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--ukek-red);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 2px;
  z-index: 2;
}

.ticker-content {
  display: inline-block;
  padding-left: 120px;
  animation: ticker-scroll 35s linear infinite;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* --- Top Bar --- */
.top-bar {
  background-color: var(--ukek-black);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: rgba(255,255,255,0.7);
  margin-left: 20px;
}

.top-bar a:hover {
  color: var(--ukek-white);
}

/* --- Header / Navigation --- */
.site-header {
  background-color: var(--ukek-white);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ukek-black);
}

.logo img {
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ukek-black);
}

.logo-full {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ukek-gray-mid);
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ukek-text);
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ukek-red);
  background-color: rgba(200, 16, 46, 0.06);
}

.nav-cta {
  background-color: var(--ukek-red) !important;
  color: var(--ukek-white) !important;
  padding: 10px 24px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  margin-left: 8px;
}

.nav-cta:hover {
  background-color: var(--ukek-red-dark) !important;
  color: var(--ukek-white) !important;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ukek-black);
  margin: 6px 0;
  transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--ukek-black) 0%,
    #2a1215 40%,
    var(--ukek-red-dark) 100%
  );
  color: var(--ukek-white);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 24px;
}

.hero h1 {
  font-size: 4rem;
  color: var(--ukek-white);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero .motto {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ukek-gold);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn--primary {
  background-color: var(--ukek-red);
  color: var(--ukek-white);
  border-color: var(--ukek-red);
}

.btn--primary:hover {
  background-color: var(--ukek-red-dark);
  border-color: var(--ukek-red-dark);
  color: var(--ukek-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(200, 16, 46, 0.3);
}

.btn--outline {
  background-color: transparent;
  color: var(--ukek-white);
  border-color: rgba(255,255,255,0.4);
}

.btn--outline:hover {
  background-color: var(--ukek-white);
  color: var(--ukek-black);
  border-color: var(--ukek-white);
  transform: translateY(-2px);
}

.btn--green {
  background-color: var(--ukek-green);
  color: var(--ukek-white);
  border-color: var(--ukek-green);
}

.btn--green:hover {
  background-color: var(--ukek-green-dark);
  border-color: var(--ukek-green-dark);
  color: var(--ukek-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 132, 61, 0.3);
}

.btn--dark {
  background-color: var(--ukek-black);
  color: var(--ukek-white);
}

.btn--dark:hover {
  background-color: #333;
  transform: translateY(-2px);
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--ukek-white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 48px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-item h3 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  color: var(--ukek-red);
  margin-bottom: 4px;
}

.stat-item p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ukek-gray-mid);
  font-weight: 500;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.card {
  background: var(--ukek-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.card-icon {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, var(--ukek-cream) 0%, #f0e8e0 100%);
}

.card-body {
  padding: 28px;
}

.card-body h3 {
  font-family: var(--font-serif);
  margin-bottom: 12px;
}

.card-body p {
  color: var(--ukek-text-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(200, 16, 46, 0.08);
  color: var(--ukek-red);
}

.card-tag--green {
  background: rgba(0, 132, 61, 0.08);
  color: var(--ukek-green);
}

.card-tag--gold {
  background: rgba(197, 165, 90, 0.15);
  color: #8B7332;
}

/* --- Faculty Grid --- */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px;
}

.faculty-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--ukek-white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faculty-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.faculty-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--ukek-cream) 0%, #ece4da 100%);
  border: 3px solid var(--ukek-gold);
}

.faculty-card h3 {
  margin-bottom: 4px;
}

.faculty-card .title {
  font-size: 0.85rem;
  color: var(--ukek-red);
  font-weight: 600;
  margin-bottom: 4px;
}

.faculty-card .dept {
  font-size: 0.8rem;
  color: var(--ukek-gray-mid);
  margin-bottom: 16px;
}

.faculty-card .bio {
  font-size: 0.9rem;
  color: var(--ukek-text-light);
  line-height: 1.6;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ukek-red);
  opacity: 0.2;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ukek-red);
  border: 3px solid var(--ukek-white);
  box-shadow: 0 0 0 2px var(--ukek-red);
}

.timeline-item .year {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ukek-red);
  margin-bottom: 6px;
}

.timeline-item h4 {
  margin-bottom: 8px;
}

.timeline-item p {
  color: var(--ukek-text-light);
  font-size: 0.95rem;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.testimonial {
  background: var(--ukek-white);
  padding: 36px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  position: relative;
}

.testimonial::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 5rem;
  color: var(--ukek-red);
  opacity: 0.15;
  position: absolute;
  top: 8px;
  left: 24px;
  line-height: 1;
}

.testimonial blockquote {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ukek-text);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.testimonial .author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ukek-black);
}

.testimonial .author-info {
  font-size: 0.8rem;
  color: var(--ukek-gray-mid);
}

/* --- Facilities List --- */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.facility-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--ukek-white);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.facility-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.facility-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.facility-item h4 {
  font-family: var(--font-serif);
  margin-bottom: 6px;
}

.facility-item p {
  font-size: 0.9rem;
  color: var(--ukek-text-light);
}

/* --- Page Hero (Subpages) --- */
.page-hero {
  background: linear-gradient(135deg, var(--ukek-black) 0%, #2a1215 50%, var(--ukek-red-dark) 100%);
  color: var(--ukek-white);
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero h1 {
  color: var(--ukek-white);
  position: relative;
  z-index: 1;
}

.page-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 16px auto 0;
  position: relative;
  z-index: 1;
}

/* --- Rejection Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--ukek-white);
  border-radius: 16px;
  padding: 48px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal .modal-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.modal h2 {
  margin-bottom: 12px;
}

.modal p {
  color: var(--ukek-text-light);
  margin-bottom: 28px;
  line-height: 1.7;
}

.modal .btn {
  min-width: 180px;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--ukek-black);
  color: rgba(255,255,255,0.6);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo-name {
  color: var(--ukek-white);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.footer-brand .motto {
  font-style: italic;
  color: var(--ukek-gold);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col h4 {
  color: var(--ukek-white);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--ukek-white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  margin-left: 16px;
}

/* --- Prereq badges --- */
.prereq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prereq-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0,0,0,0.06);
  color: var(--ukek-gray-dark);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.8rem; }
  .hero { min-height: 70vh; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--ukek-white);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .faculty-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .section { padding: 56px 0; }
  .page-hero { padding: 100px 0 60px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .faculty-grid { grid-template-columns: 1fr; }
  .facilities-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
}
