:root {
    --gold-primary: #ffd700;
    --gold-secondary: #ffb000;
    --gold-dark: #cc9900;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --border-color: rgba(255, 215, 0, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Loading Screen */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top: 3px solid var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 35px;
    width: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-logo:hover .logo-img {
    transform: scale(1.1);
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
}

/* Calculator Section */
.calculator-section {
    min-height: 100vh;
    padding: 120px 0 50px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    position: relative;
}

.calculator-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 176, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.calculator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.calculator-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* Calculator Container */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-step.active {
    display: block;
}

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

.form-step h2 {
    color: var(--gold-primary);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    -moz-appearance: textfield; /* Firefox */
}

/* Hide spin buttons in Chrome, Safari, Edge */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.form-group .unit {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    color: var(--text-gray);
    pointer-events: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    color: var(--text-light);
}

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

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.8rem;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--gold-primary);
    background: var(--gold-primary);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Activity Cards */
.activity-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.activity-card {
    position: relative;
    cursor: pointer;
}

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

.activity-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.activity-card input[type="radio"]:checked ~ .activity-content {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold-primary);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.activity-content h3 {
    color: var(--gold-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.activity-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.activity-content ul {
    list-style: none;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.activity-content li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.activity-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--gold-primary);
}

/* Goal Cards */
.goal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.goal-card {
    position: relative;
    cursor: pointer;
}

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

.goal-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.3s ease;
    text-align: center;
}

.goal-card input[type="radio"]:checked ~ .goal-content {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold-primary);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.goal-content h3 {
    color: var(--gold-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.goal-content p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.deficit {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.2rem;
}

.maintain {
    color: var(--gold-primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.surplus {
    color: #51cf66;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.form-navigation button:only-child {
    margin-left: auto;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-next,
.btn-calculate {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    color: var(--bg-dark);
}

.btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    color: var(--bg-dark);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

/* Results */
.results-container {
    animation: fadeIn 0.5s ease;
}

.results-container h2 {
    text-align: center;
    color: var(--gold-primary);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
}

.main-result {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 176, 0, 0.1));
    border-color: var(--gold-primary);
}

.result-card h3 {
    color: var(--text-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.calorie-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.calorie-value span:first-child {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calorie-value.secondary span:first-child {
    font-size: 2rem;
}

.calorie-value .unit {
    color: var(--text-gray);
    font-size: 1rem;
}

/* Macro Breakdown */
.macro-breakdown {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.macro-breakdown h3 {
    color: var(--gold-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
}

.macro-item h4 {
    color: var(--text-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.macro-item p {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--gold-primary);
    margin-bottom: 0.25rem;
}

.macro-percent {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--text-gray);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--gold-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .calculator-section {
        padding: 140px 0 50px;
    }

    .calculator-container {
        padding: 2rem 1.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }

    .goal-options {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column;
    }

    .form-navigation button {
        width: 100%;
    }

    .calorie-value span:first-child {
        font-size: 2.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .calculator-section {
        padding: 150px 0 50px;
    }

    .calculator-header h1 {
        font-size: 1.8rem;
    }

    .calculator-container {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }

    .form-step h2 {
        font-size: 1.5rem;
    }

    .activity-content,
    .goal-content {
        padding: 1rem;
    }

    .macro-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}