/* Основные стили */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Карточки */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Кнопки */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 12px 30px;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #219653;
    border-color: #219653;
    transform: translateY(-2px);
}

/* Навигация */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Таблицы */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: var(--light-bg);
    border: none;
    font-weight: 600;
}

.table td {
    border-color: #dee2e6;
    vertical-align: middle;
}

/* Формы */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
}

/* Статусы заказов */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.status-expired {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Кастомные классы */
.exchange-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
}

.rate-change {
    font-size: 0.9rem;
}

.rate-up {
    color: var(--success-color);
}

.rate-down {
    color: var(--danger-color);
}

/* Подвал */
footer {
    margin-top: auto;
}


/* Таблица обмена */
.exchange-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.exchange-table table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.exchange-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.exchange-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.exchange-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.exchange-table tbody tr {
    transition: all 0.3s ease;
}

.exchange-table tbody tr:hover {
    background-color: #f8f9ff;
    transform: translateY(-2px);
}

.exchange-table tbody td {
    padding: 20px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.exchange-table tbody tr:last-child td {
    border-bottom: none;
}

/* Карточки криптовалют */
.crypto-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    background: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.crypto-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.crypto-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.crypto-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
    color: white;
}

.btc-bg { background: linear-gradient(135deg, #F7931A 0%, #F9AA4B 100%); }
.eth-bg { background: linear-gradient(135deg, #627EEA 0%, #8FA3F9 100%); }
.usdt-bg { background: linear-gradient(135deg, #26A17B 0%, #4AC2A7 100%); }
.bnb-bg { background: linear-gradient(135deg, #F0B90B 0%, #F8D12F 100%); }
.xrp-bg { background: linear-gradient(135deg, #23292F 0%, #3A4149 100%); }
.ada-bg { background: linear-gradient(135deg, #0033AD 0%, #2D5BFF 100%); }
.doge-bg { background: linear-gradient(135deg, #C2A633 0%, #E6CE6B 100%); }
.sol-bg { background: linear-gradient(135deg, #00FFA3 0%, #03E1FF 100%); }
.dot-bg { background: linear-gradient(135deg, #E6007A 0%, #FF4DA6 100%); }
.matic-bg { background: linear-gradient(135deg, #8247E5 0%, #A67CFF 100%); }

.crypto-info {
    flex-grow: 1;
}

.crypto-symbol {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 3px;
}

.crypto-name {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.crypto-rate {
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 600;
}

/* Виджет обмена */
.exchange-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.exchange-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.exchange-widget h3 {
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.exchange-widget .form-control {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.exchange-widget .form-control:focus {
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.exchange-widget .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1rem;
    margin-bottom: 20px;
}

.exchange-arrow {
    text-align: center;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.exchange-arrow i {
    background: white;
    color: #667eea;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.exchange-arrow i:hover {
    transform: rotate(180deg) scale(1.1);
}

/* Результат расчета */
.calculation-result {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: #666;
    font-size: 0.95rem;
}

.result-value {
    font-weight: 600;
    font-size: 1.05rem;
}

.result-total {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.result-total .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-total .result-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Адаптивность таблицы */
@media (max-width: 768px) {
    .exchange-table {
        margin-bottom: 20px;
    }
    
    .exchange-table thead th {
        padding: 15px 10px;
        font-size: 0.8rem;
    }
    
    .exchange-table tbody td {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .crypto-card {
        padding: 12px;
    }
    
    .crypto-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .exchange-widget {
        padding: 25px;
    }
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Индикатор загрузки */
.loading-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стили для кнопки "Выбрать" */
.select-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

.select-btn.selected {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}