/* Accessibility and UX Improvements */

/* ===== FOCUS MANAGEMENT ===== */
*:focus {
  outline: 3px solid #4cae4f !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #4cae4f;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* ===== NAVIGATION IMPROVEMENTS ===== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #222;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 1rem 2rem;
  margin: 0;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(255,255,255,0.1);
  color: #4cae4f;
}

.nav-link[aria-current="page"] {
  background: #4cae4f;
  color: white;
  font-weight: bold;
}

/* Mobile navigation */
@media (max-width: 768px) {
  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .nav-link {
    width: 100%;
    text-align: center;
  }
}

/* ===== CONTENT IMPROVEMENTS ===== */
.md-content__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Improved typography */
.md-content__inner h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: #4cae4f;
  border-bottom: 3px solid #4cae4f;
  padding-bottom: 0.5rem;
}

.md-content__inner h2 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #333;
}

.md-content__inner p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ===== GALLERY IMPROVEMENTS ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
}

.gallery-item:hover,
.gallery-item:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

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

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

/* ===== FULLSCREEN VIEWER ===== */
.fullscreen-view {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.fullscreen-view.active {
  display: flex;
}

.fullscreen-view img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
  background: rgba(255,255,255,0.2);
}

/* Navigation arrows for fullscreen */
.fullscreen-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.fullscreen-nav:hover,
.fullscreen-nav:focus {
  background: rgba(255,255,255,0.2);
}

.fullscreen-nav.prev {
  left: 20px;
}

.fullscreen-nav.next {
  right: 20px;
}

.photo-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

/* ===== FORM IMPROVEMENTS ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: #4cae4f;
  box-shadow: 0 0 0 3px rgba(76, 174, 79, 0.1);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #4cae4f;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn:hover,
.btn:focus {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover,
.btn-danger:focus {
  background: #c82333;
}

/* ===== LOADING STATES ===== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  color: #666;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top: 2px solid #4cae4f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== ERROR STATES ===== */
.error {
  color: #d32f2f;
  padding: 1rem;
  background-color: rgba(211, 47, 47, 0.1);
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 4px solid #d32f2f;
}

.success {
  color: #2e7d32;
  padding: 1rem;
  background-color: rgba(46, 125, 50, 0.1);
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 4px solid #2e7d32;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-link {
    border: 2px solid transparent;
  }
  
  .nav-link:hover,
  .nav-link:focus {
    border-color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  
  .md-content__inner {
    padding: 1rem;
  }
  
  .md-content__inner h1 {
    font-size: 2rem;
  }
  
  .fullscreen-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .close-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

/* ===== KEYBOARD NAVIGATION ===== */
.gallery-item:focus-within {
  outline: 3px solid #4cae4f;
  outline-offset: 2px;
}

/* ===== TOOLTIPS ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext,
.tooltip:focus .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ===== PROGRESS INDICATORS ===== */
.progress-bar {
  width: 100%;
  height: 4px;
  background-color: #ddd;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #4cae4f;
  transition: width 0.3s ease;
}

/* ===== MODAL IMPROVEMENTS ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ===== PRINT STYLES ===== */
@media print {
  .main-nav,
  .fullscreen-view,
  .close-btn,
  .fullscreen-nav {
    display: none !important;
  }
  
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery-item img {
    height: 200px;
  }
} 