/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1500;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

header .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1600;
}

.logo a{
    text-decoration: none;
    color: #ff6b6b;
}

nav { margin-left: auto; }
nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 22px;
}

nav ul li { margin: 0; }

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #ff6b6b;
}

/* Link underline animation */
nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: #ff6b6b;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}
/* Neutralize .nav-btn style in header */
header nav .nav-btn {
    background: transparent;
    color: #333 !important;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
header nav .nav-btn:hover,
header nav .nav-btn.active {
    background: rgba(0,0,0,0.06);
    color: #ff6b6b !important;
}
nav ul li a:hover::after,
nav ul li a.active::after {
    transform: scaleX(1);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1490645935967-10de6ba17061?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 140px 0 80px;
    margin-top: 60px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

button, .btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover, .btn:hover {
    background-color: #ff5252;
}

.form-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.form-wrapper h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #ff6b6b;
    outline: none;
}

.form-toggle {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-toggle a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: #f5f5f5;
    text-align: center;
}

.features h2 {
    margin-bottom: 50px;
    font-size: 2rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-10px);
}

.feature i {
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.feature h3 {
    margin-bottom: 15px;
    color: #333;
}

.feature p {
    color: #666;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-left .logo {
    color: #fff;
    font-size: 22px;
}

.footer-left p {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #ccc;
}

.footer-center h4,
.footer-right h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f5f5f5;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-btn {
    background-color: #ff6b6b;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.25s ease, transform 0.1s ease;
}

.footer-btn:hover {
    background-color: #ff5252;
    transform: translateY(-1px);
}

.footer-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    footer .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
}

/* Generic info modal (About / Nutrition) */
.info-modal {
    display: none;
    position: fixed;
    z-index: 2100;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    overflow-y: auto;
}

.info-modal-content {
    background-color: #fff;
    margin: 60px auto;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 540px;
    position: relative;
}

.info-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.info-modal-close:hover {
    color: #333;
}

.info-modal-content h2 {
    margin-bottom: 6px;
    color: #222;
    font-size: 1.5rem;
    font-weight: 600;
}

.info-modal-content p {
    margin-bottom: 10px;
    color: #555;
    font-size: 0.96rem;
}

.nutrition-list {
    list-style: none;
    padding: 0;
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.nutrition-list li {
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    font-size: 0.94rem;
}

.nutrition-list strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ff6b6b;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: row;
        align-items: center;
    }

    nav ul {
        margin-top: 10px;
    }

    nav ul li {
        margin-left: 10px;
    }

    .hero {
        padding: 110px 0 60px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .container {
        width: 100%;
        padding: 0 15px;
    }

    .form-container {
        padding: 20px;
        margin: 0 10px;
    }

    .recipe-card img {
        height: 160px;
    }
    .nav-btn, nav ul li a.btn {
        padding: 8px 14px;
    }
}

/* Responsive Navigation Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    z-index: 1600;
    right: 25px;
}

/* Mobile dropdown animation */
@media (max-width: 768px) {
    .nav-toggle { display: block; margin-left: auto; }
    nav { margin-left: 0; position: static; width: 100%; }
    nav ul {
        position: fixed;
        inset: 0;
        background: #fff;
        padding: 80px 20px 20px;
        display: block;
        overflow-y: auto;
        border-radius: 0;
        box-shadow: none;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: opacity 220ms ease, transform 220ms ease;
        z-index: 1100;
    }
    header.open nav ul {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    nav ul li a {
        display: block;
        padding: 14px 8px;
        border-radius: 10px;
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        color: #333;
    }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        padding: 10px 0;
    }
    header.open nav ul {
        display: flex;
    }
}

/* Add these new styles to your existing CSS file */

/* Nav Buttons */
nav ul li:last-child {
    margin-left: 15px;
}

nav ul li a.btn {
    background-color: #ff6b6b;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    transition: background-color 0.3s;
}

nav ul li a.btn:hover {
    background-color: #ff5252;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

/* Add these styles to your existing style.css */

/* Welcome Section */
.welcome {
    padding: 100px 0;
    text-align: center;
    background-color: #f5f5f5;
    margin-top: 60px;
}

.welcome h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.welcome p {
    font-size: 1.2rem;
    color: #666;
}

/* Recommendations Section */
.recommendations {
    padding: 80px 0;
}

.recommendations h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
    color: #333;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.recipe-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.recipe-card:hover {
    transform: translateY(-10px);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-card h3 {
    padding: 15px 20px 5px;
    color: #333;
}

.recipe-card p {
    padding: 0 20px 20px;
    color: #666;
}

/* ===== NEW PAGES STYLES ===== */

/* Registration and Login Pages */
.preferences-form, .login-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.preference-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.preference-item:hover {
    background-color: #f5f5f5;
    border-color: #ff6b6b;
}

.preference-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.preference-item label {
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.preference-description {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.cta-button {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #ff5252;
}

.error-messages {
    margin-bottom: 20px;
}

.error-messages p {
    color: red;
    background: #ffe6e6;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

/* Preference Selection Page */
.preferences-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.preference-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.preference-item:hover {
    border-color: #ff6b6b;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.preference-item input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.preference-item label {
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.cta-button {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #ff5252;
}

.error-message {
    color: red;
    background: #ffe6e6;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}