@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    min-height: 100vh;
    padding: 0 10px;
    line-height: 1.6;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    display: flex;
    flex-direction: column;
    max-width: 728px;
    margin: auto;
    background: #fff;
}

/* ============================================
   CALCULATOR WRAPPER
   ============================================ */
.calculator {
    padding: 20px 10px;
    order: 1;
}

.calculator-header {
    font-weight: 600;
    font-size: 24px;
    margin-bottom: 14px;
    text-align: center;
}

.form-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   GENDER SELECTION
   ============================================ */
.gender-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gender-group.invalid {
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 8px;
    background: rgba(220, 53, 69, 0.05);
}

.gender-option {
    position: relative;
}

.gender-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.gender-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 56px;
}

.gender-option input[type="radio"]:checked + label {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.02);
}

/* ============================================
   SLIDERS
   ============================================ */
.slider-group {
    margin-bottom: 25px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
}

.slider-value {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.slider-container {
    position: relative;
    margin: 16px 0;
    padding: 10px 0;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    position: relative;
    pointer-events: none;
}

.slider:focus {
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.slider::-moz-range-thumb {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    pointer-events: auto;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    background: #667eea;
    border-radius: 4px;
    transform: translateY(-50%);
    transition: width 0.2s ease;
    pointer-events: none;
}

/* ============================================
   SELECT INPUTS
   ============================================ */
.select-input {
    width: 100%;
    padding: 16px 40px 16px 8px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.select-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.select-input:disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
    opacity: 0.7;
}

/* ============================================
   DRINKS SECTION
   ============================================ */
.drinks-section {
    background: #f8f9fa;
    border-radius: 16px;
    margin-bottom: 20px;
}

.drink-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.drink-item:last-child {
    margin-bottom: 16px;
}

.drink-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.drink-controls .slider-group {
    margin-bottom: 0;
}

.remove-btn {
    width: 48px;
    height: 48px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:active {
    transform: scale(0.95);
    background: #c82333;
}

.add-drink-btn {
    width: 100%;
    padding: 16px;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
}

.add-drink-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
}

.add-drink-btn:active {
    transform: scale(0.98);
    background: #dee2e6;
    border-color: #ced4da;
}

/* ============================================
   FORM NOTES & DISCLAIMER
   ============================================ */
.form-note,
.calc-disclaimer {
    font-size: 13px;
    text-align: center;
    margin-bottom: 28px;
}

.form-note a {
    color: #b40000;
}

.form-note a:hover {
    text-decoration: none;
}

/* ============================================
   CALCULATE BUTTON
   ============================================ */
.calculate-btn {
    width: 240px;
    margin: 20px auto 32px auto;
    display: block;
    padding: 18px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    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: left 0.5s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(255, 107, 107, 0.5);
}

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

.calculate-btn:active {
    transform: translateY(0px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

/* ============================================
   VALIDATION STATES
   ============================================ */
.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    display: none;
}

.invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* ============================================
   CALCULATING STATE
   ============================================ */
.hidden {
    display: none;
}

.calculating {
    pointer-events: none;
    opacity: 0.7;
}

.calculating .calculate-btn {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================
   MEDIA QUERIES
   ============================================ */
@media (max-width: 600px) {
    .calculate-btn {
        width: 100%;
    }

    .gender-group {
        gap: 8px;
    }

    .slider::-webkit-slider-thumb {
        width: 36px;
        height: 36px;
    }

    .slider::-moz-range-thumb {
        width: 36px;
        height: 36px;
    }
}