/* ==========================================================================
   Страница Конкурса
   ========================================================================== */

/* --- Сброс стилей --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Плавный скрол --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  color: #333;
  overflow-x: hidden;
}

/* --- CSS переменные --- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Montserrat', Georgia, serif;
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-accent: #1e88e5;
  --color-light: #f1f3f5; /* Сделал цвет ховера чуть заметнее */
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --card-bg: #ffffff;
  --competition-solfeggio: #6a11cb;
  --competition-piano: #11998e;
  --competition-instruments: #ff416c;
  --radius: 12px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --gradient-primary: linear-gradient(135deg, var(--competition-solfeggio), #2575fc);
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Темная тема */
.dark-mode {
  --color-bg: #121212;
  --color-text: #e0e0e0;
  --color-accent: #64b5f6;
  --color-light: #1e1e1e;
  --card-bg: #1e1e1e;
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.4);
}


/* ==========================================================================
   Сетка конкурса
   ========================================================================== */
.competition-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  width: 100%;
  background-color: var(--color-bg);
  padding: var(--spacing-sm);
}

.grid-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  width: 100%;
}

.row-title { margin-top: var(--spacing-lg); }
.row-description { margin-top: var(--spacing-sm); }
.row-slideshow { margin-top: var(--spacing-md); }
.row-info-docs { margin-top: var(--spacing-lg); }
.row-press { margin-top: var(--spacing-lg); }
.row-contacts { margin-top: var(--spacing-lg); }

/* ИЗМЕНЕНИЕ: Убираем фон и тень у всех ячеек по умолчанию */
.grid-cell {
  background-color: transparent; /* Фон прозрачный */
  border-radius: var(--radius);
  padding: var(--spacing-md);
  box-shadow: none; /* Тени нет */
  transition: none;
}


/* ==========================================================================
   Заголовок конкурса
   ========================================================================== */
/* ИЗМЕНЕНИЕ: Возвращаем фон и тень ТОЛЬКО заголовку */
.title-cell {
  grid-column: 1 / -1;
  padding: var(--spacing-xl) var(--spacing-lg);
  text-align: center;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  box-shadow: 0 10px 20px -10px rgba(30, 136, 229, 0.5);
}

.competition-main-title {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  margin: 0;
  text-transform: uppercase;
  color: white;
}


/* ==========================================================================
   Описание конкурса
   ========================================================================== */
.description-cell {
  grid-column: 1 / -1;
  padding: var(--spacing-lg);
  text-align: center;
}

.competition-description-text {
  font-size: 1.2rem;
  color: var(--color-text);
  opacity: 0.85;
  line-height: 1.7;
  max-width: 800px;
  margin: 0 auto;
}

/* ==========================================================================
   Слайд-шоу
   ========================================================================== */
/* ИЗМЕНЕНИЕ: Возвращаем фон и тень ТОЛЬКО слайд-шоу */
.slideshow-cell {
  grid-column: 1 / -1;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--card-bg); /* Фон нужен как подложка для фото */
  box-shadow: var(--shadow-subtle);
}

.slideshow-cell:hover .slide.active img {
  transform: scale(1.05);
}

.competition-slideshow {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  border-radius: var(--radius);
}

.slide {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.slide.active { opacity: 1; }

.slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.slide-indicators {
  position: absolute; bottom: var(--spacing-sm); left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-xs);
  z-index: 10;
}

.indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
}

.indicator:hover { background-color: white; }
.indicator.active { background-color: white; transform: scale(1.2); }

.carousel-control {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  font-size: 20px;
  transition: background-color 0.2s ease;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}
.carousel-control:hover { background-color: rgba(0, 0, 0, 0.5); }
.carousel-control.prev { left: var(--spacing-sm); }
.carousel-control.next { right: var(--spacing-sm); }


/* ==========================================================================
   Карточки информации
   ========================================================================== */
.info-card h2 {
  font-size: 1.6rem;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-light);
  text-align: center;
}

.info-card ul {
  list-style-type: none;
  padding-left: 0;
}

.info-card ul li {
  padding: var(--spacing-xs) 0;
  border-bottom: 1px dashed var(--color-light);
  color: var(--color-text);
  transition: background-color 0.2s ease;
  border-radius: var(--radius);
  padding-left: var(--spacing-xs);
  padding-right: var(--spacing-xs);
}

.info-card ul li:hover {
  background-color: var(--color-light);
}

.info-card a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.info-card a::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

.info-card a:hover::after { width: 100%; }
.info-card a:hover { text-decoration: none; }

.info-card p {
  line-height: 1.7;
  color: var(--color-text);
  opacity: 0.9;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
}

.status-active { background: var(--color-success); }
.status-upcoming { background: var(--color-accent); }
.status-finished { background: var(--color-danger); }


/* ==========================================================================
   Адаптивность
   ========================================================================== */
@media (min-width: 769px) {
  .competition-grid { grid-template-columns: 1fr; }
  .grid-row { grid-template-columns: 1fr; }
  .row-info-docs { grid-template-columns: 1fr 1fr; }
  .half-width { grid-column: span 1; }
  .full-width { grid-column: 1 / -1; }
  .competition-main-title { font-size: 3.5rem; }
}

@media (max-width: 768px) {
  .competition-main-title { font-size: 2.5rem; }
  .competition-slideshow { height: 350px; }
  .info-card h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .competition-main-title { font-size: 2rem; }
  .competition-slideshow { height: 250px; }
  .info-card { padding: var(--spacing-md); }
  .info-card ul li { font-size: 0.95rem; }
}

/* ==========================================================================
   Анимации
   ========================================================================== */
.grid-cell {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.grid-cell:nth-child(1) { animation-delay: 0.1s; }
.grid-cell:nth-child(2) { animation-delay: 0.2s; }
.grid-cell:nth-child(3) { animation-delay: 0.2s; }
.grid-cell:nth-child(4) { animation-delay: 0.3s; }
.grid-cell:nth-child(5) { animation-delay: 0.4s; }
.grid-cell:nth-child(6) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Темная тема
   ========================================================================== */
/* ИЗМЕНЕНИЕ: Убираем фон и тень у блоков в темной теме */
.dark-mode .grid-cell {
    background-color: transparent;
    box-shadow: none;
}
/* ИЗМЕНЕНИЕ: Возвращаем фон и тень для карусели в темной теме */
.dark-mode .slideshow-cell {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-subtle);
}
.dark-mode .info-card ul li:hover { background-color: #2c2c2c; }
.dark-mode .info-card a { color: var(--color-accent); }
.dark-mode .info-card a:hover { color: #90caf9; }
.dark-mode .info-card h2 {
  color: var(--color-accent);
  border-bottom-color: #333;
}
.dark-mode .info-card ul li {
  border-bottom-color: #333;
  color: var(--color-text);
}


/* ==========================================================================
   Интерактивные элементы
   ========================================================================== */
.go-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 50px; height: 50px;
  background-color: var(--color-accent);
  color: white;
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
  z-index: 1000;
}
.go-top.show { opacity: 1; visibility: visible; }
.go-top:hover {
  background-color: #0d6efd;
  transform: scale(1.1);
}

.toggle-theme {
  position: fixed; top: 2rem; right: 2rem;
  width: 50px; height: 50px;
  background-color: var(--color-light);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
}
.toggle-theme:hover {
  background-color: var(--color-accent);
  color: white;
  transform: rotate(30deg);
}

/* --- Мобильные стили --- */
@media (max-width: 768px) {
  .competition-grid { padding: var(--spacing-xs); gap: var(--spacing-sm); }
  .grid-row { gap: var(--spacing-sm); }
  .grid-cell { padding: var(--spacing-sm); }
  .title-cell { padding: var(--spacing-lg) var(--spacing-md); }
  .competition-main-title { font-size: 2.5rem; line-height: 1.2; }
  .description-cell { padding: var(--spacing-md); }
  .competition-description-text { font-size: 1rem; line-height: 1.6; max-width: 100%; }
  .slideshow-cell { border-radius: var(--radius); }
  .slide-indicators { bottom: var(--spacing-xs); }
  .indicator { width: 8px; height: 8px; }
  .info-card { padding: var(--spacing-sm); }
  .info-card h2 { font-size: 1.4rem; margin-bottom: var(--spacing-xs); }
  .info-card ul { padding-left: var(--spacing-xs); }
  .info-card ul li { padding: var(--spacing-xs) 0; font-size: 0.95rem; }
  .status-badge { font-size: 0.8rem; }
  .go-top { bottom: 1.5rem; right: 1.5rem; width: 40px; height: 40px; font-size: 1.2rem; }
  .toggle-theme { top: 1.5rem; right: 1.5rem; width: 40px; height: 40px; font-size: 1rem; }
  body { font-size: 16px; }
  .info-card ul li { min-height: 44px; display: flex; align-items: center; }
  .row-title, .row-description, .row-slideshow, .row-info-docs, .row-press, .row-contacts { margin-top: var(--spacing-md); }
}

@media (max-width: 480px) {
  .competition-grid { padding: var(--spacing-xs); gap: var(--spacing-xs); }
  .grid-row { gap: var(--spacing-xs); }
  .grid-cell { padding: var(--spacing-xs); }
  .title-cell { padding: var(--spacing-md) var(--spacing-sm); }
  .competition-main-title { font-size: 2rem; line-height: 1.3; }
  .description-cell { padding: var(--spacing-sm); }
  .competition-description-text { font-size: 0.95rem; line-height: 1.5; }
  .info-card { padding: var(--spacing-xs); }
  .info-card h2 { font-size: 1.3rem; margin-bottom: var(--spacing-xs); }
  .info-card ul li { padding: var(--spacing-xs) 0; font-size: 0.9rem; }
  .info-card a { font-size: 0.9rem; }
  .status-badge { font-size: 0.75rem; padding: 0.2rem 0.6rem; }
  .go-top { bottom: 1rem; right: 1rem; width: 36px; height: 36px; font-size: 1.1rem; }
  .toggle-theme { top: 1rem; right: 1rem; width: 36px; height: 36px; font-size: 0.9rem; }
}

@media (max-width: 768px) and (orientation: portrait) {
  .competition-main-title { font-size: 2.5rem; }
  .info-card h2 { font-size: 1.4rem; }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .competition-main-title { font-size: 2.8rem; }
  .competition-slideshow { height: 300px; }
  .info-card h2 { font-size: 1.3rem; }
}
