/* 
  Cristian Grigorescu final project CSCI E-12 Class - December 2025
  This is global styling css
*/


/* ──────────────── Basic Page Structure CSS ──────────────── */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: 'Playfair Display', serif;
}


body.no-scroll {
  overflow: hidden; /* Prevents background scroll when mobile menu is open */
}

main {
  flex: 1;
  margin-top: 2rem;
  max-width: 1200px;
  padding-left: 1rem;
  padding-right: 1rem;
}

header {
  width: 100%;
  background-color: #000000;
  border-top: 8px solid #bb8a35;
  border-bottom: 1px solid #ccc;
  color: #bb8a35;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  margin: 0;
}

footer {
  text-align: center;
  padding: 1rem 1rem 3rem;
  color: #000000;
  font-size: 0.9rem;
}

/* ──────────────── Page Navigation Desktop ──────────────── */

.navigation {
  display: flex;
  align-items: center;
}

.navigation a {
  color: #FFFFFF;
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 600;
}

.navigation a:hover {
  color: #bb8a35;
}

.navigation a.active {
  border-bottom: 2px solid #bb8a35;
  padding-bottom: 0.2rem;
}

.navigation a.active:hover {
  text-decoration: none;
  color: #ffffff;
}



/* ──────────────── Page Navigation Mobile ──────────────── */
.burger {
  display: none; /* mobile menu hide on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.burger-line {
  display: block;
  width: 26px;
  height: 3px;
  background: #bb8a35;
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}



/* ──────────────── Breadcrumb for secondary pages ──────────────── */
.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #000000;
  background-color: #F5F5F5;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.breadcrumb a {
  color: #8F6A28;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}



/* ──────────────── Stadium Map for homepage ──────────────── */
#map {
  height: 50vh;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.popup-title {
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: #0369c7;
  margin: 0;
}


/* ──────────────── Stadium Grid for homepage ──────────────── */
.stadium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.stadium-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
  will-change: transform;
  border: 1px solid #e0e0e0;
  display: block;
  text-decoration: none;
  color: inherit; 
}

.stadium-card:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}

.stadium-card_content {
  padding: 1rem;
}

.stadium-card_title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.stadium-card_location,
.stadium-card_capacity {
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.stadium-card_image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}



/* ──────────────── Mini Stadium Data Cards ──────────────── */
.stadium-mini-card .stadium-card_content {
  padding: 1rem 1rem; 
}

.stadium-mini-card h2 {
  margin: 0.5rem 0;
  font-size: 1.5rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; 
}

.stadium-mini-card p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; 
}

.stadium-mini-card:hover {
  transform: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  cursor: default;
}


/* ──────────────── Stadium Detail (Description and Weather) Layout ──────────────── */
.stadium-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 1.5rem;
}


.stadium-description {
  flex: 3;
  font-size: 1rem;
  line-height: 1.6;
}

.stadium-weather {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch; 
}

/* ──────────────── World Cup Matches Table ──────────────── */

.match-table-wrapper {
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.75rem;  
  overflow: hidden; 
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.match-table thead tr {
  background-color: #f5f5f5;
}

.match-table th,
.match-table td {
  text-align: left;
  padding: 10px;
}

.match-table tbody tr + tr {
  border-top: 1px solid #e0e0e0;
}

.match-table tbody td:first-child {
  font-weight: 600;
}



/* ──────────────── Weather Card ──────────────── */
.weather-card {
  border: 1px solid #e0e0e0; 
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
  background-color: #ffffff;  
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; 
  width: 400px;
}

/* Title */
.weather-card h3 {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: #000000;
}

/* Weather rows */
.weather-card p {
  margin: 0.4rem 0;
  font-size: 1rem;
  color: #000000;
}

.weather-card > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ──────────────── Loading Spinner ──────────────── */
.weather-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  color: #bb8a35;
  font-size: 0.95rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #e0e0e0;
  border-top-color: #bb8a35;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ──────────────── Weather Error ──────────────── */
.weather-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid #f5b4b4; 
  background-color: #fde8e8;
  color: #b91c1c;
  border-radius: 0.5rem;
  max-width: 350px;
  margin-top: 1rem;
}

.error-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.error-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}



/* ──────────────── Responsive Layouts ──────────────── */

/* Phones (up to 480px) */
@media (max-width: 480px) {
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-top: 1.5rem;
    max-width: 100%;
  }

  .stadium-grid {
    grid-template-columns: 1fr;
  }

  .stadium-card_image {
    height: 140px;
  }

  header h1 {
    font-size: 1.2rem;
  }
}

/* Tablets (481px – 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  main {
    max-width: 100%;
  }

  .stadium-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stadium-card_image {
    height: 150px;
  }

  header h1 {
    font-size: 1.4rem;
  }
}

/* Small laptops (769px – 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  main {
    max-width: 100%;
  }

  .stadium-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stadium-card_image {
    height: 160px;
  }

  header h1 {
    font-size: 1.5rem;
  }
}

/* Large screens (1025px and up) */
@media (min-width: 1025px) {
  main {
    margin: 2rem auto 0;
    max-width: 1200px;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .stadium-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .stadium-card_image {
    height: 180px;
  }

  header h1 {
    font-size: 1.75rem;
  }
}


/* ──────────────── Mobile Menu Overlay ──────────────── */

@media (max-width: 768px) {

  .burger {
    display: block;
    z-index: 1002;
  }

  .navigation {
    display: none !important;
    flex-direction: column;
  }

  .navigation.show {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: rgba(0, 0, 0, 0.96);
    padding: 4rem 2rem 2rem;
    gap: 1.25rem;
    z-index: 1000;
    align-items: flex-start;
  }

  .navigation a {
    font-size: 1.25rem;
    margin: 0;
    text-align: left;
  }

  .burger.open .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .burger.open .burger-line:nth-child(2) {
    opacity: 0;
  }

  .burger.open .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  
  /* ──────────────── Stadium detail and weather widget on mobile ──────────────── */
  
  .stadium-detail-row {
    flex-direction: column;
  }

  .stadium-weather {
    justify-content: flex-start;
    margin-top: 1rem;
  }
}
