/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --secondary-color: #059669;
  --accent-color: #f59e0b;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* Баннер администратора */
.admin-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1002;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.admin-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.admin-banner-icon {
  display: flex;
  align-items: center;
  opacity: 0.9;
}

.admin-banner-icon svg {
  width: 20px;
  height: 20px;
}

.admin-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.admin-banner-label {
  opacity: 0.9;
  font-weight: 500;
}

.admin-banner-email {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.admin-banner-email:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Навигация */
.navbar {
  position: fixed;
  top: 48px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1001;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-brand h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  margin: 3px 0;
  transition: var(--transition);
}

/* Главная секция */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
              url('/images/pexels-photo-1108701.jpeg') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  margin-top: 118px;
}

.hero-content {
  max-width: 800px;
  padding: 0 2rem;
  animation: fadeInUp 1s ease-out;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
  color: #fbbf24;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.cta-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cta-button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Секции */
.section {
  padding: 5rem 0;
}

.alt-bg {
  background: var(--bg-light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-dark);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: var(--primary-color);
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Факты о селе */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.fact-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.fact-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

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

.fact-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.fact-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.fact-card p {
  color: var(--text-light);
  font-size: 1rem;
}

/* О селе */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1.8;
}

.about-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
}

/* Временная линия */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--primary-color);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin: 3rem 0;
  opacity: 0;
  transform: translateX(-50px);
  transition: var(--transition);
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:nth-child(even) {
  transform: translateX(50px);
}

.timeline-item:nth-child(even).animate-in {
  transform: translateX(0);
}

.timeline-marker {
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 50%;
  transform: translateX(-50%);
  border: 4px solid var(--bg-white);
  box-shadow: var(--shadow);
}

.timeline-content {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 45%;
  margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: 55%;
}

.timeline-content h3 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.timeline-content p {
  color: var(--text-light);
  line-height: 1.7;
}

/* География */
.geography-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.geo-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.geo-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

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

.geo-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.geo-content {
  padding: 2rem;
}

.geo-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.geo-content p {
  color: var(--text-light);
  line-height: 1.7;
}

/* Население */
.population-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.population-stats {
  display: grid;
  gap: 2rem;
}

.stat-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.stat-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.stat-card h3 {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-trend {
  font-size: 3rem;
  color: #dc2626;
  margin-bottom: 0.5rem;
}

.population-text h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.population-text p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* Известные люди */
.famous-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.famous-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.famous-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

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

.famous-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.famous-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.famous-years {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.famous-card p:last-child {
  color: var(--text-light);
  line-height: 1.7;
}

/* Галерея */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  transform: scale(0.9);
}

.gallery-item.animate-in {
  opacity: 1;
  transform: scale(1);
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 2rem 1rem 1rem;
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

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

.gallery-overlay span {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  margin: auto;
  display: block;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: var(--border-radius);
}

.close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: white;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  transition: var(--transition);
}

.close:hover {
  opacity: 0.7;
}

#caption {
  text-align: center;
  color: white;
  padding: 1rem;
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--border-radius);
  font-size: 1.1rem;
}

/* Контакты */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-content p {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--text-dark);
  background: var(--bg-white);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.contact-icon {
  font-size: 1.5rem;
}

/* Футер */
.footer {
  background: var(--text-dark);
  color: white;
  text-align: center;
  padding: 2rem 0;
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .admin-banner {
    padding: 8px 0;
  }

  .admin-banner-content {
    flex-direction: column;
    gap: 6px;
    padding: 0 1rem;
  }

  .admin-banner-text {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 12px;
  }

  .navbar {
    top: 56px;
  }

  .hero {
    margin-top: 126px;
  }

  .hamburger {
    display: flex;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
  
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 126px;
    flex-direction: column;
    background: var(--bg-white);
    width: 100%;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    padding: 2rem 0;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .facts-grid {
    grid-template-columns: 1fr;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .population-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .timeline::before {
    left: 20px;
  }
  
  .timeline-marker {
    left: 20px;
  }
  
  .timeline-content {
    width: calc(100% - 60px);
    margin-left: 60px;
  }
  
  .timeline-item:nth-child(even) .timeline-content {
    margin-left: 60px;
  }
  
  .geography-grid {
    grid-template-columns: 1fr;
  }
  
  .famous-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-info {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .admin-banner {
    padding: 6px 0;
  }

  .admin-banner-text {
    font-size: 11px;
  }

  .navbar {
    top: 44px;
  }

  .hero {
    margin-top: 114px;
  }

  .nav-menu {
    top: 114px;
  }

  .hero-title {
    font-size: 2rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .fact-card,
  .geo-content,
  .timeline-content,
  .famous-card,
  .stat-card {
    padding: 1.5rem;
  }
}