/* NASA Space Explorer Theme */

/* Global reset & box sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Color scheme: Deep space theme inspired by NASA */
:root {
  --primary-blue: #1a237e;
  --accent-gold: #ffa500;
  --card-bg: #1e1f3a;
  --text-light: #f5f5f5;
  --text-muted: #b0b0b0;
  --border-color: #2a2d4a;
}

/* Base page styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0d1117 100%);
  color: var(--text-light);
  padding: 20px;
}

/* Centered container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 20px;
  margin-bottom: 30px;
  border-bottom: 3px solid var(--accent-gold);
}

h1 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  color: var(--accent-gold);
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Logo */
.logo {
  width: 140px;
  margin-right: 15px;
}

/* Date‐picker & button row */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(30, 31, 58, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Space fact section */
.space-fact {
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.3), rgba(255, 165, 0, 0.1));
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-gold);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
}

.space-fact h2 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.space-fact p {
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Inputs and buttons */
input[type="date"],
button {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 500;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.4;
  width: 100%;
}

input[type="date"] {
  background: var(--card-bg);
  color: var(--text-light);
}

input[type="date"]::placeholder {
  color: var(--text-muted);
}

/* Button specific */
button {
  background-color: var(--primary-blue);
  border-color: var(--accent-gold);
  color: var(--text-light);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background-color: #0d1861;
  border-color: #ffb700;
  box-shadow: 0 0 15px rgba(255, 165, 0, 0.3);
}

/* Stack horizontally on wider screens */
@media (min-width: 600px) {
  .filters {
    flex-direction: row;
    padding: 20px;
  }
  
  input[type="date"],
  button {
    width: auto;
    flex: 1 1 auto;
  }

  button {
    flex: 0 0 auto;
  }
}

input[type="date"]:focus,
button:focus,
.modal-close-button:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Gallery flex container */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

/* Gallery items */
.gallery-item {
  flex: 1 1 100%;  /* full width by default */
  min-width: 280px;
  max-width: 500px;
  background: linear-gradient(135deg, var(--card-bg), rgba(30, 31, 58, 0.8));
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 20px rgba(255, 165, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  box-shadow: 0 12px 30px rgba(255, 165, 0, 0.25);
}

/* Three columns on wider screens */
@media (min-width: 1000px) {
  .gallery-item {
    flex: 0 1 31%;
  }
}

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

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item h2 {
  margin-top: 12px;
  color: var(--accent-gold);
  font-size: 1rem;
  line-height: 1.3;
}

.gallery-item p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Placeholder content */
.placeholder {
  flex: 1 1 100%;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
}

/* Modal styles */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  border: 2px solid var(--accent-gold);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 60px rgba(255, 165, 0, 0.2);
}

.modal-close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  background: var(--primary-blue);
  color: var(--accent-gold);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close-button:hover {
  background: var(--accent-gold);
  color: var(--primary-blue);
  transform: scale(1.1);
}

.modal-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.modal-title {
  color: var(--accent-gold);
  font-size: 1.8rem;
  margin: 20px 0 10px 0;
  letter-spacing: 0.5px;
}

.modal-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-explanation {
  color: var(--text-light);
  line-height: 1.7;
  font-size: 0.95rem;
}
