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

:root {
    --primary-color: #d4a574;
    --secondary-color: #8b4513;
    --text-color: #333;
    --light-bg: #f9f7f4;
    --white: #fff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

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

/* Navigation */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-auth-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.nav-auth-btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.nav-auth-btn-primary:hover {
    background-color: #6e320d;
}

.nav-auth-btn-secondary {
    background-color: rgba(139, 69, 19, 0.08);
    color: var(--secondary-color);
}

.nav-auth-btn-secondary:hover {
    background-color: rgba(139, 69, 19, 0.16);
}

.auth-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 14px;
    border-radius: 999px;
    background-color: rgba(139, 69, 19, 0.08);
}

.auth-user-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.auth-user-name {
    font-weight: 700;
    color: var(--secondary-color);
}

.auth-user-email {
    color: #7a6d62;
    font-size: 12px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 80px 0;
    background: linear-gradient(135deg, var(--light-bg) 0%, #f5efe8 100%);
}

.hero-content h1 {
    font-size: 48px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.cta-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.cta-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}

.hero-image {
    text-align: center;
}

.hero-image i {
    font-size: 200px;
    color: var(--primary-color);
    opacity: 0.8;
}

/* Search Section */
.search-section {
    padding: 40px 0;
    background-color: var(--white);
}

.search-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
    font-size: 28px;
}

.search-bar {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-size: 16px;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.search-bar button {
    padding: 15px 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.search-bar button:hover {
    background-color: var(--secondary-color);
}

/* Categories */
.categories {
    padding: 60px 0;
}

.categories h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
    font-size: 28px;
}

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

.category-card {
    background-color: var(--white);
    padding: 30px 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background-color: var(--primary-color);
    color: var(--white);
}

.category-card i {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.category-card:hover i {
    color: var(--white);
}

.category-card h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Recipes Section */
.recipes-section {
    padding: 60px 0;
}

.recipes-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
    font-size: 28px;
}

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

.recipe-card {
    background-color: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recipe-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--white);
    overflow: hidden;
    position: relative;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.1);
}

.recipe-content {
    padding: 20px;
}

.recipe-category {
    display: inline-block;
    background-color: var(--light-bg);
    color: var(--secondary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.recipe-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.recipe-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-bg);
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.recipe-btn:hover {
    background-color: var(--secondary-color);
}

.recipe-btn i {
    margin-right: 5px;
}

/* Features Section */
.features {
    padding: 60px 0;
    background-color: var(--white);
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
    font-size: 28px;
}

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

.feature-card {
    text-align: center;
    padding: 30px;
}

.feature-card i {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 20px;
}

.feature-card p {
    color: #666;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* Modal */
.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-y: auto;
}

.modal-content {
    background-color: var(--white);
    margin: 20px auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary-color);
}

.auth-modal-content {
    max-width: 560px;
}

.auth-modal-header {
    margin-bottom: 20px;
}

.auth-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-modal-header h2 {
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.auth-modal-header p:last-child {
    color: #6e655d;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-tab {
    border: 1px solid rgba(139, 69, 19, 0.15);
    background-color: #f5efe8;
    color: #72563d;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background-color: var(--secondary-color);
    color: var(--white);
}

.auth-feedback {
    display: none;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.auth-feedback-success {
    background-color: rgba(39, 174, 96, 0.12);
    color: #1f7a47;
}

.auth-feedback-error {
    background-color: rgba(231, 76, 60, 0.12);
    color: #b13b2f;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 8px;
}

.recipe-detail {
    animation: slideIn 0.3s ease;
}

.recipe-detail h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 32px;
}

.recipe-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 10px;
}

.recipe-detail-meta-item {
    text-align: center;
}

.recipe-detail-meta-item strong {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.recipe-ing, .recipe-steps {
    margin-bottom: 30px;
}

.recipe-ing h3, .recipe-steps h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

.recipe-ing ul {
    list-style-position: inside;
    padding-left: 20px;
}

.recipe-ing li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.recipe-steps ol {
    padding-left: 20px;
}

.recipe-steps li {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* ============== SPECIAL FEATURES STYLES ============== */

/* Favorite Button */
.recipe-image {
    position: relative;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.favorite-btn:hover {
    background-color: #fff;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #e74c3c;
}

/* Rating Stars */
.rating-display {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.rating-stars {
    display: flex;
    gap: 3px;
}

.rating-star {
    font-size: 18px;
    transition: all 0.2s ease;
}

.rating-star:hover {
    transform: scale(1.2);
}

.rating-summary {
    color: var(--secondary-color);
    font-size: 14px;
    font-weight: 600;
}

.recipe-detail-rating {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 10px;
}

.recipe-detail-rating h3 {
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 20px;
}

/* Advanced Search Button */
.advanced-search-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
    transition: var(--transition);
}

.advanced-search-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Advanced Search Form */
.advanced-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(212, 165, 116, 0.3);
}

/* Collections */
.collection-btn {
    background-color: var(--light-bg);
    border: 2px solid var(--primary-color);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.collection-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: bottom 0.3s ease;
    z-index: 2000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    bottom: 30px;
}

.toast-success {
    background-color: #27ae60;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-info {
    background-color: #3498db;
}

/* Modal Styles for Collections */
#collectionsModal .modal-content {
    background-color: var(--white);
}

#collectionsModal h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .advanced-search-btn {
        padding: 8px 12px;
        font-size: 12px;
        margin-left: 5px;
    }

    .search-bar {
        flex-wrap: wrap;
        gap: 5px;
    }

    .recipe-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}

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

#videoContainer {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

#videoContainer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 40px 0;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--white);
        padding: 20px;
        gap: 0;
        border-bottom: 1px solid var(--light-bg);
    }

    .nav-auth {
        display: none;
    }

    .nav-menu.active + .nav-auth {
        display: flex;
        position: absolute;
        top: 245px;
        left: 20px;
        right: 20px;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--white);
        padding: 0 20px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 16px 16px;
    }

    .auth-user-card {
        border-radius: 18px;
        justify-content: space-between;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid var(--light-bg);
    }

    .hamburger {
        display: flex;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .hero-image i {
        font-size: 120px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 24px;
    }

    .search-bar {
        flex-direction: column;
    }

    .auth-tabs {
        grid-template-columns: 1fr;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
    }

    .recipe-detail-meta {
        grid-template-columns: 1fr;
    }
}
