/* =========================================
   1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И ОСНОВА
   ========================================= */
:root {
    --primary-dark: #0f172a;
    --primary-light: #1e293b;
    --accent-color: #3CBBB1;
    --bg-light: #f8fafc;
    --text-main: #334155;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main {
    flex: 1 0 auto;
}

/* =========================================
   2. НАВИГАЦИЯ (NAVBAR)
   ========================================= */
.navbar-custom {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 0;
}

.navbar-custom .navbar-brand {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar-custom .navbar-brand span {
    color: var(--accent-color);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    margin: 0 10px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--accent-color);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* =========================================
   3. ВЫПАДАЮЩИЕ МЕНЮ (DROPDOWNS)
   ========================================= */
.custom-dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    margin-top: 10px;
}

.custom-dropdown-menu .dropdown-item {
    font-weight: 500;
    color: var(--text-main);
    padding: 8px 20px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.custom-dropdown-menu .dropdown-item:hover {
    background-color: rgba(60, 187, 177, 0.1);
    color: var(--accent-color);
}

/* Стили для вложенного меню (Submenu) - Desktop */
@media (min-width: 992px) {
    .custom-dropend { position: relative; }
    .custom-dropend .submenu {
        display: none;
        position: absolute;
        left: 100%;
        top: -8px;
        margin-left: 2px;
    }
    .custom-dropend:hover > .submenu {
        display: block;
        animation: fadeIn 0.2s ease-in;
    }
}

/* Стили для вложенного меню - Mobile */
@media (max-width: 991px) {
    .custom-dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
    .custom-dropend .submenu {
        position: static !important;
        float: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding-left: 20px;
        background-color: rgba(0, 0, 0, 0.03) !important;
        display: none;
    }
    .custom-dropend.show-submenu > .submenu {
        display: block !important;
    }
    .custom-dropend.show-submenu > .dropdown-toggle::after {
        transform: rotate(90deg);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   4. ПОДВАЛ (FOOTER)
   ========================================= */
.footer-custom {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 50px 0 20px;
    margin-top: auto;
    border-top: 4px solid var(--accent-color);
}

.footer-custom h6 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.footer-custom a.footer-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer-custom a.footer-link:hover {
    color: var(--accent-color);
    transform: translateX(3px);
}

.disclaimer-text {
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.4);
}


/* =========================================
   5. СТИЛИ ГЛАВНОЙ СТРАНИЦЫ И DASH-КОНТЕЙНЕРА
   ========================================= */

/* Герой-блок с затемнением */
.hero-section {
    /* Путь идет из /static/aemm/css/ в /static/aemm/ */
    background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.9)),
                      url('../index_7.jpg');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 90vh;
    display: flex;
    align-items: center;
    color: white;
}

/* Заголовок и подзаголовок Hero */
.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    font-weight: 300;
    line-height: 1.6;
}

/* Эффект свечения для кнопок */
.btn-glow {
    box-shadow: 0 0 20px rgba(60, 187, 177, 0.4);
    transition: all 0.3s ease;
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(60, 187, 177, 0.7);
    transform: translateY(-2px);
    color: white;
}

/* Карточки преимуществ */
.feature-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(46, 134, 171, 0.2);
}

.feature-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(46, 134, 171, 0.1), rgba(60, 187, 177, 0.1));
    color: var(--accent-color);
}

/* Карточки навигации (Рынки) */
.nav-card {
    border-radius: 20px;
    padding: 3rem 2rem;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    z-index: -1;
}

.nav-card:hover {
    transform: scale(1.02);
    color: white;
}

.bg-forex {
    background: linear-gradient(135deg, #2E86AB, #1a5670);
}

.bg-crypto {
    background: linear-gradient(135deg, #F18F01, #b56a00);
}

/* Обертка для Dash приложения (используется на главной и в парах) */
.dash-wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    padding: 20px;
    margin-top: -50px; /* Наезд на предыдущий блок */
    position: relative;
    z-index: 10;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .dash-wrapper {
        margin-top: 0;
        border-radius: 12px;
    }
}


/* =========================================
   6. СТИЛИ СТРАНИЦ РЫНКОВ (EUR/USD, BTC и др.)
   ========================================= */

/* Темная шапка страницы актива */
.market-hero-section {
    background: linear-gradient(135deg, var(--primary-dark), #1e293b);
    color: white;
    padding: 4rem 0 5rem 0;
    margin-bottom: -3rem; /* Эффект "наплыва" контента на шапку */
    border-bottom: 3px solid var(--accent-color);
}

/* Бейдж (AI Trading Analysis) */
.hero-badge {
    background: rgba(60, 187, 177, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(60, 187, 177, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

/* Подзаголовок в шапке */
.hero-lead {
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto;
}

/* Акцентное выделение текста */
.text-highlight {
    color: #ffffff;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-color);
}

/* Секция истории / Таблицы */
.history-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    padding: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.history-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.history-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    margin-left: 15px;
}

/* Дополнительная адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .market-hero-section {
        padding: 3rem 0 4rem 0;
        margin-bottom: 0;
    }
    .history-card {
        padding: 1.5rem;
    }
}


/* =========================================
   7. МЕНЮ НАВИГАЦИИ ПО РЫНКАМ (ВЕРХНИЕ И НИЖНИЕ)
   ========================================= */

/* Общие стили контейнеров меню */
.top-market-container, .top-crypto-container, .top-gold-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    margin: 1.5rem auto;
    border: 1px solid #e2e8f0;
}

.bottom-market-container, .bottom-crypto-container, .bottom-gold-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    margin: 3rem auto;
    border: 1px solid #e2e8f0;
}

/* Общие стили табов (вкладок) */
.nav-pills-custom .nav-link {
    color: #64748b;
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    margin: 0.2rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 0.85rem;
    background: transparent;
}

/* Увеличиваем паддинги для нижнего меню */
.bottom-market-container .nav-pills-custom .nav-link,
.bottom-crypto-container .nav-pills-custom .nav-link,
.bottom-gold-container .nav-pills-custom .nav-link {
    padding: 0.6rem 1.5rem;
}

/* Активные табы по категориям */
/* Форекс (Акцентный бирюзовый) */
.top-market-container .nav-pills-custom .nav-link.active,
.bottom-market-container .nav-pills-custom .nav-link.active {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(60, 187, 177, 0.3);
}

/* Крипта (Оранжевый) */
.top-crypto-container .nav-pills-custom .nav-link.active,
.bottom-crypto-container .nav-pills-custom .nav-link.active {
    background-color: #F18F01 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(241, 143, 1, 0.3);
}

/* Золото (Темный с желтым) */
.top-gold-container .nav-pills-custom .nav-link.active,
.bottom-gold-container .nav-pills-custom .nav-link.active {
    background-color: var(--primary-dark) !important;
    color: #fbbf24 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

/* Чипы валютных пар */
.trade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
    min-width: 100px;
}

/* Чипы для нижнего меню крупнее */
.bottom-market-container .trade-chip,
.bottom-crypto-container .trade-chip,
.bottom-gold-container .trade-chip {
    padding: 0.8rem 1.5rem;
    margin: 0.4rem;
    border-radius: 14px;
    min-width: 120px;
}

/* Ховеры и активные состояния чипов по категориям */
/* Форекс */
.top-market-container .trade-chip:hover,
.bottom-market-container .trade-chip:hover {
    border-color: var(--accent-color); color: var(--accent-color);
}
.top-market-container .trade-chip.active-page,
.bottom-market-container .trade-chip.active-page {
    background: var(--primary-dark) !important; color: #fff !important; border-color: var(--primary-dark) !important;
}

/* Крипта */
.top-crypto-container .trade-chip:hover,
.bottom-crypto-container .trade-chip:hover {
    border-color: #F18F01; color: #F18F01;
}
.top-crypto-container .trade-chip.active-page,
.bottom-crypto-container .trade-chip.active-page {
    background: var(--primary-dark) !important; color: #fff !important; border-color: var(--primary-dark) !important;
}

/* Золото */
.top-gold-container .trade-chip:hover,
.bottom-gold-container .trade-chip:hover {
    border-color: #fbbf24; color: #fbbf24;
}
.top-gold-container .trade-chip.active-page,
.bottom-gold-container .trade-chip.active-page {
    background: var(--primary-dark) !important; color: #fbbf24 !important; border-color: var(--primary-dark) !important;
}

/* Специальные контейнеры и переходы на другие рынки */
.special-assets-container {
    border-top: 1px dashed #cbd5e1;
}

.top-market-container .special-assets-container,
.top-crypto-container .special-assets-container,
.top-gold-container .special-assets-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.bottom-market-container .special-assets-container,
.bottom-crypto-container .special-assets-container,
.bottom-gold-container .special-assets-container {
    margin-top: 2.5rem;
    padding-top: 2rem;
}

/* Кнопки-переходы в другие категории (Сырье, Крипта, Форекс) */
.btn-forex {
    background: linear-gradient(135deg, #2E86AB, #1a5670) !important;
    color: #ffffff !important;
    border: none !important;
}
.btn-forex:hover {
    box-shadow: 0 8px 15px rgba(46, 134, 171, 0.3);
    transform: translateY(-2px);
}

.btn-crypto {
    background: linear-gradient(135deg, #F18F01, #b56a00) !important;
    color: #ffffff !important;
    border: none !important;
}
.btn-crypto:hover {
    box-shadow: 0 8px 15px rgba(241, 143, 1, 0.3);
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--primary-dark), #334155) !important;
    color: #fbbf24 !important;
    border: none !important;
}
.btn-gold:hover {
    box-shadow: 0 8px 15px rgba(15, 23, 42, 0.3);
    transform: translateY(-2px);
}

/* =========================================
   8. СТИЛИ ДЛЯ BENTO GRID И СТРУКТУРЫ ИИ (ГЛАВНАЯ)
   ========================================= */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 2rem;
}
.bento-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.bento-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(135deg, rgba(60, 187, 177, 0.05), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--accent-color);
}
.bento-card:hover::before {
    opacity: 1;
}
.icon-glass {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 24px;
    background: rgba(60, 187, 177, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(60, 187, 177, 0.2);
}
.tech-pill {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-dark);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.step-box {
    position: relative;
    padding-left: 40px;
    margin-bottom: 30px;
}
.step-box::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 30px;
    bottom: -20px;
    width: 2px;
    background: dashed 2px var(--accent-color);
    opacity: 0.3;
}
.step-box:last-child::before {
    display: none;
}
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 0 15px rgba(60, 187, 177, 0.5);
}
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
}

/* Фон для карточки "Сырьевые товары" (Темный премиум) */
.bg-commodities {
    background: linear-gradient(135deg, #334155, #0f172a);
}