/* Import Google Fonts - Garamond (EB Garamond is the Google Fonts version of Garamond) */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* Font properties */
  --font-primary: 'EB Garamond', Georgia, serif;
  --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* Font sizes */
  --font-size-xxl: 28px;
  --font-size-xl: 24px;
  --font-size-lg: 20px;
  --font-size-md: 18px;
  --font-size-base: 16px;
  --font-size-sm: 15px;
  --font-size-xs: 14px;
  --font-size-xxs: 12px;
  
  /* Font weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 800;
  
  /* Colors */
  --color-white: #ffffff;
  --color-transparent-white-10: rgba(255, 255, 255, 0.1);
  --color-transparent-white-15: rgba(255, 255, 255, 0.15);
  --color-transparent-white-25: rgba(255, 255, 255, 0.25);
  --color-transparent-black-10: rgba(0, 0, 0, 0.1);
  --color-transparent-black-20: rgba(0, 0, 0, 0.2);
  --color-error: #ff6347;
  
  /* Light timing colors */
  --color-gold: #FFD700;
  --color-orange: #FFA500;
  --color-light-blue: #87CEEB;
  --color-dark-blue: #0066cc;
  --color-light-purple: #B19CD9;
  --color-dark-purple: #483D8B;
}

/* ===== BASE STYLES ===== */
body {
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: var(--color-white);
  -webkit-tap-highlight-color: transparent;
  transition: background 1.5s ease;
  font-size: var(--font-size-base);
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 15px;
  background-color: var(--color-transparent-black-20);
}

footer {
  text-align: center;
  padding: 15px;
  font-size: var(--font-size-xs);
  background-color: var(--color-transparent-black-20);
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== TYPOGRAPHY ===== */
h1 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.5px;
}

h2 {
  font-size: var(--font-size-lg);
  margin-top: 20px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-size: var(--font-size-md);
  margin-top: 20px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: var(--font-weight-medium);
}

.tagline {
  margin: 5px 0 0;
  font-size: var(--font-size-base);
  opacity: 0.9;
}

ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ===== COMPONENT STYLES ===== */
/* Card components */
.card {
  background-color: var(--color-transparent-white-10);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
  margin-bottom: 20px;
}

/* Information section */
.info-section {
  margin-top: 10px;
  max-width: 600px;
  line-height: 1.6;
}

.info-section p {
  margin-bottom: 15px;
  font-size: var(--font-size-base);
}

/* Buttons */
.button {
  background-color: var(--color-transparent-white-15);
  color: var(--color-white);
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: var(--font-size-sm);
  font-family: var(--font-primary);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 20px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button:hover, .button:active {
  background-color: var(--color-transparent-white-25);
  transform: translateY(-2px);
}

/* Status and feedback */
.loading {
  text-align: center;
  margin: 20px 0;
}

.error {
  color: var(--color-error);
  text-align: center;
  margin: 20px 0;
  padding: 10px;
  background-color: rgba(255, 99, 71, 0.1);
  border-radius: 8px;
}

.current-status {
  padding: 12px;
  margin-bottom: 15px;
  background-color: rgba(74, 222, 128, 0.2);
  border-radius: 10px;
  text-align: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  color: #ffffff;
  animation: pulse-background 2s infinite;
  border: 1px solid rgba(74, 222, 128, 0.4);
  margin-top: 0;
}

@keyframes pulse-background {
  0% { background-color: rgba(74, 222, 128, 0.2); }
  50% { background-color: rgba(74, 222, 128, 0.3); }
  100% { background-color: rgba(74, 222, 128, 0.2); }
}

/* Footer nav */
.footer-nav {
  margin: 10px 0;
}

.footer-nav a {
  color: var(--color-white);
  text-decoration: none;
  margin: 0 10px;
  font-size: var(--font-size-xs);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.copyright {
  font-size: var(--font-size-xxs);
  opacity: 0.7;
  margin-top: 10px;
}

/* ===== TIME DISPLAY COMPONENTS ===== */
/* Location display */
.location {
  font-size: var(--font-size-base);
  margin: 5px 0 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-icon {
  margin-right: 8px;
}

/* Countdown elements */
.countdown {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  text-align: center;
  margin: 10px 0 20px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-label {
  text-align: center;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

/* Time sections */
.magic-hour-times {
  margin-top: 20px;
}

.time-section {
  padding: 12px;
  margin-bottom: 12px;
  background-color: var(--color-transparent-black-10);
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.time-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.time-section:last-child {
  margin-bottom: 0;
}

.time-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.time-icon {
  width: 24px;
  text-align: center;
  margin-right: 10px;
}

.time-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

.time-details {
  margin-left: 32px;
}

.time-range {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  align-items: center;
}

.time-label {
  font-size: var(--font-size-sm);
}

.time-value {
  font-weight: var(--font-weight-medium);
}

.time-duration {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.time-small {
  font-size: var(--font-size-xs);
}

/* Tomorrow's times section */
#tomorrow-times {
  margin-top: 15px;
  padding: 12px;
  background-color: var(--color-transparent-black-20);
  border-radius: 10px;
  font-size: var(--font-size-xs);
}

.tomorrow-header {
  margin-bottom: 10px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== TIMELINE COMPONENTS ===== */
/* Timeline container and elements */
.timeline-container {
  margin: 30px 0;
  position: relative;
}

.timeline {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  position: relative;
  margin: 40px 0;
  border-radius: 2px;
  display: none; /* Timeline is hidden by design */
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

.timeline-marker {
  position: absolute;
  top: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
}

.marker-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--font-size-xs);
  text-align: center;
}

.marker-time {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* Marker styles */
.marker-morning-golden { background-color: var(--color-gold); }
.marker-morning-end { background-color: var(--color-light-blue); }
.marker-evening-golden { background-color: var(--color-orange); }
.marker-sunset { background-color: var(--color-orange); }
.marker-blue-end { background-color: var(--color-dark-purple); }

.marker-current {
  background-color: white;
  border: 2px solid rgba(255, 255, 255, 0.8);
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
  z-index: 3;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.event-cards {
  margin-top: 30px;
}

/* Base event card - using solid backgrounds instead of transparency */
.event-card {
  background-color: #2a3a4a; /* Solid dark background */
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 15px;
  position: relative;
  border-left: 4px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  color: #ffffff; /* Explicit white text color */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Card status styles - using solid colors */
.event-card.passed { 
  border-left-color: #87CEEB; /* Light blue */
  background-color: #24303d; /* Darker background for passed events */
  opacity: 0.85;
}

.event-card.current {
  border-left-color: #ffffff;
  background-color: #2d4060; /* Slightly brighter background for current */
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.event-card.upcoming {
  border-left-color: #FFA500; /* Orange */
  background-color: #2a3a4a; /* Standard background */
}

/* Card header and content */
.event-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.event-icon {
  margin-right: 10px;
  font-size: 20px; /* Explicit size */
}

.event-title {
  font-size: 18px;
  font-weight: 500;
  color: #ffffff; /* Explicit color */
}

/* Status indicator pills */
.status-indicator {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1e3c72; /* Dark blue text for contrast */
}

.status-passed { 
  background-color: #d0d0d0; /* Light gray for passed */
  color: #505050;
}

.status-current {
  background-color: #ffffff; /* White for current */
  color: #1e90ff; /* Blue text */
}

.status-upcoming { 
  background-color: #FFC125; /* Bright yellow for upcoming */
  color: #703800; /* Dark brown text for contrast */
}

/* Time display */
.event-time {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #ffffff; /* Explicit color */
}

.time-label {
  font-size: 15px;
  color: #e0e0e0; /* Light gray */
}

.time-value {
  font-weight: 500;
  color: #ffffff; /* Bright white for important info */
}

.event-duration {
  font-size: 14px;
  color: #b0b0b0; /* Medium gray for less important info */
  margin-top: 5px;
}

/* Tomorrow's times styling */
#tomorrow-times {
  margin-top: 15px;
  padding: 12px;
  background-color: #263238; /* Solid background */
  border-radius: 10px;
  font-size: 14px;
  color: #ffffff;
}

.tomorrow-header {
  margin-bottom: 10px;
  font-weight: 500;
  text-align: center;
  padding-bottom: 5px;
  border-bottom: 1px solid #3a4a5a; /* Visible border */
  color: #ffffff;
}

/* Time sections */
.time-section {
  padding: 12px;
  margin-bottom: 12px;
  background-color: #263238; /* Solid background */
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  color: #ffffff;
}

/* Day/night background transitions - using solid gradients */
.day { background: linear-gradient(135deg, #1e90ff, #4ca1ff); }
.golden { background: linear-gradient(135deg, #ff7e5f, #feb47b); }
.night { background: linear-gradient(135deg, #0f2027, #203a43); }

/* Notification section */
.notification-settings {
  margin-top: 20px;
  padding: 12px;
  background-color: #263238; /* Solid background */
  border-radius: 10px;
  color: #ffffff;
}

/* Button styling */
.button {
  background-color: rgba(255, 255, 255, 0.2); /* Slightly more opaque */
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 15px;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 20px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button:hover, .button:active {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Current status message */
.current-status {
  padding: 12px;
  margin-bottom: 15px;
  background-color: #2d6a4a; /* Solid green background */
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  color: #ffffff;
  border: 1px solid #3d8a6a; /* Visible border */
}

/* Countdown info */
.countdown {
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  margin: 10px 0 20px 0;
  color: #ffffff;
}

.event-label {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0;
  color: #ffffff;
}

/* ===== ARTICLE STYLING ===== */
article {
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
}

article:last-child {
  border-bottom: none;
}

.cta-section {
  margin-top: 30px;
  text-align: center;
}

/* ===== UTILITY STYLES ===== */
/* Day/night background transitions */
.day { background: linear-gradient(135deg, #1e90ff, #4ca1ff); }
.golden { background: linear-gradient(135deg, #ff7e5f, #feb47b); }
.night { background: linear-gradient(135deg, #0f2027, #203a43); }

/* Permission dialog styles */
.permission-dialog {
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
}

.permission-dialog h2 {
  margin-top: 0;
  font-size: var(--font-size-lg);
}

.permission-dialog p {
  margin-bottom: 15px;
}

/* ===== RESPONSIVE STYLES ===== */
/* Small mobile devices */
@media (max-width: 360px) {
  .time-range {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .time-value {
    margin-top: 2px;
    align-self: flex-end;
  }
  
  .time-title {
    font-size: var(--font-size-base);
  }
  
  h1 {
    font-size: var(--font-size-lg);
  }
  
  .tagline {
    font-size: var(--font-size-xs);
  }
}

/* Tablets and larger devices */
@media (min-width: 768px) {
  :root {
    --font-size-xxl: 32px;
    --font-size-xl: 28px;
    --font-size-lg: 24px;
    --font-size-md: 20px;
    --font-size-base: 18px;
  }
  
  .container {
    padding: 30px;
  }
  
  .info-section {
    padding: 30px;
  }
  
  h1 {
    font-size: var(--font-size-xxl);
  }
  
  .tagline {
    font-size: var(--font-size-md);
  }
  
  /* Two-column layout for larger screens */
  .info-section {
    columns: 2;
    column-gap: 30px;
  }
  
  article {
    break-inside: avoid;
  }
  
  .cta-section {
    column-span: all;
  }
}

/* Print styles for saving times */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .card, .info-section {
    box-shadow: none;
    background: white;
  }
  
  .button, .footer-nav {
    display: none;
  }
}