/* ==========================================================================
   Переменные
   ========================================================================== */

:root {
  /* Цвета */
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-accent: #1e88e5;
  --color-light: #eaeff4;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --card-bg: #ffffff;
  
  /* Шрифты */
  --font-main: 'Inter', sans-serif;
  
  /* Размеры и отступы */
  --radius: 10px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Тени */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Темная тема
   ========================================================================== */

.dark-mode {
  --color-bg: #121212;
  --color-text: #f5f5f5;
  --color-accent: #64b5f6;
  --color-light: #1e1e1e;
  --card-bg: #1e1e1e;
  --shadow-sm: 0 2px 8px rgba(255, 255, 255, 0.05);
  --shadow-md: 0 4px 12px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 6px 20px rgba(255, 255, 255, 0.08);
  --shadow-xl: 0 8px 30px rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Базовые стили
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* ==========================================================================
   Основная структура
   ========================================================================== */

.main-content {
  padding: var(--spacing-md) 0;
}

.page-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.content-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* ==========================================================================
   Заголовки
   ========================================================================== */

.section-title {
  text-align: center;
  font-weight: 600;
  font-size: 2.5rem;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  color: var(--color-accent);
}

/* ==========================================================================
   Общие стили для информационных блоков
   ========================================================================== */

.info-block,
.info-cell {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-block:hover,
.info-cell:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Блок с изображением (Герой)
   ========================================================================== */

.info-block--hero {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dark-mode .info-block--hero {
  background: #1e1e1e;
}

.info-block--hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(0, 102, 204, 0.04) 0%, transparent 70%);
  z-index: 0;
  animation: pulse 6s ease-in-out infinite;
}

.dark-mode .info-block--hero::before {
  background: radial-gradient(circle at center, rgba(100, 150, 255, 0.06), transparent 70%);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.block-image {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: var(--spacing-sm);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}


.info-block--hero:hover .block-image {
  transform: scale(1.03);
}

.center-text {
  font-size: 1.1rem;
  color: #3a3a3a;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.dark-mode .center-text {
  color: #ccc;
}

/* ==========================================================================
   Блоки с информацией
   ========================================================================== */

/* Полное наименование */
.info-cell--full-name::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, #005a99, #007acc);
  border-radius: 4px 0 0 4px;
}

.dark-mode .info-cell--full-name::before {
  background: linear-gradient(to bottom, #42a5f5, #1976d2);
}

/* Сокращённое название */
.info-cell--short-name::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 1rem;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

/* Дата создания */
.info-cell--founded-year {
  text-align: center;
  background-color: #f1f8ff;
  border-left: none;
}

.dark-mode .info-cell--founded-year {
  background-color: #1e2732;
}

.year-text {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: var(--spacing-xs);
}

.dark-mode .year-text {
  color: var(--color-accent);
}

/* Учредитель и Руководитель */
.info-grid--institution {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.info-cell--institution {
  border-left: 4px solid var(--color-accent);
}

/* Контакты учредителя */
.info-cell--institution-contact {
  border-left: 4px solid var(--color-accent);
}

.info-cell--institution-contact ul {
  list-style: none;
}

.info-cell--institution-contact li {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
}

.info-cell--institution-contact li:last-child {
  margin-bottom: 0;
}

.info-cell--institution-contact strong {
  min-width: 140px;
  color: var(--color-accent);
  font-weight: 500;
  flex-shrink: 0;
}

.info-cell--institution-contact .contact-value {
  flex-grow: 1;
}

.info-cell--institution-contact li:hover {
  background-color: #f5f5f5;
}

.dark-mode .info-cell--institution-contact li:hover {
  background-color: #2c2c2c;
}

.info-cell--institution-contact a {
  color: var(--color-accent);
  text-decoration: none;
}

.info-cell--institution-contact a:hover {
  text-decoration: underline;
}

.info-cell--institution-contact i {
  min-width: 20px;
  text-align: center;
  margin-top: 3px;
  flex-shrink: 0;
}

.info-cell--institution-contact .icon-location { color: var(--color-danger); }
.info-cell--institution-contact .icon-mail { color: var(--color-accent); }
.info-cell--institution-contact .icon-phone { color: var(--color-success); }
.info-cell--institution-contact .icon-web { color: var(--color-accent); }

/* Место нахождения */
.info-cell--location {
  border-left: 4px solid #005a99;
}

.info-cell--location h3 {
  color: #005a99;
}

.dark-mode .info-cell--location h3 {
  color: #42a5f5;
}

.contacts-map iframe {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-top: var(--spacing-sm);
}

.dark-mode .contacts-map iframe {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  filter: invert(95%) hue-rotate(180deg);
}

/* Филиалы */
.info-cell--branches {
  border-left: 4px solid var(--color-accent);
}

/* График занятий и Режим работы администрации */
.info-cell--schedule,
.info-cell--administration {
  border-left: 4px solid var(--color-accent);
}

.schedule-list {
  list-style: none;
}

.schedule-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid #eee;
}

.schedule-list li:last-child {
  border-bottom: none;
}

.schedule-list strong {
  min-width: 180px;
  color: var(--color-accent);
  font-weight: 500;
}

.time,
.day-off {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 6px;
  font-size: 0.98rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-align: center;
  min-width: 140px;
}

.time:hover {
  background-color: #f8f9fa;
  transform: translateX(2px);
}

.dark-mode .time:hover {
  background-color: #333;
}

.time--start { background-color: #e6f0ff; color: var(--color-accent); }
.time--lunch { background-color: #fff3cd; color: #85754c; }
.time--end { background-color: #d4edda; color: #155724; }
.time--shorter { background-color: #e2f0e8; color: #155724; }
.time--work { background-color: #e6f0ff; color: var(--color-accent); }

.day-off {
  background-color: #ffe6e6;
  color: #b22222;
  font-style: italic;
  font-weight: 500;
  border-radius: 5px;
}

.dark-mode .day-off {
  background-color: #3d2a2a;
  color: #f44336;
}

.dark-mode .time--work {
  background-color: #1e2732;
  color: var(--color-accent);
}

.dark-mode .time--lunch {
  background-color: #2b2b2b;
  color: #ffb74d;
}

/* Контактные телефоны */
.info-cell--phones {
  border-left: 4px solid var(--color-accent);
}

.phone-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-sm);
}

.phone-card {
  background-color: #f9f9f9;
  border-radius: var(--radius);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  text-align: center;
}

.phone-card:hover {
  background-color: #f1f8ff;
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dark-mode .phone-card {
  background-color: #2a2a2a;
}

.dark-mode .phone-card:hover {
  background-color: #333;
}

.phone-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  margin-bottom: var(--spacing-xs);
  display: block;
}

.dark-mode .phone-label {
  color: var(--color-accent);
}

.phone-number {
  font-size: 1.1rem;
  color: #3d3d3d;
  text-decoration: none;
  display: block;
  font-weight: 600;
  transition: color 0.3s ease;
}

.phone-number:hover {
  color: var(--color-accent);
}

.dark-mode .phone-number {
  color: var(--color-accent);
}

.dark-mode .phone-number:hover {
  color: #90caf9;
}

/* Адреса электронной почты */
.info-cell--emails {
  border-left: 4px solid var(--color-accent);
}

.email-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-sm);
}

.email-card {
  background-color: #f9f9f9;
  border-radius: var(--radius);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  text-align: center;
}

.email-card:hover {
  background-color: #f1f8ff;
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dark-mode .email-card {
  background-color: #2a2a2a;
}

.dark-mode .email-card:hover {
  background-color: #333;
}

.email-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  margin-bottom: var(--spacing-xs);
  display: block;
}

.dark-mode .email-label {
  color: var(--color-accent);
}

.email-address {
  font-size: 1rem;
  color: #3d3d3d;
  text-decoration: none;
  display: block;
  font-weight: 600;
  transition: color 0.3s ease;
  word-break: break-word;
}

.email-address:hover {
  color: var(--color-accent);
}

.dark-mode .email-address {
  color: var(--color-accent);
}

.dark-mode .email-address:hover {
  color: #90caf9;
}

/* ==========================================================================
   Анимации
   ========================================================================== */

[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.6s ease-out;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Адаптивность (Мобильные устройства)
   ========================================================================== */

@media (max-width: 1200px) {
  .page-section {
    max-width: 95%;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--spacing-sm) 0;
  }

  .page-section {
    padding: 0 var(--spacing-sm);
  }

  .content-container {
    gap: var(--spacing-sm);
  }

  .section-title {
    font-size: 2rem;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
  }

  .info-block,
  .info-cell {
    padding: var(--spacing-sm);
  }

  .block-image {
    max-width: 200px;
  }

  .center-text {
    font-size: 1rem;
  }

  .year-text {
    font-size: 2rem;
  }

  .info-grid--institution,
  .phone-cards,
  .email-cards {
    grid-template-columns: 1fr;
  }

  .info-cell--institution-contact li,
  .schedule-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .info-cell--institution-contact strong,
  .schedule-list strong {
    min-width: auto;
  }

  .time,
  .day-off {
    min-width: auto;
    width: 100%;
  }

  .contacts-map iframe {
    height: 300px;
  }

  .phone-card,
  .email-card {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .phone-number,
  .email-address {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.75rem;
    margin-top: var(--spacing-md);
  }

  .info-block--hero {
    padding: var(--spacing-sm);
  }

  .block-image {
    max-width: 150px;
  }

  .center-text {
    font-size: 0.95rem;
  }

  .year-text {
    font-size: 1.75rem;
  }

  .info-cell--institution-contact strong {
    font-size: 0.95rem;
  }

  .info-cell--institution-contact .contact-value {
    font-size: 0.95rem;
  }

  .schedule-list strong {
    font-size: 0.95rem;
  }

  .time,
  .day-off {
    font-size: 0.9rem;
  }

  .phone-label,
  .email-label {
    font-size: 0.85rem;
  }

  .phone-number,
  .email-address {
    font-size: 0.95rem;
  }
}