/* ============================================= */
/* Root Variables                                */
/* ============================================= */
:root {
    --primary: #FFD700;
    --secondary: #111111;
    --accent: #FFC400;
    --text: #E0E0E0;
    --dark-gray: #222222;
    /* Переменные из Стиля 1, если они отличаются, переопределят переменные из Стиля 2 */
    /* --primary: #FFD700; */
    /* --secondary: #111111; */
    /* --accent: #FFC400; */
    /* --text: #E0E0E0; */
    /* --dark-gray: #222222; */
}

/* ============================================= */
/* Basic HTML Element Styling                    */
/* ============================================= */
html {
    scroll-behavior: smooth; /* Плавная прокрутка при переходе по якорям (из Стиля 2) */
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5; /* Из Стиля 1, переопределяет var(--secondary) из Стиля 2 */
    display: flex;
    flex-direction: column;
    align-items: center; /* Из Стиля 1, центрирует контент */
    min-height: 100vh;
    color: var(--text); /* Из Стиля 2 */
    font-family: 'Open Sans', sans-serif; /* Из Стиля 1, переопределяет 'Segoe UI' из Стиля 2 */
    overflow-x: hidden; /* Из Стиля 2 */
    padding-top: 48px; /* Отступ сверху для фиксированного хедера (из Стиля 2) */
}

/* Общие стили для ссылок (из Стиля 2) */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary);
}

/* Общие стили для изображений (из Стиля 2) */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Заголовки (из Стиля 1) */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
}

h2 {
    color: var(--primary); /* Из Стиля 2, применяется ко всем h2 */
}

.card h3 {
    color: var(--primary); /* Из Стиля 2 */
}

/* ============================================= */
/* Layout / Structure                            */
/* ============================================= */
/* Стили для хедера (из Стиля 2) */
header {
    background-color: rgba(0, 0, 0, 0.8) !important;
    text-align: center;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Контейнер для контента (из Стиля 2) */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Для плавного появления/скрытия контента (из Стиля 2) */
.full-article-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 0;
}

.full-article-content:not(.hidden) {
    max-height: 2000px;
    opacity: 1;
}

.read-more-toggle {
    display: inline-block;
    white-space: nowrap;
}

/* Секции (из Стиля 2) */
.section {
    padding: 0.5rem 0;
}

.section#home {
    padding-top: 0 !important;
}
.section-spacing {
    margin-top: 0.5rem;
}
.section h2 {
    margin-bottom: 3rem;
    text-align: center;
}

/* Секции с iframe (из Стиля 2) */
.section-iframe-fullwidth {
    padding-top: 4rem;
    padding-bottom: 0;
}

.iframe-container {
    background-color: var(--dark-gray);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.iframe-container iframe {
    display: block;
    background-color: #0D1117;
    border-radius: 4px;
    width: 100%;
    height: 80vh;
    border: none;
}

.iframe-container-fullwidth {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.iframe-container-fullwidth iframe {
    border-radius: 0;
}

/* ============================================= */
/* Components                                    */
/* ============================================= */

/* Эффект появления при скролле (из Стиля 2) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Логотип (из Стиля 1 - меньший размер) */
.logo {
    max-width: 60px; /* Из Стиля 1, переопределяет 200px */
    height: auto;
    margin-bottom: 20px;
}

/* Пункты навигации (из Стиля 1 - приоритет) */
.nav-item {
    position: relative;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-item:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-item:hover:after,
.nav-item.active:after {
    width: 100%;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600; /* Добавлено из Стиля 2 для активного элемента */
}

/* Текст в Hero-секции (из Стиля 2) */
.hero-text {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 1rem;
}

/* Кнопки (из Стиля 2, но .cta-button из Стиля 1 также присутствует) */
.btn-primary {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* CTA Button (из Стиля 1 - приоритет) */
.cta-button {
    transition: all 0.3s ease;
    text-align: center;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(45, 157, 92, 0.2); /* Зеленая тень из Стиля 1 */
}

/* Карточки (из Стиля 2) */
.card {
    background-color: var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.service-card {
    border-left: 4px solid var(--primary);
}

/* Таймлайн (из Стиля 2) */
.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 30px;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 50%;
}

.timeline-item:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 20px;
    width: 2px;
    height: calc(100% + 10px);
    background-color: var(--primary);
}

.timeline-item:last-child:after {
    display: none;
}

/* Портфолио (из Стиля 2) */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.portfolio-item img {
    display: block;
    width: 100%;
    transition: transform 0.5s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-item-link:hover .portfolio-item {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

/* Формы (из Стиля 2) */
.form-input {
    background-color: var(--dark-gray);
    border: 1px solid #444;
    color: var(--text);
    padding: 0.75rem;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Иконки соц. сетей (из Стиля 2) */
.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark-gray);
    color: var(--primary);
    border-radius: 50%;
    margin-right: 10px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    background-color: var(--primary);
    color: var(--secondary);
}

/* Бэйджи (из Стиля 2) */
.ai-badge {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* ============================================= */
/* Scroll Top Button (из Стиля 1 - приоритет)  */
/* ============================================= */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2d9d5c; /* Зеленый цвет из Стиля 1 */
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 50;
}

#scrollTopBtn:hover {
    background-color: #248b4f; /* Темно-зеленый из Стиля 1 */
}

/* ============================================= */
/* Slide Specific Styles (из Стиля 1 - приоритет)*/
/* ============================================= */
.slide {
    width: 100%;
    max-width: 1280px;
    min-height: 100vh;
    background-color: white;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    font-family: 'Open Sans', sans-serif;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

/* ============================================= */
/* Animations & Animated Components (из Стиля 2) */
/* ============================================= */
.glowing-border {
    position: relative;
}

.glowing-border:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    animation: glow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px var(--primary);
    }
    50% {
        box-shadow: 0 0 20px var(--primary);
    }
    100% {
        box-shadow: 0 0 5px var(--primary);
    }
}

.ai-animation {
    position: relative;
    overflow: hidden;
}

.ai-animation:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.2), transparent);
    animation: ai-scan 3s infinite;
}

@keyframes ai-scan {
    0% {
        left: -100%;
    }
    50% {
        left: 0%;
    }
    100% {
        left: 100%;
    }
}

/* ============================================= */
/* Mentale Map Specific Styles (из Стиля 2)      */
/* ============================================= */
.mind-map {
    display: flex;
    justify-content: center;
    padding: 2rem;
    overflow-x: auto;
}

.mind-map-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
}

.central-node {
    background: var(--primary);
    color: var(--secondary);
    border-radius: 10px;
    padding: 1rem 2rem;
    margin: 1rem auto;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.branches {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

.branch {
    background: var(--dark-gray);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.branch-title {
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-icon {
    width: 1rem;
}

.collapsible-content,
.subbranches {
    display: none;
}

.collapsible-content:not(.collapsed),
.subbranches:not(.collapsed) {
    display: block;
}

.subbranch {
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaf {
    background: #333;
    color: var(--text);
    border-left: 3px solid var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.price {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================= */
/* Responsive / Mobile-Specific Styles           */
/* ============================================= */

/* Мобильное меню (из Стиля 1 - приоритет, но с учетом структуры из Стиля 2) */
#mobile-menu a {
    display: block; /* Из Стиля 1 */
}

/* Исправления для мобильного меню, чтобы ссылки были блочными (из Стиля 1) */
#mobile-menu a {
    display: block;
}

/* Правило для space-x-10 на мобильных устройствах (из Стиля 1) */
@media (max-width: 768px) {
    .space-x-10 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* Стили мобильного меню из Стиля 2, но с display: block для ссылок */
#mobile-menu:not(.hidden) {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--secondary);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--dark-gray);
    z-index: 49;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#mobile-menu a {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--dark-gray);
    /* display: block; */ /* Уже есть выше */
    color: var(--text);
}

#mobile-menu a:last-child {
    border-bottom: none;
}


/* Media queries for responsiveness */
/* md breakpoint (768px) - из Стиля 1 и 2 */
@media (max-width: 768px) { /* max-width для переопределения на мобильных */
    .slide {
        padding: 1rem;
    }
    .flex {
        flex-direction: column;
    }
    .grid-cols-3, .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    .px-16 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .pr-10, .pl-10, .pr-8, .pl-8, .pr-12, .pl-12 {
        padding-left: 0;
        padding-right: 0;
    }
    .text-5xl {
        font-size: 2rem;
    }
    .text-3xl {
        font-size: 1.5rem;
    }
    .text-2xl {
        font-size: 1.25rem;
    }
    .text-xl {
        font-size: 1.125rem;
    }
    .flex-row {
        flex-direction: column;
    }
}

@media (min-width: 768px) { /* min-width для больших экранов */
    #mobile-menu {
        display: none !important;
    }

    .branches {
      grid-template-columns: repeat(2, 1fr);
    }
}

/* lg breakpoint (1024px) - из Стиля 2 */
@media (min-width: 1024px) {
    .branches {
      grid-template-columns: repeat(3, 1fr);
    }
}

/* New breakpoint for 4 columns on very large screens (из Стиля 2) */
@media (min-width: 1200px) {
  .branches {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Print styles (из Стиля 2) */
@media print {
    body {
        background-color: white;
        color: black;
    }
    .branch {
        background: white;
        border-left-color: #ccc;
    }
    .leaf {
        background: #eee;
        color: black;
    }
}