:root {
    --clr-primary: #8C3B1A; /* Deep Terracotta */
    --clr-secondary: #D9A066; /* Golden Sand */
    --clr-accent: #2D4030; /* Forest Green */
    --clr-bg: #FDFBF7; /* Warm Cream */
    --clr-text: #2D2B2A; /* Off Black */
    --clr-text-muted: #6B6865;
    --clr-white: #FFFFFF;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-width: 1200px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .nav-logo {
    font-family: 'Playfair Display', serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Navigation --- */
.main-nav {
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clr-primary);
}

.nav-links a {
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--clr-primary);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-white);
    text-align: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* --- Recipe Grid --- */
.section {
    max-width: var(--container-width);
    margin: 4rem auto;
    padding: 0 20px;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid #E0DCD5;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--clr-primary);
    color: var(--clr-white);
    border-color: var(--clr-primary);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

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

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

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

.card-content {
    padding: 1.5rem;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--clr-primary);
    letter-spacing: 0.1em;
    font-weight: 700;
}

.card-title {
    font-size: 1.4rem;
    margin: 0.5rem 0;
}

/* --- Recipe Detail Page --- */
.recipe-detail {
    max-width: 900px;
    margin: 0 auto;
}

.detail-header {
    height: 50vh;
    border-radius: 20px;
    margin: 2rem 20px;
    background-size: cover;
    background-position: center;
}

.detail-body {
    padding: 2rem 20px;
}

.meta-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid #EEE;
    border-bottom: 1px solid #EEE;
}

.meta-item b {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--clr-text-muted);
}

.ingredients-section, .instructions-section {
    margin-bottom: 3rem;
}

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

.ingredients-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #F5F5F5;
}

.steps-list {
    counter-reset: step;
}

.step-item {
    position: relative;
    padding-left: 4rem;
    margin-bottom: 2rem;
}

.step-item::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -5px;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--clr-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

/* --- Admin --- */
.admin-container {
    max-width: var(--container-width);
    margin: 2rem auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.admin-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #EEE;
}

.admin-table th {
    background: #FAFAFA;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary { background: var(--clr-primary); color: white; }
.btn-secondary { background: var(--clr-secondary); color: white; }
.btn-danger { background: #E74C3C; color: white; }

/* --- Forms --- */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #DDD;
    border-radius: 8px;
    font-family: inherit;
}

/* --- Loader --- */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clr-secondary);
    border-radius: 50%;
    border-top-color: var(--clr-primary);
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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