/* ========================================
AQUACALC — СТИЛИ
======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Consolas", "Courier New", monospace;
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    color: #F0F9FF;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ========================================
HEADER
======================================== */
header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    font-size: 2.5em;
    text-shadow: 0 3px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #FFFFFF;
}

.site-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
}

.subtitle {
    color: #BAE6FD;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 0;
}

/* ========================================
LANGUAGE SWITCHER - ОБЩИЙ
======================================== */
.language-switcher {
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: rgba(21, 94, 117, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 5px;
    padding: 5px 12px;
    color: #7DD3FC;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: "Consolas", "Courier New", monospace;
}

.lang-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22D3EE;
}

.lang-btn.active {
    background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
    color: #082F49;
    border-color: #22D3EE;
}

/* ========================================
ПЕРЕКЛЮЧАТЕЛЬ ВНУТРИ КАРТОЧКИ
======================================== */
.card {
    position: relative; /* Важно для позиционирования! */
}

.card-lang {
    position: absolute;
    top: 15px;
    right: 15px;
    margin: 0;
}

.card h2 {
    color: #22D3EE;
    margin-bottom: 15px;
    padding-bottom: 8px;
    padding-right: 100px; /* Место для переключателя */
    border-bottom: 1px solid rgba(34, 211, 238, 0.3);
    font-size: 1.15em;
}

/* ========================================
КАРТОЧКИ
======================================== */
.card {
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.98) 0%, rgba(8, 47, 73, 0.98) 100%);
    padding: 15px 18px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ========================================
СЕТКИ
======================================== */
.input-grid, .salts-grid, .results-grid, .ion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.input-group, .salt-group {
    display: flex;
    flex-direction: column;
}

.input-group label, .salt-group label {
    color: #7DD3FC;
    margin-bottom: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

/* ========================================
ПОЛЯ ВВОДА
======================================== */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-unit input {
    flex: 1;
    background: rgba(21, 94, 117, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 5px;
    padding: 6px 8px;
    color: #67E8F9;
    font-size: 0.9em;
    font-family: "Consolas", "Courier New", monospace;
    min-width: 50px;
    height: 32px;
}

.input-with-unit input:focus {
    outline: none;
    border-color: #22D3EE;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.4);
}

.unit-inline {
    color: #7DD3FC;
    font-size: 0.8em;
    white-space: nowrap;
    min-width: 30px;
    font-family: "Consolas", "Courier New", monospace;
}

/* ========================================
ВЫБОР ПРЕПАРАТОВ
======================================== */
.salt-group select {
    background: rgba(21, 94, 117, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 5px;
    padding: 6px 8px;
    color: #67E8F9;
    font-size: 0.85em;
    cursor: pointer;
    height: 32px;
    font-family: "Consolas", "Courier New", monospace;
}

.salt-group select:focus {
    outline: none;
    border-color: #22D3EE;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.4);
}

/* ========================================
РЕЗУЛЬТАТЫ
======================================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.result-item {
    background: linear-gradient(135deg, rgba(21, 94, 117, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    color: #E0F2FE;
    font-weight: 600;
    font-size: 0.9em;
}

.result-value {
    color: #67E8F9;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.1em;
    font-weight: bold;
}

/* ========================================
ИОННЫЙ СОСТАВ
======================================== */
.ion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.ion-item {
    background: rgba(21, 94, 117, 0.6);
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.ion-name {
    color: #BAE6FD;
    font-weight: 600;
    font-size: 0.9em;
}

.ion-value {
    color: #67E8F9;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.95em;
}

/* ========================================
СВОДКА
======================================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.summary-card {
    background: linear-gradient(180deg, rgba(21, 94, 117, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid rgba(34, 211, 238, 0.4);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    border-color: rgba(34, 211, 238, 0.6);
}

.summary-label {
    color: #22D3EE;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-value {
    color: #67E8F9;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.5em;
    font-weight: bold;
}

.info-bar {
    background: rgba(8, 47, 73, 0.95);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    color: #7DD3FC;
    font-family: "Consolas", "Courier New", monospace;
    border: 1px solid rgba(34, 211, 238, 0.25);
}

/* ========================================
КНОПКИ
======================================== */
.actions-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 25px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Consolas", "Courier New", monospace;
    background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
    color: #082F49;
    min-width: 150px;        /* ← ДОБАВИТЬ - фиксированная ширина */
    text-align: center;      /* ← ДОБАВИТЬ - центрирование */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
    background: linear-gradient(135deg, #06B6D4 0%, #22D3EE 100%);
}

/* ========================================
FOOTER
======================================== */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
    color: rgba(255,255,255,0.7);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-family: "Consolas", "Courier New", monospace;
}

/* ========================================
МОДАЛЬНОЕ ОКНО
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background: linear-gradient(180deg, #0F3460 0%, #082F49 100%);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid rgba(34, 211, 238, 0.4);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    color: #F0F9FF;
    font-family: "Consolas", "Courier New", monospace;
}

.close {
    color: #7DD3FC;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #22D3EE;
}

.modal-body h3 {
    color: #22D3EE;
    margin: 20px 0 10px 0;
    border-bottom: 1px solid rgba(34, 211, 238, 0.3);
    padding-bottom: 8px;
}

.modal-body ul {
    margin-left: 20px;
    color: #BAE6FD;
}

.modal-body li {
    margin-bottom: 8px;
}

/* ========================================
ССЫЛКИ В МОДАЛЬНОМ ОКНЕ
======================================== */
.modal-body a, .license-text a {
    color: #22D3EE;
    text-decoration: none;
    border-bottom: 2px solid rgba(34, 211, 238, 0.5);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.modal-body a:hover, .license-text a:hover {
    color: #FFFFFF;
    background: rgba(34, 211, 238, 0.3);
    border-bottom-color: #22D3EE;
}

/* ========================================
УВЕДОМЛЕНИЯ
======================================== */
.disclaimer {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.15) 100%);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    padding: 15px 18px;
    margin: 15px 0 20px 0;
    color: #FCA5A5;
    font-size: 0.9em;
    line-height: 1.5;
    font-family: "Consolas", "Courier New", monospace;
}

.disclaimer p {
    margin-bottom: 10px;
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

.disclaimer strong {
    color: #F87171;
}

.disclaimer ul {
    margin-left: 20px;
    margin-top: 8px;
    color: #FCA5A5;
}

.disclaimer li {
    margin-bottom: 5px;
}

/* ========================================
ЛИЦЕНЗИЯ
======================================== */
.license-text {
    background: linear-gradient(135deg, rgba(21, 94, 117, 0.4) 0%, rgba(15, 52, 96, 0.4) 100%);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 8px;
    padding: 18px 20px;
    margin: 15px 0;
    font-size: 0.88em;
    line-height: 1.6;
    font-family: "Consolas", "Courier New", monospace;
}

.license-text .copyright-header {
    background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
    color: #082F49;
    padding: 10px 15px;
    border-radius: 6px;
    margin: -18px -20px 15px -20px;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.license-text .copyright-notice {
    background: rgba(34, 211, 238, 0.1);
    border-left: 3px solid #22D3EE;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0 6px 6px 0;
    color: #67E8F9;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.95em;
}

.license-text p {
    margin-bottom: 12px;
    color: #BAE6FD;
}

.license-text strong {
    color: #22D3EE;
    font-size: 1.05em;
}

.license-text ul {
    margin-left: 25px;
    margin-bottom: 15px;
    color: #7DD3FC;
    list-style-type: disc;
}

.license-text li {
    margin-bottom: 6px;
    padding-left: 5px;
    list-style-type: disc;
}

.license-text .warning-final {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 15px !important;
    color: #F87171;
    text-align: center;
    font-weight: bold;
}

/* ========================================
КОШЕЛЬКИ — КЛИКАБЕЛЬНЫЕ
======================================== */
.wallet-address {
    color: #67E8F9 !important;
    background: rgba(34, 211, 238, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px dashed rgba(34, 211, 238, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    word-break: break-all;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.85em;
}

.wallet-address:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22D3EE;
    color: #FFFFFF !important;
}

.wallet-address:active {
    transform: scale(0.98);
}

/* ========================================
АДАПТИВНОСТЬ (Mobile)
======================================== */
@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .input-grid, .salts-grid, .results-grid, .ion-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-section {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    header h1 {
        font-size: 1.8em;
        flex-direction: row;
        gap: 8px;
    }
    
    .site-logo {
        width: 35px;
        height: 35px;
    }
    
    .subtitle {
        font-size: 0.95em;
        padding: 0 10px;
    }
    
    .input-with-unit input {
        min-width: 50px;
    }
    
    .unit-inline {
        min-width: 30px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .card-lang {
        position: static;
        margin-top: 10px;
        margin-bottom: 15px;
    }
    
    .card h2 {
        padding-right: 0;
    }
}
/* ========================================
LANGUAGE SWITCHER
======================================== */
.language-switcher {
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: rgba(21, 94, 117, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 5px;
    padding: 5px 12px;
    color: #7DD3FC;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: "Consolas", "Courier New", monospace;
    min-width: 45px;        /* ← ФИКСИРОВАННАЯ ШИРИНА */
    text-align: center;     /* ← ЦЕНТРИРОВАНИЕ */
}

.lang-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22D3EE;
}

.lang-btn.active {
    background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
    color: #082F49;
    border-color: #22D3EE;
}

/* Переключатель внутри карточки */
.card {
    position: relative;
}

.card-lang {
    position: absolute;
    top: 15px;
    right: 15px;
    margin: 0;
    gap: 6px;
}

.card h2 {
    color: #22D3EE;
    margin-bottom: 15px;
    padding-bottom: 8px;
    padding-right: 100px;
    border-bottom: 1px solid rgba(34, 211, 238, 0.3);
    font-size: 1.15em;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .card-lang {
        position: absolute;  
        top: 12px;          
        right: 12px;        
        margin: 0;
    }
    
    .card h2 {
        padding-right: 80px; 
        font-size: 1em;
    }
}
