/* Современный дизайн калькулятора для аквариума - улучшенная версия */
:root {
    /* Основные цвета - морская тема */
    --primary-gradient: linear-gradient(135deg, #0066cc 0%, #00b4d8 100%);
    --secondary-gradient: linear-gradient(135deg, #00b4d8 0%, #90e0ef 100%);
    --accent-color: #0077b6;
    --accent-light: #90e0ef;
    --success-gradient: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
    --warning-gradient: linear-gradient(135deg, #fdcb6e 0%, #ffeaa7 100%);
    --danger-gradient: linear-gradient(135deg, #e17055 0%, #fab1a0 100%);
    
    /* Текст */
    --text-primary: #1a365d;
    --text-secondary: #2d3748;
    --text-light: #718096;
    
    /* Фоны */
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-card: #ffffff;
    --bg-overlay: rgba(0, 180, 216, 0.05);
    
    /* Эффекты */
    --shadow-sm: 0 2px 4px rgba(0, 102, 204, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 102, 204, 0.1), 0 2px 4px -1px rgba(0, 102, 204, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 102, 204, 0.1), 0 4px 6px -2px rgba(0, 102, 204, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 102, 204, 0.1), 0 10px 10px -5px rgba(0, 102, 204, 0.04);
    
    /* Скругления */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Отступы */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    min-height: 100vh;
    padding: var(--spacing-sm);
    position: relative;
    overflow-x: hidden;
}

/* Анимации */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Фоновые элементы - волны и пузыри */
.wave-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.4;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%2300b4d8"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%2300b4d8"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%2300b4d8"/></svg>');
    background-size: 50% 100px;
    animation: wave 25s linear infinite;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.bubble {
    position: fixed;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.1);
    z-index: -1;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.bubble:nth-child(1) {
    width: 60px;
    height: 60px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 80px;
    height: 80px;
    bottom: 15%;
    right: 7%;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 50%;
    left: 10%;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 50px;
    height: 50px;
    bottom: 30%;
    right: 15%;
    animation-delay: 3s;
}

/* Основной контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Шапка */
.header {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    color: white;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00b4d8, #90e0ef, #00b4d8);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo i {
    font-size: 2rem;
    color: white;
}

.header-text {
    flex: 1;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .tagline {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

.protection-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Основной контент */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Карточки */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 180, 216, 0.1);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }

/* Заголовки секций */
.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(0, 180, 216, 0.1);
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--secondary-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.25rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-lg);
}

/* Параметры - идеальные значения */
.ideal-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.ideal-param-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border: 1px solid rgba(0, 180, 216, 0.1);
    transition: all 0.2s ease;
}

.ideal-param-card:hover {
    background: var(--bg-overlay);
    transform: translateX(4px);
}

.ideal-param-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
}

.ideal-param-info h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.ideal-param-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Текущие параметры */
.current-params {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.current-param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 180, 216, 0.1);
}

.current-param:last-child {
    border-bottom: none;
}

.param-name {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.param-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: var(--spacing-xs);
}

.status-indicator.good {
    background: var(--success-gradient);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
}

.status-indicator.warning {
    background: var(--warning-gradient);
    box-shadow: 0 0 0 3px rgba(253, 203, 110, 0.2);
}

.status-indicator.danger {
    background: var(--danger-gradient);
    box-shadow: 0 0 0 3px rgba(225, 112, 85, 0.2);
}

/* Форма калькулятора */
.calculator-form {
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-label i {
    color: var(--accent-color);
    width: 20px;
}

.input-with-unit {
    position: relative;
}

.input-with-unit input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid rgba(0, 180, 216, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-with-unit input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1);
}

.input-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-weight: 500;
    pointer-events: none;
    background: white;
    padding: 0 4px;
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300b4d8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 44px;
    cursor: pointer;
}

/* Кнопка расчета */
.calculate-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    margin-top: var(--spacing-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Результаты */
.results {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border: 2px solid var(--accent-light);
    display: none;
    animation: fadeIn 0.5s ease;
}

.results.show {
    display: block;
}

.results-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.results-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--secondary-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.25rem;
}

.results h3 {
    font-size: 1.375rem;
    color: var(--text-primary);
    font-weight: 700;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.result-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border: 1px solid rgba(0, 180, 216, 0.1);
    transition: all 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--secondary-gradient);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

.dosage-instructions {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border-left: 4px solid var(--accent-color);
}

.dosage-instructions h4 {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.dosage-instructions ul {
    padding-left: var(--spacing-md);
    color: var(--text-secondary);
}

.dosage-instructions li {
    margin-bottom: var(--spacing-xs);
}

/* Примечания */
.note {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    background: rgba(0, 180, 216, 0.05);
    border: 1px solid rgba(0, 180, 216, 0.2);
}

.note.warning {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.note p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.note-icon {
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.note .note-icon {
    color: var(--accent-color);
}

.note.warning .note-icon {
    color: #fdcb6e;
}

/* Футер */
.footer {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.footer-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-xs);
}

.copyright-notice {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.footer-protection {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Мобильные стили */
@media (max-width: 640px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-md: 1rem;
    }
    
    body {
        padding: var(--spacing-xs);
    }
    
    .header {
        padding: var(--spacing-md);
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .protection-badge {
        margin-top: var(--spacing-xs);
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .ideal-params-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .footer {
        padding: var(--spacing-md);
    }
}

/* Планшетные стили */
@media (min-width: 641px) and (max-width: 1023px) {
    .header h1 {
        font-size: 1.625rem;
    }
    
    .ideal-params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Анимации для мобильных устройств */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e2e8f0;
        --text-secondary: #cbd5e0;
        --text-light: #a0aec0;
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --bg-card: #2d3748;
        --bg-overlay: rgba(0, 180, 216, 0.1);
    }
    
    body {
        background: linear-gradient(135deg, #1a365d 0%, #2d3748 50%, #1a365d 100%);
    }
    
    .card {
        border: 1px solid rgba(0, 180, 216, 0.2);
    }
    
    .input-with-unit input,
    .form-select {
        background: #4a5568;
        border-color: rgba(0, 180, 216, 0.3);
        color: var(--text-primary);
    }
    
    .input-unit {
        background: #4a5568;
    }
    
    .ideal-param-card,
    .current-params,
    .results {
        background: #4a5568;
    }
    
    .result-card,
    .dosage-instructions {
        background: #4a5568;
        border-color: rgba(0, 180, 216, 0.2);
    }
}