:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.1);
    --radius: 8px;
    --max-width: 1200px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.tagline {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Search */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background: #c0392b;
}

/* Category Navigation */
.category-nav {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 130px;
    z-index: 90;
}

.category-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.category-chip:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.category-chip.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 300px);
}

/* Hero Banner */
.hero-banner {
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recipe-card a {
    text-decoration: none;
    color: inherit;
}

.recipe-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-light);
}

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

.recipe-time {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.recipe-info {
    padding: 1rem;
}

.recipe-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Star Rating */
.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stars {
    display: inline-block;
    position: relative;
    font-size: 1rem;
    line-height: 1;
}

.stars::before {
    content: "★★★★★";
    color: #ddd;
}

.stars::after {
    content: "★★★★★";
    color: #ffc107;
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--rating) * 20%);
    overflow: hidden;
}

.rating-text {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 3rem;
}

.site-footer p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Recipe Page Styles */
.recipe-header {
    background: var(--bg-light);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.back-button:hover {
    color: var(--secondary-color);
}

.recipe-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Stats Row */
.recipe-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.stat-icon {
    width: 24px;
    height: 24px;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* 3-Column Layout */
.recipe-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.recipe-column {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.column-icon {
    width: 22px;
    height: 22px;
    color: var(--secondary-color);
    flex-shrink: 0;
}

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

.recipe-list-item {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.25rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.recipe-list-item::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0.5rem;
    color: var(--secondary-color);
    font-weight: bold;
}

.recipe-list.checkable .recipe-list-item {
    cursor: pointer;
    transition: opacity 0.2s, color 0.2s;
}

.recipe-list.checkable .recipe-list-item:hover {
    color: var(--secondary-color);
}

.recipe-list.checkable .recipe-list-item.completed {
    opacity: 0.45;
    text-decoration: line-through;
}

.recipe-list.checkable .recipe-list-item.completed::before {
    content: "✓";
    color: #27ae60;
}

.recipe-actions {
    text-align: center;
    margin-bottom: 2rem;
}

.control-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.control-button:hover {
    background: var(--bg-light);
    border-color: var(--secondary-color);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .site-header {
        top: 0;
    }

    .category-nav {
        top: 120px;
    }

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

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

    .recipe-header h1 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .category-nav,
    .site-footer,
    .back-button,
    .recipe-actions,
    .search-container {
        display: none !important;
    }

    .recipe-header {
        padding: 0;
        border: none;
        background: white;
    }

    .recipe-columns {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .recipe-column {
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    .recipe-list.checkable .recipe-list-item.completed {
        opacity: 1;
        text-decoration: none;
    }

    body {
        font-size: 11pt;
        line-height: 1.4;
    }

    .container {
        max-width: 100%;
    }
}
