:root {
    /* Основная цветовая схема (темная тема) */
    --bg-primary: #0f1729;
    --bg-secondary: #151f38;
    --bg-tertiary: #1c2a4a;
    --card-background-dark: #1a2942;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Акцентные цвета */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    
    /* Специальные цвета */
    --bitcoin: #f7931a;
    --ethereum: #627eea;
    --euro: #4169e1;
    --ruble: #71c5e8;
    --dollar: #22c55e;
    
    /* Градиенты */
    --gradient-blue: linear-gradient(135deg, #3b82f6, #2dd4bf);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
    --gradient-bitcoin: linear-gradient(135deg, #f7931a, #f97316);
    --gradient-ethereum: linear-gradient(135deg, #627eea, #a78bfa);
    
    /* Тени */
    --shadow-small: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 10px rgba(0, 0, 0, 0.25);
    --shadow-large: 0 10px 20px rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 0 2px 5px rgba(0, 0, 0, 0.15);
    
    /* Закругления */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 20px;
    --radius-full: 9999px;
    
    /* Переходы */
    --transition-speed: 0.3s;

    /* Дополнительные цвета для тем */
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196F3;
    --disabled-color: #9e9e9e;
}

/* Светлая тема */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --card-background-dark: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --shadow-small: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-large: 0 10px 20px rgba(0, 0, 0, 0.1);
    --shadow-inner: inset 0 2px 5px rgba(0, 0, 0, 0.05);

    /* Дополнительные цвета для тем */
    --success-color: #43a047;
    --error-color: #e53935;
    --warning-color: #fb8c00;
    --info-color: #1e88e5;
    --disabled-color: #bdbdbd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease,
                color var(--transition-speed) ease;
}

/* Анимация перехода для всех элементов */
.dashboard *:not(.notification) {
    transition: background-color var(--transition-speed) ease,
                color var(--transition-speed) ease,
                border-color var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}

/* Основная структура */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Боковая панель */
.sidebar {
    background-color: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-right: 1px solid rgba(128, 128, 128, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--accent-blue);
}

.logo i {
    font-size: 1.5rem;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-medium);
    transition: all 0.2s ease;
}

.menu a i {
    font-size: 1.25rem;
    width: 1.5rem;
}

.menu a:hover {
    background-color: rgba(128, 128, 128, 0.05);
    color: var(--text-primary);
}

.menu a.active {
    background-color: var(--bg-tertiary);
    color: var(--accent-blue);
}

.theme-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-top: 2rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-medium);
}

.switch {
    width: 2.5rem;
    height: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.35rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.switch .theme-icon {
    font-size: 0.85rem;
    z-index: 1;
    color: var(--text-primary);
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.switch .fa-sun {
    transform: translateY(0);
    opacity: 0;
}

.switch .fa-moon {
    transform: translateY(0);
    opacity: 1;
}

/* Анимация движения иконок при переключении */
[data-theme="light"] .switch .fa-sun {
    transform: translateY(0);
    opacity: 1;
    color: #f59e0b;
}

[data-theme="light"] .switch .fa-moon {
    transform: translateY(20px);
    opacity: 0;
}

[data-theme="dark"] .switch .fa-sun {
    transform: translateY(-20px);
    opacity: 0;
}

[data-theme="dark"] .switch .fa-moon {
    transform: translateY(0);
    opacity: 1;
    color: #8b5cf6;
}

/* Индикатор переключателя */
.switch::after {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    background: var(--accent-blue);
    border-radius: 50%;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] .switch::after {
    transform: translateX(1rem);
    background: var(--accent-yellow);
}

/* Улучшенные стили для светлой темы */
[data-theme="light"] .stat-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .rates-card,
[data-theme="light"] .converter-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] select,
[data-theme="light"] input {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .period-btn {
    background-color: #e2e8f0;
    color: #64748b;
}

/* Основной контент */
.content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 100vh;
}

/* Верхняя панель */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: none; /* Скрываем на маленьких экранах */
}

.currency-selector select {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-medium);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-selector select:hover {
    border-color: var(--accent-blue);
}

/* Карточки статистики */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-small);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}

.stat-icon.bitcoin {
    background: var(--gradient-bitcoin);
    color: white;
}

.stat-icon.ethereum {
    background: var(--gradient-ethereum);
    color: white;
}

.stat-icon.euro {
    background: linear-gradient(135deg, #4169e1, #3a86ff);
    color: white;
}

.stat-icon.ruble {
    background: linear-gradient(135deg, #71c5e8, #5eead4);
    color: white;
}

.stat-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

/* Графики */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    flex-grow: 1;
    overflow: hidden;
}

.chart-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-small);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.period-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.period-btn.active {
    background-color: var(--accent-blue);
    color: white;
}

.refresh-btn {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.refresh-btn:hover {
    color: var(--accent-color, #3b82f6);
}

.chart-container {
    padding: 0.75rem;
    height: 180px;
    position: relative;
    flex-grow: 1;
}

/* Карточки нижней части */
.bottom-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    max-height: 30vh;
}

.rates-card, .converter-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Текущие курсы */
.rates-grid {
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    overflow-y: auto;
    max-height: calc(30vh - 50px);
}

.rate-item {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-medium);
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
}

.rate-item:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.05);
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.currency-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
}

.currency-icon.eur {
    background: linear-gradient(135deg, #4169e1, #3a86ff);
    color: white;
}

.currency-icon.gbp {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

.currency-icon.jpy {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.currency-icon.rub {
    background: linear-gradient(135deg, #71c5e8, #5eead4);
    color: white;
}

.currency-info div {
    display: flex;
    flex-direction: column;
}

.currency-info strong {
    font-size: 1rem;
    font-weight: 600;
}

.currency-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rate-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Конвертер валют */
.converter {
    padding: 0.75rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: end;
    height: calc(30vh - 50px);
}

.converter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.converter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.converter-input {
    position: relative;
    display: flex;
}

.converter-input input {
    width: 100%;
    padding: 0.75rem 4rem 0.75rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-medium);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.converter-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.converter-input select {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top-right-radius: var(--radius-medium);
    border-bottom-right-radius: var(--radius-medium);
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

#result {
    background-color: var(--bg-tertiary);
    cursor: not-allowed;
}

.converter-swap {
    display: flex;
    justify-content: center;
    align-items: center;
}

#swapCurrencies {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: var(--gradient-blue);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

#swapCurrencies:hover {
    transform: rotate(180deg);
    box-shadow: var(--shadow-medium);
}

/* Адаптивный дизайн */
@media (max-width: 1200px) {
    .charts-container,
    .bottom-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 150px;
    }
    
    .bottom-cards {
        max-height: 40vh;
    }
    
    .rates-grid {
        max-height: calc(40vh - 50px);
    }
    
    .converter {
        height: calc(40vh - 50px);
    }
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-large);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .content {
        max-height: 100vh;
        padding-top: 3rem;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    .backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .backdrop.active {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 0.75rem;
        padding-top: 3rem;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .stat-info h3 {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .chart-card {
        margin-bottom: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }
    
    .period-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .converter {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .converter-swap {
        margin: 0.5rem auto;
        transform: rotate(90deg);
    }
    
    .converter-input input, 
    .converter-input select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .rates-grid {
        gap: 0.5rem;
    }
    
    .rate-item {
        padding: 0.75rem;
    }
    
    .currency-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .currency-info strong {
        font-size: 0.9rem;
    }
    
    .currency-name {
        font-size: 0.75rem;
    }
    
    .rate-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.75rem;
    }
    
    .stat-info {
        text-align: right;
    }
    
    .bottom-cards {
        grid-template-columns: 1fr;
        max-height: none;
    }
    
    .rates-card, 
    .converter-card {
        max-height: none;
    }
    
    .rates-grid {
        max-height: 300px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .history-filters {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .history-summary {
        grid-template-columns: 1fr;
    }
    
    .history-table th:nth-child(2),
    .history-table td:nth-child(2),
    .history-table th:nth-child(4),
    .history-table td:nth-child(4) {
        display: none;
    }
    
    .settings-card {
        padding: 0.75rem;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .setting-control {
        width: 100%;
    }
    
    .crypto-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .settings-actions button {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .page-title h1 {
        font-size: 1.1rem;
    }
    
    .currency-selector select {
        width: 100%;
    }
    
    .crypto-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .period-buttons {
        flex-wrap: wrap;
    }
    
    .chart-container {
        height: 180px;
    }
}

/* Когда высота экрана меньше 800px */
@media (max-height: 800px) {
    .sidebar {
        padding: 0.75rem;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .menu a {
        padding: 0.5rem;
    }
    
    .theme-toggle {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .content {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .stats-cards {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .chart-container {
        height: 150px;
    }
    
    .page-title p {
        display: none;
    }
    
    .rates-grid, 
    .converter {
        padding: 0.5rem;
    }
}

/* Когда высота экрана очень маленькая */
@media (max-height: 600px) {
    .chart-container {
        height: 120px;
    }
    
    .stat-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .currency-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .card-header h2 {
        font-size: 0.9rem;
    }
    
    .period-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

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

.chart-card, .rates-card, .converter-card, .stat-card {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Анимация вращения для кнопки обновления */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

/* Стили для уведомлений */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.notification {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 300px;
}

.notification.success {
    background-color: #10b981;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification.info {
    background-color: #3b82f6;
    color: white;
}

/* Стили для страницы истории */
.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    padding: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 0.75rem;
    border-radius: var(--radius-medium);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-group select:hover {
    border-color: var(--accent-blue);
}

.apply-filters-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-medium);
    background-color: var(--accent-blue);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.apply-filters-btn:hover {
    background-color: var(--accent-purple);
    transform: translateY(-2px);
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-small);
    transition: transform 0.3s, box-shadow 0.3s;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.summary-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    background: var(--gradient-blue);
    color: white;
}

.summary-details h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.history-container {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-medium);
    overflow: hidden;
    flex-grow: 1;
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
}

.history-table-container {
    padding: 0.5rem 1rem;
    overflow-x: auto;
    flex-grow: 1;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.history-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge.buy {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.badge.sell {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.badge.exchange {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.status {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status.completed {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.status.pending {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.status.failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--accent-blue);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
    margin: 0 1rem;
    align-items: center;
}

.page-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number:hover:not(.active) {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.page-number.active {
    background-color: var(--accent-blue);
    color: white;
}

.page-dots {
    color: var(--text-secondary);
}

/* Адаптивные стили для истории */
@media (max-width: 1200px) {
    .history-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .history-summary {
        grid-template-columns: 1fr;
    }
    
    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-table th:nth-child(3),
    .history-table td:nth-child(3),
    .history-table th:nth-child(5),
    .history-table td:nth-child(5) {
        display: none;
    }
}

/* Когда высота экрана маленькая */
@media (max-height: 800px) {
    .summary-card {
        padding: 0.75rem;
    }
    
    .summary-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .summary-value {
        font-size: 1.25rem;
    }
    
    .history-table td,
    .history-table th {
        padding: 0.75rem;
    }
}

/* Стили для страницы настроек */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 0.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-title {
    font-size: 1.2rem;
    margin: 0;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color-secondary);
}

.settings-title i {
    opacity: 0.7;
}

.settings-card {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-info h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 500;
}

.setting-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

.setting-control {
    min-width: 120px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Переключатели */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0 0.5rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--disabled-color);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Слайдер */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--disabled-color);
    outline: none;
    border-radius: 3px;
    margin: 0 1rem 0 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

/* Чекбоксы для криптовалют */
.crypto-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crypto-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.crypto-checkboxes input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    outline: none;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.crypto-checkboxes input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.crypto-checkboxes input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
}

/* Кнопки */
.settings-actions {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    margin-top: 1rem;
}

.btn-primary, .btn-danger, .btn-success {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-primary:hover, .btn-danger:hover, .btn-success:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-primary:active, .btn-danger:active, .btn-success:active {
    transform: translateY(0);
}

/* Стили для компактного режима */
.compact-mode .dashboard {
    --sidebar-width: 200px;
}

.compact-mode .content {
    padding: 0.5rem;
}

.compact-mode .top-bar {
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.5rem;
}

.compact-mode .page-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.compact-mode .page-title p {
    font-size: 0.8rem;
}

.compact-mode .stats-cards,
.compact-mode .charts-container,
.compact-mode .rates-section,
.compact-mode .rates-grid,
.compact-mode .settings-container,
.compact-mode .history-filters,
.compact-mode .history-summary {
    gap: 0.5rem;
}

.compact-mode .stat-card,
.compact-mode .chart-card,
.compact-mode .rate-card,
.compact-mode .converter,
.compact-mode .settings-card,
.compact-mode .summary-card {
    padding: 0.5rem;
}

.compact-mode .card-header {
    padding: 0.5rem;
}

.compact-mode .card-header h2 {
    font-size: 1rem;
}

.compact-mode .chart-container {
    padding: 0.5rem;
    min-height: 200px;
}

.compact-mode .period-buttons {
    padding: 0.3rem;
    gap: 0.3rem;
}

.compact-mode .period-buttons button {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.compact-mode .rate-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.compact-mode .rate-value {
    font-size: 1.1rem;
}

.compact-mode .rate-change {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
}

.compact-mode .sidebar {
    padding: 0.5rem;
}

.compact-mode .logo h2 {
    font-size: 1.2rem;
}

.compact-mode .menu a {
    padding: 0.5rem;
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.compact-mode .theme-toggle {
    padding: 0.5rem;
    font-size: 0.8rem;
}

.compact-mode .setting-item {
    padding: 0.7rem;
}

/* Мобильная навигация и гамбургер меню */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    transition: all 0.3s ease;
}