/* Global Styles for Flight Club Website */

/* Define custom properties for easy theming */
:root {
  --primary-color: #0a2342;
  --secondary-color: #016fb9;
  --accent-color: #00a9e0;
  --light-color: #f4f8fb;
  --dark-color: #021d3a;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  /* Set a blue gradient as the backdrop for all pages */
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--dark-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Home page (index) specific background */
body.index-page {
  /* Use the uploaded image as the full-page background on the index page */
  background: url('assets/index-bg.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* Background images for individual pages with full-page photos */
body.events-page {
  /* British Airways Concorde being ferried past the Statue of Liberty */
  background: url('assets/events-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  /* Use default dark text on this page so content remains readable against the lighter photo */
  color: var(--dark-color);
}

body.gallery-page {
  /* Two trainer aircraft silhouetted against a golden sunset over mountain peaks */
  background: url('assets/gallery-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  /* Use dark text rather than white on the gallery page for better contrast */
  color: var(--dark-color);
}

body.leaderboard-page {
  /* Fighter jet flying above a sea of clouds with contrails streaking across the sky */
  background: url('assets/leaderboard-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  /* Use dark text rather than white on the leaderboard page */
  color: var(--dark-color);
}

body.simulator-page {
  /* Delta Air Lines widebody aircraft cruising over snow‑covered mountains */
  background: url('assets/simulator-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  /* Use dark text for simulator page */
  color: var(--dark-color);
}

/* Override the hero background on the index page so it only applies a dark overlay,
   letting the page background image show through */
body.index-page .hero {
  /* Use a lighter overlay to keep text legible without overly darkening the image */
  /* Remove the overlay on the hero section to match the brightness of the rest of the page */
  background: transparent;
}

/* Remove the full-page hero background. The body will inherit the light background defined above. */

/* Navigation bar styling */
nav {
  width: 100%;
  /* Use a semi-transparent background with blur for a liquid glass effect */
  background-color: rgba(10, 35, 66, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Allow horizontal overflow so nav links are fully visible on smaller screens */
  overflow-x: visible;
}

nav a.logo {
  color: var(--light-color);
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
}

/* Space out the airplane icon within the logo */
nav a.logo i {
  margin-right: 0.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  /* smaller gap to accommodate longer labels like "Simulator" */
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  /* Add some right padding to keep the last menu item from hiding behind the scrollbar */
  /* Provide more space on the right so the last item doesn't overlap the scrollbar */
  padding-right: 2.5rem;
  margin-right: 0;
}

nav ul li a {
  color: var(--light-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  /* slightly smaller font size to prevent truncation of long labels */
  font-size: 0.95rem;
}

nav ul li a:hover {
  color: var(--accent-color);
}

/* Responsive navigation: stack links on small screens */
@media (max-width: 700px) {
  nav {
    justify-content: space-between;
  }
  nav ul {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  nav ul li {
    margin-top: 0.5rem;
  }
}

/* Hero section */
.hero {
  height: 60vh;
  /* Use a photographic backdrop for the hero on the home page. The dark gradient overlay ensures text remains legible. */
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('assets/hero-bg.jpg');
  background-position: center;
  background-size: cover;
  color: var(--light-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  /* Improve readability on complex backgrounds */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.hero .cta-button {
  background-color: var(--accent-color);
  color: var(--light-color);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.hero .cta-button:hover {
  background-color: var(--secondary-color);
}

/* Section layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.section-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

/* Feature cards on home page */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.feature-card {
  /* Reset to base card styles; glass effect is applied via the .glass class */
  border-radius: 8px;
  width: 250px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* When feature cards are links, ensure they behave like block elements */
  display: block;
  color: var(--dark-color);
  text-decoration: none;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

/* Events list & calendar */
.events-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}

.events-list li {
  background-color: #ffffff;
  border: 1px solid #e0e6ed;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.events-list li span {
  font-weight: bold;
}

/* Calendar styles */
.calendar-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-grid div {
  background-color: #ffffff;
  border: 1px solid #e0e6ed;
  padding: 0.5rem;
  text-align: center;
  min-height: 60px;
  position: relative;
}

.calendar-grid .header {
  background-color: var(--primary-color);
  color: var(--light-color);
  font-weight: bold;
}

.calendar-grid .event-day {
  background-color: var(--secondary-color);
  color: var(--light-color);
  font-weight: bold;
}

.calendar-grid .today {
  border: 2px solid var(--accent-color);
}

.calendar-grid .day-number {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.75rem;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.02);
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/*
 * Glassmorphism effect inspired by Apple’s liquid glass.
 * Apply class="glass" to any element to give it a translucent panel with
 * subtle blur and inner glow. The ::after pseudo-element adds additional
 * highlights and depth.
 */
.glass {
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 2rem;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), inset 0 4px 20px rgba(255, 255, 255, 0.3);
}

.glass::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: inherit;
  backdrop-filter: blur(1px);
  box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
    inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
  opacity: 0.6;
  z-index: -1;
  filter: blur(1px) drop-shadow(10px 4px 6px black) brightness(115%);
  pointer-events: none;
}

/*
 * Liquid glass effect helper.

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 6px;
}

.lightbox:target {
  display: flex;
}

/* Leaderboard table */
.leaderboard {
  max-width: 800px;
  margin: 0 auto;
}

.leaderboard-section {
  margin-bottom: 2rem;
}

.leaderboard-section h3 {
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--secondary-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  border: 1px solid #e0e6ed;
  padding: 0.5rem;
  text-align: left;
}

th {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.edit-input {
  width: 90%;
  padding: 0.25rem;
}

.admin-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.admin-controls input[type="password"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.admin-controls button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--secondary-color);
  color: var(--light-color);
  transition: background-color 0.3s ease;
}

.admin-controls button:hover {
  background-color: var(--accent-color);
}

/* Reservation list */
.reservation-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.reservation-form input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.reservation-form button {
  padding: 0.5rem 1rem;
  background-color: var(--secondary-color);
  color: var(--light-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.reservation-form button:hover {
  background-color: var(--accent-color);
}

.reservation-list {
  max-width: 500px;
  margin: 0 auto;
  border: 1px solid #e0e6ed;
  border-radius: 4px;
  background-color: #ffffff;
  padding: 1rem;
}

.reservation-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reservation-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f2f5;
  /* Ensure list text remains dark on all backgrounds */
  color: var(--dark-color);
}

/* Leaderboard categories reuse reservation styles with slight tweaks */
.leaderboard-category {
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.leaderboard-category h3 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

/* Align inputs nicely within leaderboard sections */
.leaderboard-category .reservation-form {
  justify-content: center;
}

.reservation-list li:last-child {
  border-bottom: none;
}

.reservation-list button.delete {
  background-color: transparent;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
}

.reservation-list button.delete:hover {
  color: var(--accent-color);
}

.admin-section {
  text-align: center;
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .feature-card {
    width: calc(50% - 1rem);
  }
}

@media (max-width: 480px) {
  .feature-card {
    width: 100%;
  }
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}