body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #0d1520; /* Темно-синий фон для страницы */
    color: #e6e6e6;
}

/* Заменяем абсолютное позиционирование на flex-контейнер в верхней части */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative; /* Добавляем для правильного позиционирования дочерних элементов */
}

/* Добавляем шапку для логотипа и настроек */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.chart-container {
    width: 100%;
    height: 500px;
    background-color: rgb(8, 30, 43);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.view-selector, .time-selector, .currency-selector {
    display: flex;
    gap: 5px;
    background-color: rgba(13, 36, 54, 0.7); /* Темно-синий с прозрачностью */
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid rgba(0, 204, 177, 0.1);
}

.view-btn, .time-btn, .currency-btn {
    border: none;
    background: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
    color: #9cb3c9; /* Светло-синий для неактивных кнопок */
}

.view-btn.active, .time-btn.active, .currency-btn.active {
    background-color: #00e6b8;
    color: #0d1117;
}

.view-btn:hover, .time-btn:hover, .currency-btn:hover {
    background-color: rgba(0, 255, 182, 0.15);
    color: #e6e6e6;
}

.info-box {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(13, 36, 54, 0.9);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 80%;
    border: 1px solid rgba(0, 204, 177, 0.2);
}

.info-box h3 {
    color: #e6e6e6;
}

.info-box p {
    color: #9cb3c9;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.stat-item {
    background-color: rgba(13, 36, 54, 0.8); /* Темно-синий с прозрачностью */
    border-radius: 10px;
    padding: 12px;
    flex: 1;
    min-width: calc(50% - 10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    box-sizing: border-box;
    border: 1px solid rgba(0, 204, 177, 0.1); /* Тонкая граница с цветом акцента */
}

.stat-title {
    font-size: 13px;
    color: #9cb3c9; /* Светло-синий для заголовков */
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #e6e6e6; /* Светлый текст для значений */
    transition: color 0.3s ease;
    min-height: 30px; /* Фиксированная высота для предотвращения прыжков */
    display: flex;
    justify-content: center;
    align-items: center;
}

.stat-value.animating {
    color: #00ffb6; /* Подсветка во время анимации */
}

@keyframes pulse-number {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.highlight {
    color: #00ffb6; /* Сохраняем яркий цвет для подсветки */
}

.rates-info {
    background-color: rgba(8, 30, 43, 0.7);
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #9cb3c9;
    display: none;
    border: 1px solid rgba(0, 204, 177, 0.1);
}

.refresh-btn {
    background-color: #00e6b8;
    color: #0d1117;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.refresh-btn:hover {
    background-color: #00ccaa;
    transform: translateY(-2px);
}

.refresh-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.secondary-chart {
    background-color: rgb(8, 30, 43);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: 300px;
    position: relative;
}

.chart-title {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 14px;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

.full-width-chart {
    width: 100%;
    margin-top: 20px;
}

.chart-block {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.chart-description {
    background-color: rgba(13, 36, 54, 0.95);
    border-radius: 0 0 16px 16px;
    padding: 12px 15px;
    font-size: 13px;
    color: #9cb3c9;
    margin-top: -5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    text-align: center;
    border-top: 1px solid rgba(0, 204, 177, 0.1);
}

.full-width-chart .chart-description {
    max-width: 800px;
    margin: -5px auto 20px;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 992px) {
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .secondary-chart {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 400px;
    }
    
    .secondary-chart {
        height: 250px;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .view-selector, .time-selector, .currency-selector {
        width: 100%;
        justify-content: space-between;
        padding: 6px 8px;
    }
    
    .view-btn, .time-btn, .currency-btn {
        font-size: 13px;
        padding: 6px 10px;
        flex: 1;
        margin: 0 2px;
        text-align: center;
    }
    
    .stat-item {
        min-width: calc(50% - 5px);
        padding: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .chart-title {
        font-size: 12px;
        padding: 4px 8px;
    }

    .chart-description {
        font-size: 12px;
        padding: 10px;
    }

    .header-container {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .chart-container {
        height: 300px;
        margin-bottom: 15px;
    }
    
    .secondary-chart {
        height: 250px;
    }
    
    .info-box {
        padding: 8px;
        top: 10px;
        left: 10px;
    }
    
    .info-box h3 {
        font-size: 14px;
    }
    
    .info-box p {
        font-size: 12px;
    }
    
    .stat-item {
        min-width: calc(50% - 5px);
        margin-bottom: 5px;
        padding: 8px;
    }
    
    .stat-title {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .chart-description {
        font-size: 11px;
        padding: 8px;
    }
    
    .chart-title {
        top: 5px;
        left: 5px;
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .view-btn, .time-btn, .currency-btn {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .full-width-chart .secondary-chart {
        height: 300px;
    }

    .header-container {
        margin-bottom: 8px;
    }
}

@media (max-width: 360px) {
    .chart-container {
        height: 250px;
    }
    
    .secondary-chart {
        height: 200px;
    }
    
    .stat-item {
        min-width: 100%;
    }
    
    .full-width-chart .secondary-chart {
        height: 250px;
    }
}

/* Обновляем стили для контейнеров логотипа и настроек */
.logo-container {
    position: static; /* Убираем абсолютное позиционирование */
    z-index: 100;
}

.logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Стили для меню настроек */
.settings-container {
    position: static; /* Убираем абсолютное позиционирование */
    z-index: 100;
}

.settings-icon {
    background-color: rgba(0, 204, 177, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.settings-icon:hover {
    background-color: rgba(0, 255, 182, 0.9);
    transform: translateY(-2px);
}

.settings-icon.active {
    background-color: #00ffb6;
    box-shadow: 0 0 15px rgba(0, 255, 182, 0.5);
}

/* Обновляем позиционирование выпадающего меню */
.settings-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: rgba(13, 36, 54, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 280px;
    padding: 15px;
    display: none;
    border: 1px solid rgba(0, 204, 177, 0.2);
}

.settings-menu.show {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.settings-header {
    color: #e6e6e6;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 204, 177, 0.2);
}

.rates-info {
    background-color: rgba(8, 30, 43, 0.7);
    margin: 10px 0;
    display: block;
    width: auto;
}

/* Анимация для меню */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .logo {
        height: 30px;
    }
    
    .settings-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .settings-menu {
        width: 250px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        top: 10px;
        left: 10px;
    }
    
    .logo {
        height: 25px;
    }
    
    .settings-container {
        top: 10px;
        right: 10px;
    }
    
    .settings-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .settings-menu {
        width: 220px;
        padding: 8px;
    }
}

/* Добавьте стиль для индикатора обновления курсов */
.settings-icon.updated::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background-color: #ff4d4f;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Добавьте эти стили в конец файла */

/* Стиль для иконки разворачивания графика */
.expand-chart {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 204, 177, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.expand-chart:hover {
    background-color: rgba(0, 255, 182, 0.9);
    transform: translateY(-2px);
}

/* Стили для модального окна с развернутым графиком */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    height: 80%;
    background-color: rgb(8, 30, 43);
    border-radius: 16px;
    position: relative;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 77, 79, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 18px;
}

.close-modal:hover {
    background-color: rgba(255, 77, 79, 1);
    transform: rotate(90deg);
}

.modal-chart-container {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .expand-chart {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .expand-chart {
        top: 5px;
        right: 5px;
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    .modal-content {
        width: 95%;
        height: 70%;
    }
}