/* ============================================================ */
/*                  REMOTEDESK - OFFICIAL STYLES                */
/* ============================================================ */

/* --- 1. БАЗОВЫЕ И ГЛОБАЛЬНЫЕ СТИЛИ (GLOBAL) --- */

/* Плавный скролл всей страницы */
html {
  scroll-behavior: smooth;
}

/* Цвет ссылок в выпадающем меню при наведении */
#resources-dropdown a:hover {
  color: #3b82f6 !important;
}

/* Основной градиент Hero-секции */
.hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e2937 100%);
}

/* Глубокая тень для меню ресурсов */
#resources-dropdown {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3),
              0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* --- 2. КОМПОНЕНТЫ И ЭЛЕМЕНТЫ (COMPONENTS) --- */

/* Стилизация синих меток Badge */
.badge-features,
.badge-stats {
  background-color: #1e2937 !important;
  color: #60a5fa !important;
  border-color: #475569 !important;
}

/* Белый фон контейнера иконки GitHub */
.github-icon {
  background-color: #ffffff !important;
}

/* Глобальная настройка плавности переходов для всех блоков */
body,
.features-section,
.feature-card,
.install-step,
.stat-card,
.badge-features,
.badge-stats {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Быстрые переходы для навигации */
nav a,
nav button,
.nav-download-btn,
#resources-btn {
  transition: color 0.2s ease, background-color 0.2s ease !important;
}

/* Отключение транзиций при смене темы для стабильности */
html,
body,
nav,
.nav-download-btn,
#theme-toggle {
  transition: none !important;
}

html.light body {
  transition: none !important;
}

/* --- 3. СВЕТЛАЯ ТЕМА (LIGHT MODE) --- */

/* Фон и текст светлой темы */
html.light body {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Светлый градиент Hero */
html.light .hero-bg {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Цвета фонов bg-slate в светлой теме */
html.light .bg-slate-700 { background-color: #e2e8f0 !important; }
html.light .bg-slate-800 { background-color: #ffffffcc !important; }
html.light .bg-slate-900 { background-color: #f8fafc !important; }
html.light .bg-slate-950 { background-color: #ffffffcc !important; }

/* Границы в светлой теме */
html.light .border-slate-800 { border-color: #cbd5e1 !important; }
html.light .border-slate-700 { border-color: #e2e8f0 !important; }

/* Цвета текста в светлой теме */
html.light .text-slate-400 { color: #64748b !important; }
html.light .text-slate-300 { color: #475569 !important; }
html.light .text-slate-500 { color: #64748b !important; }
html.light .text-white { color: #1e2937 !important; }
html.light .text-white:hover { color: #1e2937 !important; }

/* Удаление лишних наложений градиентов */
html.light .to-slate-800 { background: none !important; }
html.light .from-slate-900 { background: #f8fafc !important; }
html.light .hover\:text-blue-400:hover { color: #2563eb !important; }

/* Навигация: эффект стекла в светлой теме */
html.light nav {
  background-color: rgba(255, 255, 255, 0.50) !important;
  border-color: #e2e8f0 !important;
}

html.light nav a,
html.light nav button {
  color: #0f172a !important;
}

/* Кнопка скачивания в шапке (светлая тема) */
html.light .nav-download-btn {
  color: #0f172a !important;
  border-color: #3f3f46 !important;
}

html.light .nav-download-btn:hover {
  background-color: #f4f4f5 !important;
  border-color: #27272a !important;
}

/* Меню ресурсов (светлая тема) */
html.light #resources-dropdown {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light #resources-dropdown a {
  color: #27272a !important;
}

html.light #resources-dropdown a:hover {
  background-color: #f4f4f5 !important;
  color: #3b82f6 !important;
}

/* Метки Badge в светлой теме */
html.light .badge-features,
html.light .badge-stats {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #bae6fd !important;
}

/* Фон секций особенностей */
.features-section {
  background-color: #0f172a !important;
}

html.light .features-section {
  background-color: #f8fafc !important;
}

/* Карточки в светлой теме */
html.light .feature-card {
  background: linear-gradient(to bottom right, #ffffff, #f1f5f9) !important;
  border-color: #e2e8f0 !important;
}

html.light .feature-card h3,
html.light .feature-card p {
  color: inherit !important;
}

/* Ховер шагов установки */
html.light .install-step:hover {
  background-color: #f1f5f9 !important;
}

/* Инверсия GitHub иконки */
html.light .github-icon {
  background-color: #0f172a !important;
}

html.light .github-icon i {
  color: #ffffff !important;
}

/* Кнопки действий в светлой теме */
html.light .bg-blue-600,
html.light a.bg-blue-600:hover {
  color: #ffffff !important;
}

html.light .bg-emerald-600 { color: #ffffff !important; }
html.light a.bg-emerald-600:hover { color: #ffffff !important; }

/* Удаление фона Emerald плашек */
.bg-emerald-900\/70 {
  background-color: transparent !important;
}

/* Ховер ссылок подвала */
html.light footer a:hover {
  color: #0f172a !important;
}

/* Иконка часов и дата в темах */
html.light .policy-date { color: #64748b !important; }
html.light .policy-date i { color: #3b82f6 !important; }
.policy-date i { color: #94a3b8; }

/* --- 4. TERMS & PRIVACY (ТЕКСТОВЫЕ СТРАНИЦЫ) --- */

.terms-content,
.privacy-content {
  font-size: 17.5px;
  line-height: 1.8;
  color: #cbd5e1;
}

@media (min-width: 768px) {
  .terms-content,
  .privacy-content {
    font-size: 18.5px;
  }
}

.terms-heading,
.privacy-heading {
  font-size: 1.75rem;
  line-height: 1.3;
  font-weight: 600;
  color: #ffffff;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .terms-heading,
  .privacy-heading {
    font-size: 2.25rem;
  }
}

.terms-subheading,
.privacy-subheading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

/* Светлая тема для контентных страниц */
html.light .terms-content,
html.light .privacy-content {
  color: #1e2937 !important;
}

html.light .terms-heading,
html.light .privacy-heading,
html.light .terms-subheading,
html.light .privacy-subheading {
  color: #0f172a !important;
}

html.light .terms-content p,
html.light .terms-content li,
html.light .terms-content strong,
html.light .privacy-content p,
html.light .privacy-content li,
html.light .privacy-content strong {
  color: #334155 !important;
}

html.light .terms-content a,
html.light .privacy-content a {
  color: #1e40af !important;
}

/* --- 5. АДАПТИВНЫЕ СТИЛИ (RESPONSIVE) --- */

/* Настройки для 4K */
@media (min-width: 2500px) {
  html.light body { font-size: 1.2rem !important; }
  .container { max-width: 1800px !important; }
}

/* Десктоп отступы */
@media (min-width: 1025px) {
  .hero-bg {
    padding-top: 5rem !important;
  }

  nav .max-w-7xl {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Скрытие кнопок на планшетах */
@media (max-width: 1024px) {
  .nav-download-btn {
    display: none !important;
  }
  
  .min-h-screen {
      min-height: 65vh !important;
  }
}

/* Высота Hero для смартфонов */
@media (max-width: 820px) {
  .min-h-screen {
      min-height: 75vh !important;
  }
}

/* Общий Mobile */
@media (max-width: 768px) {
  .hero-bg {
    padding-top: 7rem !important;
  }
  
  .min-h-screen {
      min-height: 85vh !important;
  }

  nav .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .feature-card,
  .install-step,
  .stat-card {
    padding: 1.75rem 1.25rem;
  }

  .stat-card .text-lg {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .community-section .grid {
    gap: 1.25rem;
  }
  
  html.light #resources-dropdown { position: static !important; width: 100% !important; }
  html.light .feature-card { margin-bottom: 0 !important; }
  
  /* Стрелочки вниз в мобильной схеме */
  .flex-col > .hidden { display: block!important; transform: rotate(90deg); text-align: center; margin: 0.5rem 0!important; }

  /* Кнопки Community центрирование */
  #community-section .grid { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
  #community-section a { width: 100%; max-width: 300px; padding: 1rem 1.5rem!important; }
  #community-section .text-2xl { font-size: 1.25rem!important; }
}

/* Специфические настройки планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-bg {
    padding-top: 6rem !important;
  }

  nav .max-w-7xl {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .stat-card {
    padding: 2rem 1.5rem;
  }

  .stat-card .text-lg {
    font-size: 1.25rem;
  }

  .grid.md\\:grid-cols-3 {
    gap: 1.5rem;
  }
}

/* Финальные мобильные фиксы */
@media (max-width: 640px) {
  /* Схема E2EE */
  .w-24.h-24 { width: 60px!important; height: 60px!important; margin-bottom: 8px!important; }
  .text-6xl { font-size: 24px!important; }
  .text-\[11px\] { font-size: 8px!important; padding: 2px 6px!important; }

  /* Плашки на картинках */
  .absolute.-bottom-4.-right-4 { right: 8px!important; bottom: 8px!important; padding: 6px 12px!important; font-size: 12px!important; }
  .absolute.-bottom-4.-left-4 { left: 8px!important; bottom: 8px!important; padding: 6px 12px!important; font-size: 12px!important; }

  /* Иконки в карточках */
  .grid .group i.text-6xl { font-size: 44px !important; display: block !important; margin-bottom: 4px !important; }
  .feature-card .w-24.h-24 { width: 72px !important; height: 72px !important; margin-bottom: 24px !important; }
  .feature-card i.text-6xl { font-size: 28px !important; }

  /* Отступы преимуществ */
  section.bg-slate-950 .group i.text-6xl { margin-bottom: 1.75rem !important; display: block; }

  /* Кнопки контента */
  .flex-col.sm\:flex-row a { width: 100%; max-width: 320px; padding: 12px 0!important; font-size: 13px!important; justify-content: center; white-space: nowrap; }

  /* Футер блок */
  footer .p-16 { padding: 40px 20px!important; }
  footer h2 { font-size: 28px!important; }
  footer p { font-size: 15px!important; margin-bottom: 24px!important; }

  /* Текстовые страницы */
  section.pt-24 { padding-top: 120px !important; }
  .min-h-screen { min-height: 85vh !important; }

  /* Меню плотность в светлой теме */
  html.light .bg-slate-950 { background-color: #fffffffc !important; }

  /* Квадратность иконок */
  .w-16.h-16 { width: 60px!important; height: 60px!important; flex-shrink: 0!important; }
  .w-16.h-16 i { display: flex; justify-content: center; }

  /* Карточки "Кто использует" */
  .grid.md\:grid-cols-3 .group .text-2xl { font-size: 1.15rem !important; line-height: 1.4 !important; }
  .grid.md\:grid-cols-3 .group .text-slate-400 { font-size: 0.85rem !important; }
  .grid.md\:grid-cols-3 .group .text-xs { font-size: 0.7rem !important; padding: 4px 12px !important; }
  .grid.md\:grid-cols-3 .group .mt-10 { margin-top: 1.5rem !important; padding-top: 1rem !important; }
}

/* --- 6. ОТКЛЮЧЕНИЕ ПЕРЕХОДОВ ПРИ СМЕНЕ ТЕМЫ (БЕЗОПАСНЫЙ ВАРИАНТ) --- */
/* 6.1. Мгновенная смена ЦВЕТА темы для всего сайта (тема меняется резко) */
* { 
  transition-property: color, background-color, border-color, fill, stroke !important; 
  transition-duration: 0s !important; 
}

/* 6.2. ВОЗВРАЩАЕМ ПЛАВНОСТЬ ДЛЯ ДВИЖЕНИЯ (Hover, Scale) И ТЕНЕЙ */
/* Это вернет "дорогую" анимацию иконкам, кнопкам и карточкам */
i, a, button, .group, .feature-card, .install-step, .stat-card, [class*="w-"], [class*="h-"], [class*="animate-"] {
  transition-property: transform, box-shadow, filter, opacity !important;
  transition-duration: 0.4s !important;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 6.3. СТАБИЛЬНАЯ РАБОТА ВЫПАДАЮЩЕГО МЕНЮ РЕСУРСОВ */
/* Оставляем задержку 0.2с на открытие/закрытие, чтобы меню не "убегало" */
#resources-dropdown { 
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s !important; 
}

/* 6.4. ОТКЛЮЧЕНИЕ ЗАДЕРЖЕК ВНУТРИ МЕНЮ */
/* Чтобы пункты внутри меню перекрашивались мгновенно при смене темы */
#resources-dropdown * { 
  transition: none !important; 
}

/* --- 7. СТИЛИ ДЛЯ ВСПЛЫВАЮЩЕГО ОКНА COOKIE --- */
.notice-layout {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 450px;
    /* Аналог bg-slate-950/50 + backdrop-blur-md */
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Аналог border-slate-800 */
    border: 1px solid #1e293b; 
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 16px 20px;
    z-index: 999999;
    display: none;
    animation: slideUpNotice 0.5s ease-out forwards;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.notice-inner { display: flex; align-items: center; gap: 15px; justify-content: space-between; }
.notice-graphic { font-size: 28px; }

/* Цвета текста для темной темы */
.notice-body h3 { margin: 0; font-size: 16px; color: #f8fafc; font-weight: 700; }
.notice-body p { margin: 0; font-size: 13px; color: #94a3b8; line-height: 1.3; }
.notice-body a { color: #3b82f6; text-decoration: none; border-bottom: 1px solid rgba(59,130,246,0.2); }
.notice-btns { display: flex; align-items: center; gap: 12px; }

/* Кнопка для темной темы (белая, как акцент) */
.main-action {
    background: #f8fafc; color: #020617; border: none; 
    padding: 8px 16px; border-radius: 8px; cursor: pointer; 
    font-weight: 600; font-size: 13px; transition: 0.2s;
}
.main-action:hover { background: #ffffff; opacity: 0.9; }
.close-action { background: transparent; border: none; font-size: 22px; color: #475569; cursor: pointer; line-height: 1; }

/* ПЕРЕКЛЮЧЕНИЕ В СВЕТЛЫЙ РЕЖИМ (html.light) */
html.light .notice-layout {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
html.light .notice-body h3 { color: #333; }
html.light .notice-body p { color: #666; }
html.light .main-action { background: #1d1d1f; color: #fff; }
html.light .main-action:hover { background: #000; }
html.light .close-action { color: #999; }

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 480px) {
    .notice-layout { 
        left: 15px;
        right: 15px;
        bottom: 15px;
        max-width: none;
        width: auto;
        padding: 10px 15px;
    }
    .notice-inner { 
        flex-direction: column; 
        text-align: center; 
        gap: 6px; 
    }
    .notice-graphic { display: none; }
    
    .notice-body { 
        width: 100%; 
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .notice-body h3 { font-size: 15px; }
    .notice-body p { font-size: 12px; margin-bottom: 5px; }
    
    .notice-btns { 
        margin-left: 0; 
        flex-direction: row; 
        justify-content: center;
        align-items: center;
        gap: 15px; 
        width: 100%;
    }
    .main-action { width: auto; padding: 7px 20px; }
    .close-action { font-size: 22px; padding: 0; }
}

/* --- 8. СТИЛИ ДЛЯ КНОПКИ НАВЕРХ --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  
  /* Тот самый синий цвет */
  background-color: #007bff; 
  color: white;
  
  /* Обводка, чтобы кнопка не терялась на темном фоне */
  border: 2px solid rgba(255, 255, 255, 0.1); 
  
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  
  /* Усиленная тень для контраста на любом фоне */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  
  z-index: 1000;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

/* Эффект при наведении (чуть темнее синий) */
.back-to-top:hover {
  background-color: #0056b3;
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Класс появления */
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Скрываем на мобильных (экран меньше 768px) */
@media (max-width: 767px) {
  .back-to-top {
    display: none !important;
  }
}

/* --- 9. ОКНО ТЕРМИНАЛА НА ГЛАВНОЙ СТРАНИЦЕ --- */
/* --- 9.1. ШРИФТ --- */
@font-face {
    font-family: 'Roboto Condensed';
    src: url('../webfonts/RobotoCondensed-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
}

/* --- 9.2. БАЗОВЫЙ КОНТЕЙНЕР (ТЕМНАЯ ТЕМА ПО УМОЛЧАНИЮ) --- */
.terminal-block {
    font-family: 'Roboto Condensed', sans-serif !important;
    width: 590px !important; 
    min-width: 590px !important;
    height: 394px;
    display: flex; flex-direction: column; overflow: hidden;
    margin: 20px auto; box-sizing: border-box;
    border-radius: 12px;
    -webkit-font-smoothing: antialiased;

    /* Эффект стекла для темной темы */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(13, 17, 23, 0.02) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* --- 9.3. ПОДДЕРЖКА СВЕТЛОЙ ТЕМЫ --- */
html.light .terminal-block {
    /* Светлое стекло */
    background: rgba(255, 255, 255, 0.3) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

html.light .terminal-header {
    background: rgba(0, 0, 0, 0.05); /* Чуть темнее фон шапки в светлой теме */
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

html.light .terminal-body { color: #0f172a; } /* Темный текст */
html.light .t-title { color: #475569; }     /* Темный заголовок */

/* --- 9.4. ШАПКА И КНОПКИ (УНИВЕРСАЛЬНЫЕ) --- */
.terminal-header { background: #161b22; padding: 12px 18px; display: flex; align-items: center; border-bottom: 1px solid #30363d; }
.t-dots { display: flex; gap: 8px; }
.t-dot { width: 12px; height: 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; }
.t-dot::before, .t-dot::after { content: ''; position: absolute; opacity: 0; transition: opacity 0.2s; background: rgba(0, 0, 0, 0.75); }
.terminal-header:hover .t-dot::before, .terminal-header:hover .t-dot::after { opacity: 1; }

.r { background: #ff5f56; } .r::before, .r::after { width: 8px; height: 1.8px; border-radius: 2px; }
.r::before { transform: rotate(45deg); } .r::after { transform: rotate(-45deg); }
.y { background: #ffbd2e; } .y::before { width: 8px; height: 1.8px; border-radius: 2px; }
.g { background: #27c93f; }
.g::before, .g::after { width: 0; height: 0; background: transparent; border-style: solid; }
.g::before { border-width: 0 4.5px 4.5px 0; border-color: transparent rgba(0,0,0,0.75) transparent transparent; top: 3px; right: 3px; }
.g::after { border-width: 4.5px 0 0 4.5px; border-color: transparent transparent transparent rgba(0,0,0,0.75); bottom: 3px; left: 3px; }

.t-title { margin-left: 15px; font-size: 15px; color: #8b949e; display: flex; align-items: center; gap: 8px; }
.t-icon { opacity: 0.6; color: #8b949e; flex-shrink: 0; }

/* --- 9.5. ТЕЛО И АНИМАЦИЯ --- */
.terminal-body { padding: 35px 40px; font-size: 15px; line-height: 1.7; color: #c9d1d9; flex-grow: 1; }
.t-line { opacity: 0; transform: translateY(4px); animation: t-f 0.4s ease forwards; margin-bottom: 5px; white-space: nowrap; }
@keyframes t-f { to { opacity: 1; transform: translateY(0); } }

.t-time { color: #58a6ff; margin-right: 12px; }
.t-gray { color: #8b949e; margin-bottom: 15px; display: block; }
.t-cursor{display:inline-block;width:8px;height:17px;background:#58a6ff;vertical-align:middle;margin-left:4px;animation:t-blink-smooth 1.2s ease-in-out infinite;box-shadow:0 0 8px rgba(88,166,255,0.4)}
@keyframes t-blink-smooth{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.2;transform:scale(0.95)}}

/* --- 9.6. АДАПТАЦИЯ (ПЛАНШЕТЫ И МОБИЛЬНЫЕ УСТРОЙСТВА) --- */
/* ТОЧЕЧНО ДЛЯ IPAD И ПЛАНШЕТОВ (1180px) */
@media (max-width: 1180px) {
    /* Только само окно терминала */
    div.terminal-block {
        width: 100% !important;
        min-width: 0 !important;
        height: 300px !important;
        margin: 0 auto !important;
    }
    /* Только текст внутри логов */
    div.terminal-block .terminal-body {
        padding: 25px 20px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
    }
    /* Защита от вылета текста за границы */
    div.terminal-block .t-line {
        white-space: normal !important;
        word-break: break-all;
    }
}

/* ТОЧЕЧНО ДЛЯ IPAD (768px) И ПЛАНШЕТОВ (820px) */
@media (max-width: 850px) {
    div.terminal-block {
        height: 280px !important; /* Уменьшили высоту здесь */
    }
}

/* ТОЧЕЧНО ДЛЯ MOBILE (640px) */
@media (max-width: 640px) {
    div.terminal-block {
        height: 260px !important;
    }
    div.terminal-block .terminal-body {
		padding: 25px 20px !important;
        font-size: 11px !important;
    }
}
