:root {
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --bg-color: #F3F4F6;
    --text-main: #1F2937;
    --text-muted: #4B5563;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-md);
}

.header-icon {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

main {
    flex: 1;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.instructions {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.camera-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 100px;
    padding: 1.25rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    justify-content: center;
}

.primary-btn:hover,
.primary-btn:active {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.4), 0 10px 10px -5px rgba(59, 130, 246, 0.1);
}

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background-color: #E2E8F0;
    color: var(--text-main);
    border: none;
    border-radius: 100px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover,
.secondary-btn:active {
    background-color: #CBD5E1;
}

.hidden {
    display: none !important;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

#imagePreviewContainer {
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}

#imagePreview {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    object-fit: contain;
    max-height: 40vh;
}

#loadingIndicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin: 3rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

#loadingIndicator p {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.05rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#resultContainer {
    padding: 1.75rem;
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultContainer h2 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
}

.result-text p {
    margin-bottom: 1rem;
}

.result-text p:last-child {
    margin-bottom: 0;
}

.result-text strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.result-text ul {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.result-text li {
    margin-bottom: 0.25rem;
}

/* Profile Section */
.profile-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.weight-control {
    margin-bottom: 1rem;
}

.weight-control label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#weightValue {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

input[type=range] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #E2E8F0;
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -8px;
    box-shadow: var(--shadow-md);
}

.protein-budget {
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.protein-budget span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.protein-budget strong {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.protein-budget small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Traffic Light Cards */
.traffic-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 6px solid #ccc;
    box-shadow: var(--shadow-sm);
}

.traffic-card.green {
    border-left-color: #22c55e;
}

.traffic-card.green .traffic-header h3 {
    color: #166534;
}

.traffic-card.yellow {
    border-left-color: #eab308;
}

.traffic-card.yellow .traffic-header h3 {
    color: #854d0e;
}

.traffic-card.red {
    border-left-color: #ef4444;
}

.traffic-card.red .traffic-header h3 {
    color: #991b1b;
}

.traffic-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.traffic-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.traffic-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.green .traffic-indicator {
    background-color: #22c55e;
}

.yellow .traffic-indicator {
    background-color: #eab308;
}

.red .traffic-indicator {
    background-color: #ef4444;
}

.traffic-body p {
    margin: 0;
    font-size: 0.95rem;
}

.traffic-warning {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #ef4444;
    font-size: 0.9rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.fazit-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    font-style: italic;
}