/* ========== CSS Variables ========== */
:root {
  /* Основные градиенты */
  --main-gradient: linear-gradient(135deg, #6cd0d4 0%, #3a8edb 100%);
  --accent-gradient: linear-gradient(135deg, #47e0b4 0%, #50bcd9 100%);
  
  /* Цвета */
  --bg-light: #f6fafb;
  --text-color: #153F53;
  --text-secondary: #217895;
  --text-muted: var(--text-secondary); 
  --text-description: #16707c;
  --link-color: var(--text-description);
  --card-bg: #fff;
  --card-border: #d5f9f6;
  --subtitle-color: var(--text-secondary);
  
  /* Состояния */
  --status-online: #4CAF50;
  --status-offline: #F44336;
  --status-online-text: #2E7D32;
  --status-offline-text: #C62828;
  
  /* Меню */
  --menu-button-bg: rgba(255,255,255,0.10);
  --menu-button-active-bg: rgba(255,255,255,0.22);
  --menu-button-shadow: 0 2px 7px 0 rgba(60,180,190,0.08);
  --menu-button-radius: 1.8em;
  --menu-button-padding-h: 1.5em;
  --menu-button-padding-v: 0.7em;
  
  /* Размеры */
  --header-max-width: 940px;
  --border-radius: 1.5rem;
  --content-max-width: 800px;
}

/* ========== Reset ========== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-color);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  flex: 1;
}

/* ========== Header & Menu ========== */
.header-bar {
  width: 100%;
  display: flex;
  justify-content: center;
}

.header {
  background: var(--main-gradient);
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  box-shadow: 0 2px 10px 0 #e7f7ff7e;
  min-height: 60px;
  width: 100%;
  max-width: var(--header-max-width);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
}

.menu {
  display: flex;
  gap: 1.3rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.menu a {
  padding: var(--menu-button-padding-v) var(--menu-button-padding-h);
  background: var(--menu-button-bg);
  border-radius: var(--menu-button-radius);
  font-weight: 600;
  font-size: 1.1em;
  color: #fff;
  text-decoration: none;
  border: none;
  outline: none;
  box-shadow: var(--menu-button-shadow);
  letter-spacing: 0.05em;
  transition: background 0.22s, color 0.14s, box-shadow 0.19s, transform 0.11s;
  cursor: pointer;
  position: relative;
  top: 0;
}

.menu a.active,
.menu a:focus,
.menu a:hover {
  background: var(--menu-button-active-bg);
  color: #1f7d96;
  text-decoration: none;
  box-shadow: 0 4px 16px 0 rgba(50,180,160,0.14);
  transform: translateY(-1.5px) scale(1.045);
}

.menu a.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 32px 0 rgba(55,210,210,.13);
  border-bottom: 2.5px solid #31e8be;
}

.menu a:focus {
  outline: 2px solid #c3eef9;
}

/* ========== Logo ========== */
.logo-big {
  display: block;
  margin: 0.5em auto 1.2em;
  width: 88px;
  height: auto;
}

/* ========== Main Content ========== */
main {
  padding: 1.5rem 1rem 1rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem 0;
}

.hero h1 {
  letter-spacing: 1px;
  font-size: 2.2rem;
  margin: 0.5em 0 0.3em 0;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--subtitle-color);
  margin-bottom: 2em;
}

h2 {
  margin: 0.8em 0;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ========== Social Links ========== */
.social-links {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.social {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 115px;
  min-width: 90px;
  box-sizing: border-box;
}

.social-label {
  margin-top: 0.45em;
  font-size: 0.93em;
  color: var(--text-muted);
  text-align: center;
  font-weight: 450;
}

.icon {
  width: 42px;
  height: 42px;
  fill: url(#icon-gradient);
  stroke: #15506B;
  stroke-width: 0.5px;
  transition: transform 0.2s;
}

.social-links a:hover .icon {
  transform: scale(1.18) rotate(-7deg);
  filter: drop-shadow(0 2px 12px #78eeef8a);
}

/* ========== Services Section ========== */
.subscribers-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--card-bg);
  border-radius: 0.8em;
  box-shadow: 0 2px 8px 0 rgba(60,180,190,0.08);
  border: 1px solid #d6f1f3;
  padding: 0.28em 0.9em;
  font-size: 1.07em;
  font-weight: 600;
  color: #1e9c96;
}
.subscribers-inline-count {
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1e9c96;
}
.subscribers-icon svg {
  display: block;
}
/* ========== Loader ========== */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-light);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s;
}
.spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 5px solid #d1f6f6;
  border-top: 5px solid #35b8d5;
  border-right: 5px solid #2ee0b4;
  background: transparent;
  animation: spin 1.2s linear infinite;
  margin-bottom: 1.3rem;
}
#loader span {
  color: #36b5bb;
  font-size: 1.15rem;
  letter-spacing: 1px;
  opacity: 0.85;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ========== Cookies Popup ========== */
.no-cookies-popup {
  position: fixed;
  left: 20px;
  bottom: 20px;
  background: rgba(255,255,255,0.98);
  border-radius: 1.2em;
  box-shadow: 0 4px 18px 0 rgba(30,160,170,0.12);
  color: #226585;
  padding: 1em 1.3em;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1em;
  z-index: 12001;
  font-size: 1.05em;
  border: 1px solid #e8f8ff;
  max-width: 380px;
}
.no-cookies-popup span {
  line-height: 1.5;
  text-align: left;
}
.no-cookies-popup button {
  background: var(--main-gradient);
  border: none;
  border-radius: 0.9em;
  color: #fff;
  font-weight: 500;
  font-size: 1em;
  padding: 0.6em 1.3em;
  cursor: pointer;
  box-shadow: 0 2px 10px 0 #e2fffd46;
  transition: background 0.18s, transform 0.12s;
  width: 100%;
}
.no-cookies-popup button:hover,
.no-cookies-popup button:focus {
  background: var(--accent-gradient);
  transform: translateY(-1px) scale(1.04);
}
/* ========== Content Card ========== */
.content-card {
  background: var(--card-bg);
  border-radius: 1.35em;
  box-shadow: 0 2px 16px 0 rgba(55,185,195,0.09);
  border: 1px solid var(--card-border);
  padding: 1.5em;
  margin: 0 auto;
  max-width: 1000px;
  text-align: justify;
}
.content-card p {
  margin: 0;
  font-size: 1.05em;
  color: var(--text-description);
  line-height: 1.6;
}
/* ========== Modal ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(21, 63, 83, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.modal.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(30, 160, 170, 0.2);
  border: 1px solid var(--card-border);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}
.modal.show .modal-content {
  transform: translateY(0);
}
.modal-header {
  background: var(--main-gradient);
  color: white;
  padding: 1.5rem;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
}
.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.modal-body {
  padding: 2rem;
}
.modal-body ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.modal-body li {
  margin-bottom: 0.5rem;
  color: var(--text-description);
}
.rules-link {
  display: inline-block;
  margin-top: 1rem;
  color: #35b8d5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.rules-link:hover {
  color: #2ee0b4;
  text-decoration: underline;
}
.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e6faf8;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}
.modal-btn {
  padding: 0.7rem 1.5rem;
  border-radius: var(--menu-button-radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}
.modal-btn.accept {
  background: var(--accent-gradient);
  color: white;
}
.modal-btn.decline {
  background: var(--menu-button-bg);
  color: var(--text-color);
}
.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(55, 210, 210, 0.2);
}

/* ========== Status Block ========== */
.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--card-bg);
  border-radius: 0.8em;
  box-shadow: 0 2px 8px 0 rgba(60,180,190,0.08);
  border: 1px solid #d6f1f3;
  padding: 0.28em 0.9em;
  font-size: 1.07em;
  font-weight: 600;
  margin-left: auto;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background: var(--status-online);
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
  animation: pulse-online 2s infinite;
}

.status-indicator.offline {
  background: var(--status-offline);
  box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}

.status-text {
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.status-text.online {
  color: var(--status-online-text);
}

.status-text.offline {
  color: var(--status-offline-text);
}

@keyframes pulse-online {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* ========== Feedback Page ========== */
.page-title {
  text-align: center;
}

.contact-link-wrapper {
  text-align: center;
  margin: 1.5rem 0;
}

.contact-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 1.8em;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
}

.email-link {
  background: var(--main-gradient);
}

.telegram-link {
  background: #0088cc;
}

.contact-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: white;
}

.feedback-note {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(37, 213, 201, 0.05);
  border-radius: 1em;
  border: 1px solid #e6faf8;
}

.feedback-note p {
  margin: 0;
  text-align: center;
  font-size: 0.95em;
  color: var(--link-color);
}

/* ========== Email Protection ========== */
.protected-email {
  font-weight: 600;
  color: var(--text-description);
}

.email-text {
  transition: all 0.2s;
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
}

.email-text:hover {
  background-color: rgba(53, 184, 213, 0.1);
  box-shadow: 0 0 0 1px rgba(53, 184, 213, 0.3);
}

/* ========== Infographic ========== */
.infographic-container {
  position: relative;
  background: var(--card-bg);
  border-radius: 1.35em;
  box-shadow: 0 2px 16px 0 rgba(55,185,195,0.09);
  border: 1px solid var(--card-border);
  padding: 1.5em;
  margin: 2em auto;
  max-width: 1800px;
  width: 95%;
}

.infographic-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(37,213,201,0.02) 0%, rgba(37,213,201,0.01) 100%);
  z-index: -1;
  pointer-events: none;
}

.infographic-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 1em;
  overflow: hidden;
  background: #fafafa;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.infographic-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.infographic-controls {
  margin-top: 1.2em;
  padding: 1em 1.3em;
  background: rgba(37,213,201,0.05);
  border-radius: 0.9em;
  border: 1px solid #e6faf8;
  font-size: 0.95em;
}

.infographic-controls strong {
  display: block;
  margin-bottom: 0.6em;
  color: var(--text-secondary);
  font-size: 1.05em;
}

.infographic-controls ul {
  margin: 0;
  padding-left: 1.5em;
  color: var(--text-description);
}

.infographic-controls li {
  margin-bottom: 0.4em;
  line-height: 1.5;
}

/* ========== Infographic Page Specific ========== */
.infographic-page main {
  max-width: none;
  width: 100%;
  padding: 1.5rem 2rem 1rem 2rem;
}

.infographic-page #infographic-container {
  max-width: 1200px;
  width: 90%;
  margin: 3rem auto;
  padding: 1.5em;
  background: var(--card-bg);
  border-radius: 1.35em;
  box-shadow: 0 2px 16px 0 rgba(55,185,195,0.09);
  border: 1px solid var(--card-border);
  position: relative;
  box-sizing: border-box;
}

.infographic-page #infographic-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 1em;
  overflow: hidden;
  background: #fafafa;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.infographic-page #infographic-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.infographic-page .infographic-controls {
  margin-top: 1.2em;
  padding: 1em 1.3em;
  background: rgba(37,213,201,0.05);
  border-radius: 0.9em;
  border: 1px solid #e6faf8;
  font-size: 0.95em;
}

/* ========================================
   MEDIA QUERIES (Consolidated)
   ======================================== */

/* Very Large Screens */
@media (min-width: 1600px) {
  .infographic-container {
    max-width: 2000px;
  }
}

/* Large Screens */
@media (max-width: 1400px) {
  .infographic-container {
    max-width: 1400px;
    width: 92%;
  }
}

/* Medium Screens */
@media (max-width: 1200px) {
  main, .services-cards {
    max-width: 95vw;
  }
  .header {
    max-width: 98vw;
  }
}

/* Tablets */
@media (max-width: 1100px) {
  .header {
    max-width: 98vw;
  }
}

/* Small Tablets */
@media (max-width: 900px) {
  .header {
    max-width: 100vw;
  }
  
  main {
    padding-top: 1.7rem;
  }
  
  .infographic-page main {
    padding: 1rem;
  }
  
  .infographic-page #infographic-container {
    max-width: 90vw;
    width: 95%;
    padding: 1em;
  }
  
  .infographic-page #infographic-wrapper {
    padding-bottom: 75%;
  }
  
  .infographic-container {
    padding: 1.2em;
    max-width: 95%;
    width: 95%;
  }
}

/* Mobile Devices */
@media (max-width: 650px) {
  .header {
    max-width: 100vw;
    padding: 0.6rem 0.2rem;
  }
  
  main {
    padding: 1rem 0.5rem 0.5rem;
  }
  
  .hero h1 {
    margin: 0.3em 0 0.2em 0;
    font-size: 1.8rem;
  }
  
  h2 {
    margin: 0.5em 0;
    font-size: 1.4rem;
  }
  
  .logo-big {
    width: 56px;
    margin-bottom: 1em;
    margin-top: 0.5em;
  }
  
  .menu a {
    font-size: 1em;
    --menu-button-padding-h: 1em;
    --menu-button-padding-v: 0.55em;
  }
  
  .menu {
    gap: 0.75rem;
  }
  
  .social-links {
    gap: 1.1rem;
  }
  
  .social-label {
    font-size: 0.90em;
  }
  
  .social {
    width: 90px;
    min-width: 70px;
  }
  
  .services-cards {
    gap: 1.25rem;
    padding-bottom: 0.5rem;
    max-width: 95%;
  }
  
  .service-card {
    padding: 1.15em 1em 1.05em 1em;
  }
  
  .service-card-header h3 {
    font-size: 1.09em;
  }
  
  .service-links {
    gap: 0.5em;
  }
  
  .no-cookies-popup {
    font-size: 0.92em;
    padding: 0.9em 1em;
    gap: 0.85em;
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: calc(100% - 24px);
  }
  
  .no-cookies-popup button {
    padding: 0.65em 1em;
    font-size: 0.98em;
  }
  
  .content-card {
    padding: 1.2em 1em;
    margin: 0 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .content-card p {
    font-size: 1em;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .modal-btn {
    width: 100%;
  }
  
  .status-inline {
    font-size: 0.95em;
    padding: 0.25em 0.7em;
    margin-left: 0;
    margin-top: 0.3em;
  }
  
  .service-card-header {
    flex-wrap: wrap;
  }
  
  .infographic-page main {
    padding: 0.8rem;
  }
  
  .infographic-page #infographic-container {
    max-width: 100vw;
    width: 100%;
    margin: 2rem 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
  }
  
  .infographic-page #infographic-wrapper {
    padding-bottom: 100%;
    border-radius: 0.8rem;
  }
}

/* Small Mobile */
@media (max-width: 400px) {
  .services-cards {
    max-width: 100%;
    margin: 0 0.5rem;
  }
  
  .service-card {
    padding: 1em 0.8em 0.9em 0.8em;
  }
}
