/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFD166;
    --dark: #1A535C;
    --light: #F7FFF7;
    --gray: #E6E6E6;
    --text: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --container-padding: 2rem;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.header.scrolled {
    padding: 0.8rem 5%;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.98);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.logo span {
    font-style: italic;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    margin-top: 70px;
    background: linear-gradient(135deg, rgba(26, 83, 92, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%),
                radial-gradient(circle at 10% 20%, rgba(255, 209, 102, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 20%);
    background-blend-mode: overlay;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Food Selection */
.food-selection {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: var(--container-padding);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 900px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideIn 0.8s ease;
}

.food-selection h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    text-align: center;
    font-weight: 600;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}

.category-card {
    background: white;
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: rotate(45deg);
    transition: var(--transition);
    opacity: 0;
}

.category-card:hover::before {
    transform: rotate(45deg) translate(30%, 30%);
    opacity: 1;
}

.category-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff5f5, #f0fff4);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.25);
}

.category-card:hover:not(.selected) {
    transform: translateY(-3px);
    border-color: var(--secondary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.category-card i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--primary);
    transition: var(--transition);
}

.category-card:hover i,
.category-card.selected i {
    color: var(--dark);
    transform: scale(1.1);
}

.category-card span {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
}

.category-card:hover span,
.category-card.selected span {
    color: var(--dark);
    font-weight: 600;
}

/* Other Options */
.other-options {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(254, 243, 243, 0.4);
    border-radius: var(--border-radius);
}

.other-options label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: 1rem;
}

#preferences {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    background: white;
    transition: var(--transition);
    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 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

#preferences:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    justify-content: center;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    padding: 4rem 5%;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
}

.recipe-container {
    background: white;
    border-radius: var(--border-radius);
    padding: var(--container-padding);
    box-shadow: var(--shadow);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.placeholder-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder-message i {
    font-size: 4rem;
    color: var(--gray);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.recipe-result {
    display: none;
}

.recipe-result.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.recipe-result h3 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray);
}

.recipe-result .ingredients,
.recipe-result .instructions {
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.recipe-result .ingredients h4,
.recipe-result .instructions h4 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-result ul {
    list-style: none;
    padding-left: 0;
}

.recipe-result li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px dashed var(--gray);
    padding-bottom: 0.8rem;
}

.recipe-result li:last-child {
    border-bottom: none;
}

.recipe-result li::before {
    content: '•';
    color: var(--secondary);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-size: 1.2rem;
}

.recipe-result ol {
    padding-left: 1.5rem;
    counter-reset: item;
}

.recipe-result ol li {
    padding-left: 0.5rem;
    counter-increment: item;
    position: relative;
    border-bottom: 1px dashed var(--gray);
    padding-bottom: 0.8rem;
}

.recipe-result ol li:last-child {
    border-bottom: none;
}

.recipe-result ol li::before {
    content: counter(item);
    position: absolute;
    left: -1.5rem;
    top: 0;
    background: var(--secondary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-light);
    font-weight: 500;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    background: #fdeded;
    border-radius: var(--border-radius);
    border: 1px solid #fecaca;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.error-message i {
    font-size: 2.5rem;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2.5rem 5%;
    margin-top: 3rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

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

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

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

.category-card {
    animation: fadeInUp 0.5s ease forwards;
}

.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.2s; }
.category-card:nth-child(4) { animation-delay: 0.3s; }
.category-card:nth-child(5) { animation-delay: 0.4s; }
.category-card:nth-child(6) { animation-delay: 0.5s; }

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Gen Z Aesthetics */
.gen-z-accent {
    position: relative;
}

.gen-z-accent::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    border-radius: 10px;
}