/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --text: #e9ecef;
    --light: #f8f9fa;
    --dark: #121212;
    --dark-card: #1e1e1e;
    --dark-section: #252525;
    --success: #38b000;
    --warning: #ff9914;
    --danger: #d90429;
    --slider-color: #4361ee;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    width: 100%;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.header {
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out forwards;
}

.header h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent);
}

.header p {
    opacity: 0.9;
    font-size: 18px;
    color: #ffffff;
}

.intro-text {
    max-width: 900px;
    margin: 0 auto 40px auto;
    line-height: 1.7;
    font-size: 16px;
    padding: 0 20px;
    text-align: left;
    color: #ffffff;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
    will-change: transform, opacity;
}

.intro-text h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--accent);
}

.intro-text p {
    margin-bottom: 15px;
    color: #e9ecef;
}

.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 992px) {
    .content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

.calculator-section {
    padding: 20px;
    border-radius: 15px;
    background: var(--dark-card);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
    opacity: 0;
    will-change: transform, opacity;
}

/* New slider styling */

.slider-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.btn-control {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--dark-section);
    border: 2px solid var(--primary);
    color: var(--text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control:hover {
    background-color: var(--primary);
    transform: scale(1.05);
}

.btn-control:active {
    transform: scale(0.95);
}




.slider-container {
    margin-bottom: 24px;
}

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

.slider-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--slider-color) 0%, var(--slider-color) 50%, #555 50%, #555 100%);
    border-radius: 5px;
    outline: none;
    margin: 10px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--slider-color);
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--slider-color);
}

.ticks-container {
    position: relative;
    width: 100%;
    height: 10px;
    display: flex;
    justify-content: space-between;
}

.ticks-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(
        to right,
        #555,
        #555 1px,
        transparent 1px,
        transparent 10%
    );
}

.slider-value {
    display: flex;
    justify-content: flex-end;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.slider-value span {
    margin-left: 5px;
    color: var(--accent);
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #333;
    border-radius: 12px;
    background-color: var(--dark-section);
    font-size: 16px;
    transition: all 0.3s;
    color: #ffffff;
}

select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #ffffff;
}

.btn-calculate {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    transition: all 0.3s;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-calculate:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.35);
}

.recommendation {
    margin-top: 25px;
    background: rgba(67, 97, 238, 0.1);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.5s;
}

.recommendation .title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendation .message {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
}

.bmi-info {
    margin-top: 15px;
    font-size: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    color: #e9ecef;
}

.bmi-info span {
    font-weight: 600;
    color: var(--accent);
}

.results-section {
    padding: 20px;
    background: var(--dark-card);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.4s;
    opacity: 0;
    will-change: transform, opacity;
}

.results-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.results-cards {
    display: grid;
    gap: 15px;
}

.calorie-card {
    background: var(--dark-section);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: slideInRight 0.6s ease-out forwards;
}

.calorie-card:nth-child(1) {
    animation-delay: 0.5s;
}

.calorie-card:nth-child(2) {
    animation-delay: 0.6s;
}

.calorie-card:nth-child(3) {
    animation-delay: 0.7s;
}

.calorie-card:nth-child(4) {
    animation-delay: 0.8s;
}

.calorie-card:nth-child(5) {
    animation-delay: 0.9s;
}

.calorie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.calorie-card .title {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calorie-card .calories {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
    color: var(--accent);
}

.calorie-card .subtitle {
    font-size: 14px;
    color: #e9ecef;
}

.maintain {
    border-left: 4px solid var(--primary);
}

.lose {
    border-left: 4px solid var(--accent);
}

.lose-fast {
    border-left: 4px solid var(--danger);
}

.gain {
    border-left: 4px solid var(--success);
}

.gain-fast {
    border-left: 4px solid var(--warning);
}

/* Added styles for improved mobile experience */
@media (max-width: 768px) {

    .slider-controls {
        flex-wrap: wrap;
    }

    .btn-control {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .header {
        padding: 20px 15px;
    }
    
    .header h2 {
        font-size: 26px;
    }
    
    .calculator-section, .results-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .calorie-card {
        padding: 15px;
    }
    
    .calorie-card .calories {
        font-size: 26px;
    }
    
    .slider-value {
        font-size: 20px;
    }
    
    .intro-text {
        text-align: left;
        padding: 0 15px;
    }
}