/* БАЗОВЫЕ СТИЛИ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}
.header-section {
    text-align: center;
    margin-bottom: 25px;
}
h1 {
    color: #1F4788;
    margin-bottom: 8px;
    font-size: 28px;
}
.subtitle {
    color: #555;
    font-size: 0.95em;
}

/* КУРС ВАЛЮТ */
.currency-bar {
    background: linear-gradient(135deg, #1F4788 0%, #2a5ca8 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d9423e;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.pulse {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ПАНЕЛЬ УПРАВЛЕНИЯ - ИДЕАЛЬНАЯ СИММЕТРИЯ */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

@media (min-width: 768px) {
    .controls {
        flex-direction: row;
    }
}

.search-wrapper, .btn-download {
    flex: 1;
    height: 50px;
    width: 100%;
    box-sizing: border-box;
}

/* СТРОКА ПОИСКА */
.search-wrapper {
    position: relative;
}
#searchInput {
    width: 100%;
    height: 100%;
    padding: 0 15px 0 45px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
    transition: border-color 0.2s;
}
#searchInput:focus {
    border-color: #1F4788;
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.1);
}
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 20px;
    height: 20px;
}

/* КНОПКА СКАЧИВАНИЯ */
.btn-download {
    background-color: #f0f4f8;
    color: #1F4788;
    border: 1px solid #1F4788;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-download:hover {
    background-color: #1F4788;
    color: white;
}
.btn-download svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    fill: currentColor;
    display: block;
}

/* ТАБЛИЦА */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    table-layout: fixed; 
}
th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eaedf0;
    font-size: 14px;
    word-wrap: break-word;
}
th {
    background-color: #1F4788;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}
th:nth-child(1) { width: 5%; } 
th:nth-child(2) { width: 14%; }
th:nth-child(3) { width: 17%; }
th:nth-child(4) { width: 15%; }
th:nth-child(5) { width: 15%; }
th:nth-child(6) { width: 17%; }
th:nth-child(7) { width: 17%; }

tr:nth-child(even) { background-color: #fcfcfc; }
tr:hover { background-color: #f1f4f8; }

.price-col {
    text-align: right;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 600;
    font-size: 14.5px;
    white-space: nowrap; 
}
.rub { color: #d9423e; }
.usd { color: #238636; }
.brand-col { font-weight: 700; color: #1F4788; }

/* ПЕЧАТЬ И PDF */
@media print {
    body { background-color: #fff; padding: 0; margin: 0; }
    .container { box-shadow: none; padding: 0; max-width: 100%; }
    .controls, .currency-bar { display: none !important; }
    th { background-color: #1F4788 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    tr:nth-child(even) { background-color: #f8f9fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table { border: 1px solid #ddd; table-layout: fixed; min-width: auto; }
    .price-col { font-size: 12px; }
    @page { size: A4 portrait; margin: 1cm; }
    tr { page-break-inside: avoid; }
}
