:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5253;
    --secondary: #4ecdc4;
    --accent: #feca57;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --font-sans: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

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

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(100px);
}

/* Header */
header {
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 120px auto 100px;
    padding: 0 20px;
}

/* Hero Section / Upload */
.upload-section {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 2rem;
    background: var(--glass);
    border: 2px dashed var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 3rem;
    position: relative;
}

.upload-section.drag-over {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
    transform: scale(1.02);
}

.upload-section:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.upload-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

#file-input {
    display: none;
}

/* Analysis State */
.analysis-overlay {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--glass-border);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

/* Results Grid */
.results-container {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.results-container.visible {
    display: grid;
    opacity: 1;
    transform: translateY(0);
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.recipe-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-8px);
}

.recipe-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 1rem;
    margin-bottom: 1.2rem;
}

.recipe-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.recipe-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.calorie-tag {
    background: rgba(255, 107, 107, 0.15);
    color: var(--primary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Details Panel */
.details-panel {
    display: none;
    margin-top: 3rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 3rem;
    animation: slideUp 0.6s ease forwards;
}

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

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .grid-2col { grid-template-columns: 1fr; }
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ingredient-list {
    list-style: none;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.price {
    font-weight: 700;
    color: var(--secondary);
}

.comparison-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1.5rem;
    padding: 2rem;
}

.compare-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 1rem;
}

.home-made { background: rgba(78, 205, 196, 0.1); border: 1px solid var(--secondary); }
.delivery { background: rgba(255, 107, 107, 0.1); border: 1px solid var(--primary); }

.buy-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--secondary);
    color: var(--bg-dark);
    border: none;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.buy-btn:hover {
    background: #5fe4d9;
    transform: translateY(-3px);
}

.total-calories {
    margin-top: 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--accent);
}
