:root {
    --color-primary: #e67e22;
    /* Modern Orange */
    --color-secondary: #2c3e50;
    /* Deep Teak */
    --color-accent: #f1c40f;
    /* Gold */
    --color-bg: #0f1418;
    /* Dark Mode */
    --color-surface: #1a2026;
    --color-text: #ecf0f1;
    --color-text-muted: #bdc3c7;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --batik-pattern: url('https://www.transparenttextures.com/patterns/batik.png');
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--color-bg);
    background-image: var(--batik-pattern);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    color: var(--color-accent);
}

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

/* Header & Nav */
header {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(241, 196, 15, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #fff;
}

.logo span {
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(to bottom, rgba(15, 20, 24, 0) 0%, rgba(15, 20, 24, 1) 100%),
        url('https://images.unsplash.com/photo-1596797038558-45e07662c14c?auto=format&fit=crop&q=80&w=2000') center/cover;
    position: relative;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--color-text-muted);
}

/* Recipe Grid & Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 6rem;
}

.recipe-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.recipe-image {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.recipe-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-primary);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.recipe-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.recipe-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.recipe-description {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-recipe-btn {
    margin-top: auto;
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.view-recipe-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Recipe Detail View (Modal or Page) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--color-surface);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    padding: 3rem;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.recipe-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
}

.recipe-header-img {
    width: 400px;
    height: 300px;
    border-radius: 8px;
    object-fit: cover;
}

.recipe-title-area {
    flex: 1;
}

.ingredients-list,
.instructions-list {
    margin-top: 1rem;
}

.ingredient-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
}

.instruction-step {
    margin-bottom: 1.5rem;
}

.instruction-step h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Buy Ingredient UI */
.buy-ingredient {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(241, 196, 15, 0.05);
    border: 1px dashed var(--color-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ingredient-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.buy-info {
    flex: 1;
}

.buy-info strong {
    display: block;
    font-size: 1.1rem;
    color: var(--color-accent);
}

.buy-btn {
    background: var(--color-accent);
    color: var(--color-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .recipe-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .recipe-header-img {
        width: 100%;
    }
}