/*
 * 🚀 ФУТУРИСТИЧЕСКИЙ ТЕМНЫЙ CSS-ШАБЛОН (DARK/FUTURISTIC THEME)
 * ПОЛНАЯ ВЕРСИЯ: Включает общие стили, навигацию, футер, логин, кабинет,
 * пакеты/депозиты, курсы, динамический мониторинг и полную адаптивность.
 */

/* 🚀 Общие сбросы и базовые стили (Dark/Futuristic) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основной темный фон */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Контейнеры и заголовки */
.content {
    display: block;
    padding: 40px 20px;
    max-width: 1200px; /* Фиксированный max-width для адаптивности */
    margin: 0 auto;
    flex-grow: 1;
}

h1, h2 {
    color: #ff8c00; /* Яркий оранжевый для заголовков */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 140, 0, 0.5);
    padding-bottom: 5px;
}

p {
    margin-bottom: 20px;
    color: #b0b0b0;
}

/* --- Стили для Шапки и Навигации --- */

.main-header {
    background-color: #1a1a1a;
    border-bottom: 2px solid #ff8c00;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.logo{
    margin: 0;
    color: orange;
    font-size: 1.8em;
    letter-spacing: 2px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    color: #b0b0b0;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
    border-bottom: 2px solid transparent;
}

/* Футуристический эффект подчеркивания при наведении */
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00ff88; /* Ярко-зеленый акцент */
    transition: width 0.3s ease-out;
}

.main-nav a:hover,
.main-nav a.active {
    color: #ff8c00;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
    background-color: #00ff88;
}

/* Стили для кнопки Выхода */
.logout-link {
    color: #ff4444 !important;
    border-bottom: 2px solid transparent !important;
}
.logout-link:hover {
    color: #ff0000 !important;
}
.logout-link:hover::after,
.logout-link.active::after {
    background-color: #ff4444;
}

/* --- Особенности (Features) --- */
.features {
    background-color: #222222;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #ff8c00;
    margin-top: 30px;
}

.features h2 {
    color: #e0e0e0;
    border-bottom: 1px solid #444;
}

.features ul {
    list-style: none;
    padding: 0;
}

.features li {
    /* SVG-треугольник для маркера */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><polygon points="0,5 3,10 10,0" fill="%23ff8c00"/></svg>') no-repeat left center;
    background-size: 8px 8px;
    padding-left: 20px;
    margin-bottom: 10px;
    color: #b0b0b0;
}

/* --- Подвал (Footer) --- */
.main-footer {
    background-color: #333333;
    color: #888888;
    text-align: center;
    padding: 20px 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
    width: 100%;
    margin-top: auto;
}

.main-footer a {
    color: #ff8c00;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.main-footer a:hover {
    color: #ffffff;
}

/* --- Стили для главной страницы (index.php) --- */

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Главный блок Дохода */
.main-profit-block {
    background: #333333;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 140, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.2);
}

.profit-value-box {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
}

.profit-value {
    font-size: 3.5em;
    font-weight: bold;
    letter-spacing: -1px;
    transition: color 0.5s;
    margin-left: 10px;
}

.currency-tag {
    font-size: 1.5em;
    color: #ff8c00;
}

.profit-value.positive {
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

.profit-value.negative {
    color: #ff4444;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.profit-subtext {
    color: #b0b0b0;
    font-size: 1.2em;
}

/* --- Общая статистика (2 колонки) --- */

.stats-summary.two-columns ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background-color: #222222;
    padding: 20px;
    border-radius: 8px;
}

.stats-summary.two-columns li {
    background-color: #333333;
    padding: 10px;
    border-radius: 4px;
    color: #b0b0b0;
    display: flex;
    justify-content: space-between;
}

.stats-summary.two-columns li span {
    font-weight: bold;
    color: #ff8c00;
}

/* --- Таблицы (Общие стили) --- */
.table_user, .transaction-history, .history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #222222;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9em;
}

.table_user th, .table_user td,
.transaction-history th, .transaction-history td,
.history-table th, .history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
    white-space: nowrap; /* Важно для адаптивности */
}

.table_user th, .transaction-history th, .history-table th {
    background-color: #333333;
    color: #ff8c00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Цветовая индикация в таблице */
.status-good { background-color: rgba(0, 255, 136, 0.1); color: #00ff88; }
.status-success { background-color: rgba(255, 140, 0, 0.1); color: #ff8c00; }
.status-canceled { background-color: rgba(255, 68, 68, 0.1); color: #ff4444; }

.action-buy { color: #00ff88; }
.action-sell { color: #ff4444; }
.profit-positive { font-weight: bold; color: #00ff88; }
.profit-negative { font-weight: bold; color: #ff4444; }

/* --- Стили для страницы Курс (rates.php) --- */

.chart-container h2 {
    color: #ff8c00;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333333;
    padding-bottom: 10px;
}

/* Стили для выбора времени на rates.php */
.time-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333333;
    gap: 10px;
}

.time-button {
    background-color: #333333;
    color: #b0b0b0;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    border: 1px solid #333333;
}

.time-button:hover {
    background-color: #444444;
    color: #ffffff;
}

.time-button.active {
    background-color: #ff8c00;
    color: #1a1a1a;
    border-color: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* Настройка контейнера графика (.chart-container) */
.chart-container {
    display: block;
    background-color: #222222;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    width: 100%;
    min-height: 500px;
}

/* Растяжение CANVAS */
#priceChart {
    width: calc(100% - 40px);
    max-height: 300px;
    display: block;
}

/* --- Стили для страницы О Проекте (about.php) --- */

.about-section {
    padding: 30px;
    background-color: #222222;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.about-section .title {
    color: #ff8c00;
    text-align: center;
    margin-bottom: 20px;
}

.about-section .subtitle {
    color: #00ff88;
    margin-top: 30px;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}

.divider {
    border: none;
    height: 1px;
    background-color: #333333;
    margin: 20px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background-color: #333333;
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid #ff8c00;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.feature-card h4 {
    color: #ffffff;
    margin-top: 0;
}

.tech-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.tech-list li {
    background-color: #333333;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    color: #b0b0b0;
    border-left: 5px solid #00ff88;
}

.tech-list li strong {
    color: #ffffff;
}

/* --- Стили для таблицы текущего курса (rates.php) --- */

.current-rate-table {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.rate-info {
    width: 50%;
    min-width: 400px;
    border-collapse: collapse;
    background-color: #333333;
    border-radius: 8px;
    overflow: hidden;
}

.rate-info th, .rate-info td {
    padding: 12px;
    text-align: center;
    border: 1px solid #444444;
}

.rate-info th {
    background-color: #ff8c00;
    color: #1a1a1a;
    font-size: 1.1em;
}

.rate-info td {
    color: #ffffff;
    font-size: 1.2em;
    font-weight: bold;
}

/* --- АНИМАЦИЯ ИЗМЕНЕНИЯ ЦЕНЫ (rates.php) --- */
#current-ask, #current-bid {
    transition: background-color 0.5s ease-out;
}

/* Анимация при росте цены */
.price-up {
    background-color: #008844 !important;
    color: #ffffff !important;
}

/* Анимация при падении цены */
.price-down {
    background-color: #880000 !important;
    color: #ffffff !important;
}

/* --- Стили для packages.php и deposit.php --- */

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.package-card {
    background-color: #333333;
    padding: 20px;
    border-radius: 8px;
    border-top: 5px solid #ff8c00;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.package-card h3 {
    color: #ffffff;
    border-bottom: 1px dashed #555;
    padding-bottom: 10px;
    margin-top: 0;
}

.package-card .limits {
    color: #00ff88;
    font-weight: bold;
    margin-bottom: 15px;
}

.package-card input[type="number"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #444;
    color: #f0f0f0;
}

/* Стили для подтверждения оплаты */
.address-box {
    background-color: #1a1a1a;
    padding: 15px;
    border: 1px dashed #ff8c00;
    word-break: break-all;
    font-size: 0.9em;
    color: #00ff88;
    margin-top: 10px;
    border-radius: 4px;
}

.success-message {
    color: #00ff88;
    font-weight: bold;
}

/* Стилизация кнопки "Пополнить" в карточке пакета (deposit.php) */

.package-card button[type="submit"], #payeer_form input[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: #ff8c00;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

.package-card button[type="submit"]:hover, #payeer_form input[type="submit"]:hover {
    background-color: #e07b00;
    transform: translateY(-1px);
}

/* --- Стили для Кабинета (cabinet.php) (Продолжение) --- */

.cabinet-container {
    max-width: 1200px; /* Расширяем для кабинета */
}
.cabinet-container h1 {
    color: #ff8c00;
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 30px;
}
.cabinet-container h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.total-capital p.amount-lg {
    color: #00ff88;
}

.withdrawal {
    background-color: #333;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.withdrawal-btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: #ff8c00;
    color: #1e1e1e;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

/* --- 📈 Стили для Динамического Мониторинга (dashboard.php) --- */

.price-monitor {
    max-width: 900px;
    margin: 40px auto;
    background: #2a2a2a; 
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
}

/* Контейнер Графика Chart.js */
.chart-container { 
    margin-top: 40px; 
    padding: 20px; 
    background-color: #1e1e1e; 
    border-radius: 8px; 
    border: 1px solid #333;
    min-height: 350px; 
}

/* Сообщения о близости */
#status-message { 
    margin-top: 20px; 
    padding: 15px; 
    border-radius: 8px; 
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    transition: all 0.5s ease;
}
.close-to-buy { 
    background: rgba(255, 68, 68, 0.1); 
    color: #ff4444; 
    border: 1px solid #ff4444; 
}
.close-to-sell { 
    background: rgba(0, 255, 136, 0.1); 
    color: #00ff88; 
    border: 1px solid #00ff88; 
}
.stable { 
    background: #2a2a2a; 
    color: #e0e0e0; 
    border: 1px solid #555555; 
}

/* --- Стили для Шкалы (Термометра) --- */

.price-line-container { 
    margin-top: 60px; 
    position: relative; 
    height: 120px;
    margin-bottom: 30px;
}
.track {
    height: 15px;
    background: linear-gradient(to right, #441111 10%, #2a2a2a 50%, #114411 90%); 
    border-radius: 10px;
    position: relative;
    z-index: 1;
    border: 1px solid #333;
}

#current-price { 
    position: absolute; 
    top: 10px; 
    transform: translateX(-50%); 
    padding: 8px 15px; 
    border-radius: 50px; 
    font-weight: bold; 
    white-space: nowrap;
    background: #ff8c00; 
    color: #1e1e1e; 
    z-index: 10; 
    border: 3px solid #fff;
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.8); 
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    font-size: 1.2em;
}

.target-label {
    position: absolute;
    top: 45px; 
    font-size: 0.9em;
    text-align: center;
    width: 120px; 
    transform: translateX(-50%);
    color: #b0b0b0; 
}
.target-label strong { 
    display: block; 
    font-size: 1.1em; 
    color: #e0e0e0;
}

.divider { 
    position: absolute; 
    top: 15px; 
    height: 10px; 
    width: 2px; 
    background: #e0e0e0; 
    z-index: 5; 
    transition: left 0.5s;
}

#buy-divider { background: #ff4444; } 
#sell-divider { background: #00ff88; } 
#avg-divider { background: #44aaff; } 

/* --- 📱 АДАПТИВНОСТЬ: Медиазапросы для всех устройств --- */

/* 1. Планшеты и мелкие десктопы (до 1024px) */
@media (max-width: 1024px) {
    .content {
        padding: 20px 10px;
    }
    .summary-cards {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
    }
}

/* 2. Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Навигация становится вертикальной */
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    .main-nav {
        margin-top: 15px;
        width: 100%;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav li {
        margin-left: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    .main-nav a {
        display: block;
    }

    /* Сетка финансовой сводки (cabinet.php) */
    .summary-cards {
        grid-template-columns: 1fr; 
    }

    /* Главный блок Дохода (index.php) */
    .profit-value {
        font-size: 2.5em;
    }

    /* Общая статистика (stats-summary) */
    .stats-summary.two-columns ul {
        grid-template-columns: 1fr; 
    }

    /* Уменьшение ширины rate-info */
    .rate-info {
        min-width: 100%;
        width: 100%;
    }
    
    /* Стили для packages.php и deposit.php */
    .packages-grid {
        grid-template-columns: 1fr; 
    }
}

/* 3. Очень маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    h1, h2 {
        font-size: 1.5em;
        letter-spacing: 1px;
    }
    
    /* Уменьшаем отступы */
    .cabinet-container, .login-container, .withdrawal-container, .price-monitor {
        padding: 15px;
    }

    /* Уменьшаем шрифт в таблицах */
    .table_user th, .table_user td, 
    .history-table th, .history-table td {
        padding: 8px;
        font-size: 0.8em;
    }

    /* Уменьшаем шкалу мониторинга */
    .price-line-container {
        height: 100px;
        margin-top: 40px;
    }
    .target-label {
        font-size: 0.8em;
    }
    #current-price {
        padding: 5px 10px;
        font-size: 1em;
    }
}
/* --- Стили для контейнера формы --- */
.form-section {
    max-width: 400px; /* Ограничиваем ширину формы */
    margin: 40px auto; /* Центрируем блок на странице */
    padding: 30px;
    background: #2a2a2a; /* Темно-серый фон блока */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7); /* Глубокая тень */
    border: 1px solid #3c3c3c; /* Небольшая рамка для объема */
    color: #f0f0f0;
}

/* --- Заголовки (Вход, Регистрация) --- */
.form-section h3 {
    color: #ff8c00; /* Яркий оранжевый акцент */
    text-align: center;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Разделитель --- */
.form-section hr {
    border: none;
    height: 1px;
    background-color: #444; /* Темный разделитель */
    margin: 30px 0;
}

/* --- Поля ввода (Inputs) --- */
.form-section input[type="text"],
.form-section input[type="password"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0 20px; /* Отступ после поля */
    border: 1px solid #444;
    border-radius: 6px;
    background-color: #3a3a3a; /* Темный фон поля */
    color: #f0f0f0; /* Светлый текст */
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Фокус на поле ввода */
.form-section input:focus {
    border-color: #00ff88; /* Ярко-зеленый при фокусе */
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    outline: none;
}

/* --- Кнопка (Button) --- */
.form-section button[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: #ff8c00; /* Оранжевый фон кнопки */
    color: #1a1a1a; /* Темный текст на кнопке */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Эффект при наведении на кнопку */
.form-section button[type="submit"]:hover {
    background-color: #e07b00; /* Немного темнее оранжевый */
    transform: translateY(-1px); /* Небольшой подъем */
}

/* Эффект при нажатии */
.form-section button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}