/* Windows of Mississippi - Stained Glass Archive Styles */

:root {
  --primary-color: #1a365d;
  --primary-light: #2c5282;
  --primary-dark: #0f2440;
  --accent-color: #c53030;
  --accent-light: #e53e3e;
  --gold: #d69e2e;
  --gold-light: #ecc94b;
  --text-color: #2d3748;
  --text-light: #718096;
  --bg-color: #f7fafc;
  --bg-cream: #fffaf0;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-section h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tagline {
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.9;
  color: var(--gold-light);
}

.main-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-family: 'Arial', sans-serif;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 200px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Hero Section */
.hero {
  position: relative;
  height: 500px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--accent-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/><circle cx="50" cy="50" r="20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></svg>');
  background-size: 200px;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 2rem;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold-light);
}

.stat-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-family: 'Arial', sans-serif;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--primary-dark);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Featured Section */
.featured-section {
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

/* Window Grid */
.window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.window-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.window-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
}

.window-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.window-card-image {
  height: 200px;
  overflow: hidden;
  background: var(--primary-light);
}

.window-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.window-card:hover .window-card-image img {
  transform: scale(1.05);
}

.window-card-content {
  padding: 1rem;
}

.window-card-title {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.window-card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: 'Arial', sans-serif;
}

.window-card-meta span {
  display: block;
  margin-bottom: 0.25rem;
}

/* Search View */
.search-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.search-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.search-form {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.search-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-field {
  flex: 1;
  min-width: 200px;
}

.search-field.full-width {
  flex: 100%;
}

.search-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
}

.search-field input,
.search-field select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Arial', sans-serif;
}

.search-field input:focus,
.search-field select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.search-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.results-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-family: 'Arial', sans-serif;
  color: var(--text-light);
}

/* Map View */
.map-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.map-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.map-description {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

#mississippi-map {
  height: 600px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--bg-cream);
}

.map-info-panel {
  position: fixed;
  right: 0;
  top: 80px;
  width: 400px;
  max-width: 90vw;
  height: calc(100vh - 80px);
  background: var(--white);
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.map-info-panel.hidden {
  transform: translateX(100%);
}

.close-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.close-panel:hover {
  color: var(--accent-color);
}

/* Counties View */
.counties-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.counties-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.counties-container > p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.region-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.region-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Arial', sans-serif;
  transition: all 0.3s ease;
}

.region-btn:hover,
.region-btn.active {
  background: var(--primary-color);
  color: var(--white);
}

.counties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.county-card {
  background: var(--white);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.county-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gold);
}

.county-card h4 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.county-card .window-count {
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: 'Arial', sans-serif;
}

.county-card .region-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-color);
  border-radius: 10px;
  margin-top: 0.5rem;
  color: var(--text-light);
}

/* About View */
.about-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.about-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.about-section {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.about-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.5rem;
}

.about-section a {
  color: var(--primary-color);
}

.partner-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.partner {
  background: var(--bg-color);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--white);
  border-radius: 8px;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--white);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: var(--shadow);
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.modal-image {
  background: #000;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 80vh;
}

.modal-info {
  padding: 2rem;
}

.modal-info h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.modal-meta {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
}

.modal-meta p {
  margin-bottom: 0.5rem;
}

.modal-meta strong {
  color: var(--primary-color);
}

.modal-description h4,
.modal-history h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.modal-description,
.modal-history {
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.footer-section a {
  display: block;
  color: var(--white);
  text-decoration: none;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer-section a:hover {
  opacity: 1;
  color: var(--gold-light);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    height: auto;
    min-height: 500px;
    padding: 2rem 0;
  }

  .hero-content {
    padding: 1.5rem;
  }

  .hero-content h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .btn-primary {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-image {
    max-height: 300px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-field {
    min-width: 100%;
  }

  .map-info-panel {
    width: 100%;
  }
}

/* Leaflet customization */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  font-family: 'Georgia', serif;
}

.county-popup h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.county-popup p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.county-popup .btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-style: italic;
}

/* Submit Form Styles */
.submit-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.submit-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.submit-intro {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.submission-form {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.form-hint {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-field {
  flex: 1;
}

.form-field.full-width {
  flex: 100%;
}

.form-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
  font-family: 'Arial', sans-serif;
  font-size: 0.9rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Arial', sans-serif;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-field input[type="file"] {
  padding: 0.5rem;
  background: var(--bg-color);
}

.image-preview {
  margin-top: 1rem;
  text-align: center;
}

.image-preview img {
  max-width: 300px;
  max-height: 200px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 0.5rem;
}

.form-actions {
  padding: 1.5rem 2rem;
  background: var(--bg-color);
  text-align: center;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.submit-success {
  text-align: center;
  padding: 3rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #48bb78;
  color: white;
  font-size: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.submit-success h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.submit-success p {
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Error message */
.form-error {
  background: #fed7d7;
  color: #c53030;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-family: 'Arial', sans-serif;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  .form-section {
    padding: 1rem;
  }
}
