/* ============================================ */
/* 1. CSS Reset & Base Setup */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth color transitions for all elements */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Disable transitions during theme switch */
.no-transitions * {
    transition: none !important;
    animation-duration: 0s !important;
}

/* ============================================ */
/* 2. CSS Custom Properties (Variables) */
/* ============================================ */
:root {
    /* Default Light Mode Colors */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-muted: #999999;
    --border-light: #E5E5E5;
    --border-medium: #E5E5E5;
    --accent-primary: #B8860B;
    --accent-wine: #B8860B;
    --accent-secondary: #8B7355;
    --shadow-sm: rgba(0, 0, 0, 0.04);
    --shadow-md: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);

    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --card-bg: var(--bg-secondary);
    --card-border: var(--border-light);
    --muted: var(--text-muted);
    
    /* Border Radius Scale */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Spacing Scale (follows 8px grid) */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 5rem;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 4rem;
}

/* Dark Mode Color Overrides */
[data-theme="dark"] {
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-elevated: #1A1A1A;
    --text-primary: #FAFAFA;
    --text-secondary: #A8A8A8;
    --text-tertiary: #707070;
    --text-muted: #606060;
    --border-light: #2A2A2A;
    --border-medium: #333333;
    --accent-primary: #D4AF37;
    --accent-wine: #D4AF37;
    --accent-secondary: #A0906B;
    --shadow-sm: rgba(0, 0, 0, 0.2);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);
    
    /* Variables from styles.css - merged */
    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --card-bg: var(--bg-elevated);
    --card-border: var(--border-medium);
    --muted: var(--text-muted);
}

/* Auto Dark Mode Detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0A0A0A;
        --bg-secondary: #141414;
        --bg-elevated: #1A1A1A;
        --text-primary: #E5E5E5;
        --text-secondary: #A0A0A0;
        --text-tertiary: #707070;
        --text-muted: #707070;
        --border-light: #2A2A2A;
        --border-medium: #2A2A2A;
        --accent-wine: #D4AF37;
        --shadow-sm: rgba(0, 0, 0, 0.2);
        --shadow-md: rgba(0, 0, 0, 0.4);
        --shadow-lg: rgba(0, 0, 0, 0.6);
        
        /* Variables from styles.css - merged */
        --bg: var(--bg-primary);
        --text: var(--text-primary);
        --card-bg: var(--bg-elevated);
        --card-border: var(--border-medium);
        --muted: var(--text-muted);
    }
}

/* ============================================ */
/* 3. Base Document Styles */
/* ============================================ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--accent-primary);
    color: white;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ============================================ */
/* 4. Layout Components */
/* ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4xl) var(--space-xl);
}

/* ============================================ */
/* 5. Header Styles */
/* ============================================ */
.header {
    text-align: center;
    padding: 0 0 var(--space-3xl) 0;
    margin-bottom: var(--space-3xl);
    border-bottom: 1px solid var(--border-light);
}

.header-content h1 {
    font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
    font-weight: 200;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-base);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.4;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px var(--shadow-md);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px) rotate(180deg);
    box-shadow: 0 6px 16px var(--shadow-lg);
}

.theme-icon {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
/* Menu Toggle Button */
.menu-toggle {
    position: fixed;
    top: var(--space-xl);
    left: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px var(--shadow-md);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1001;
}

.menu-toggle:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--shadow-lg);
}

/* Hamburger Icon */
.menu-icon {
    width: 22px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-line {
    display: block;
    height: 1.5px;
    width: 100%;
    background: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animated X when menu is open */
.menu-open .menu-toggle .menu-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-open .menu-toggle .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-open .menu-toggle .menu-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Navigation Menu Overlay */
.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Navigation Menu Content */
.nav-menu-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4xl) var(--space-xl);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav-menu-header {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-3xl);
}

.nav-menu-label {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Navigation Menu Items */
.nav-menu-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-menu-item {
    display: flex;
    align-items: center;
    padding: var(--space-xl) 0;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-30px);
}

/* Stagger animation for menu items */
.nav-menu.active .nav-menu-item {
    opacity: 1;
    transform: translateX(0);
}

.nav-menu.active .nav-menu-item:nth-child(1) { transition-delay: 0.1s; }
.nav-menu.active .nav-menu-item:nth-child(2) { transition-delay: 0.15s; }
.nav-menu.active .nav-menu-item:nth-child(3) { transition-delay: 0.2s; }
.nav-menu.active .nav-menu-item:nth-child(4) { transition-delay: 0.25s; }
.nav-menu.active .nav-menu-item:nth-child(5) { transition-delay: 0.3s; }
.nav-menu.active .nav-menu-item:nth-child(6) { transition-delay: 0.35s; }

/* Hover line effect */
.nav-menu-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-menu-item:hover::before,
.nav-menu-item.active::before {
    transform: scaleX(1);
}

.nav-menu-item:hover {
    padding-left: var(--space-md);
}

.nav-menu-number {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    margin-right: var(--space-2xl);
    letter-spacing: 0.05em;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.nav-menu-text {
    flex: 1;
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
    font-weight: 200;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-menu-item:hover .nav-menu-text {
    color: var(--accent-primary);
    letter-spacing: 0.08em;
}

.nav-menu-item.active .nav-menu-text {
    color: var(--accent-primary);
}

.nav-menu-arrow {
    font-size: var(--text-2xl);
    color: var(--accent-primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-menu-item:hover .nav-menu-arrow,
.nav-menu-item.active .nav-menu-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Navigation Footer */
.nav-menu-footer {
    padding-top: var(--space-3xl);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: 0.4s;
}

.nav-menu.active .nav-menu-footer {
    opacity: 1;
    transform: translateY(0);
}

.nav-menu-footer p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
}

/* Blur background when menu is open */
.menu-open .container > *:not(.nav-menu):not(.menu-toggle) {
    filter: blur(5px);
    transition: filter 0.5s ease;
}

/* Prevent scroll when menu is open */
.menu-open {
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        width: 44px;
        height: 44px;
        top: var(--space-md);
        left: var(--space-md);
    }
    
    .nav-menu-content {
        padding: var(--space-3xl) var(--space-lg);
    }
    
    .nav-menu-text {
        font-size: var(--text-xl);
    }
    
    .nav-menu-number {
        margin-right: var(--space-lg);
    }
    
    .nav-menu-item {
        padding: var(--space-lg) 0;
    }
}

/* Keyboard focus styles */
.nav-menu-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-menu,
    .nav-menu-item,
    .nav-menu-footer {
        transition: none !important;
    }
}
/* ============================================
   REFINED SEARCH & FILTER SECTION
   ============================================ */

.section {
    margin-bottom: var(--space-3xl);
}

.filter-section {
    margin-bottom: var(--space-4xl);
}

/* Search and Filter Container */
.search-and-filter-container {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    margin-bottom: var(--space-xl);
}

.search-container {
    flex: 1;
    position: relative;
    max-width: 100rem;
}

.search-input {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    padding-right: 3rem; /* Make room for clear button */
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px var(--shadow-sm);
}

/* Hide browser's default clear button */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.search-input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 300;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 2px 8px var(--shadow-md);
    transform: translateY(-1px);
}
/* Mobile responsive search */
@media (max-width: 768px) {
    .search-input {
        font-size: var(--text-sm); /* Smaller text on mobile */
        /* padding: var(--space-md) var(--space-lg); */
        padding-right: 2.5rem;
    }
    
    .search-input::placeholder {
        font-size: var(--text-sm);
        font-weight: 300;
    }
    
    .search-clear-btn {
        right: var(--space-sm);
        padding: var(--space-xs);
    }
}

@media (max-width: 480px) {
    .search-input {
        font-size: var(--text-sm);
        /* padding: var(--space-sm) var(--space-md); */
        padding-right: 2.5rem;
    }
    
    .search-input::placeholder {
        font-size: var(--text-sm);
    }
    
    .search-clear-btn {
        right: 8px;
    }
}
/* Search Clear Button */
.search-clear-btn {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* Filter Toggle - Desktop Optimized */
.filter-toggle-container {
    flex-shrink: 0;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--space-lg); /* Match search input height */
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 52px; /* Match search input */
}

.filter-toggle-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-md);
}

.filter-icon {
    color: var(--accent-primary);
}

.filter-count {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.filter-toggle-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-and-filter-container {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .filter-toggle-container {
        width: 100%;
        text-align: center;
    }
    
    .filter-toggle-btn {
        width: 100%;
        justify-content: center;
        min-height: auto;
        padding: var(--space-md) var(--space-lg);
    }
    
    .filter-btn-text {
        display: inline; /* Show text on mobile */
    }
}

@media (min-width: 769px) {
    .filter-btn-text {
        display: inline; /* Show text on desktop too */
    }
}

/* Compact version for smaller desktop screens */
@media (max-width: 1024px) and (min-width: 769px) {
    .filter-btn-text {
        display: none; /* Hide text, show only icon and count */
    }
    
    .filter-toggle-btn {
        padding: var(--space-lg) var(--space-md);
    }
}

/* Refined Tag Filters */
.tag-filters-container {
    text-align: center;
}

.tag-filters {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    max-width: 100%;
}

.tag {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-primary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.tag:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.tag.active {
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.tag.active::before {
    transform: scaleY(1);
}

/* ============================================
   REFINED RECIPE GRID WITH PROPER HOVER STATES
   ============================================ */

.guides-grid {
    display: grid;
    gap: var(--space-2xl);
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.recipe-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px var(--shadow-sm);
}

.recipe-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-lg);
}

.recipe-card-content {
    padding: var(--space-2xl);
    position: relative;
    z-index: 1;
}

.recipe-card-header {
    margin-bottom: var(--space-lg);
}

.recipe-card-title {
    font-size: var(--text-xl);
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: var(--space-sm);
    transition: color 0.3s ease;
}

.recipe-card:hover .recipe-card-title {
    color: var(--accent-primary);
}

.recipe-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.cuisine-tag {
    color: var(--accent-primary);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tag-divider {
    color: var(--text-tertiary);
    opacity: 0.4;
    font-size: var(--text-xs);
}

.tags-list {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    font-weight: 400;
}

.recipe-card-preview {
    margin-top: var(--space-md);
}

.preview-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.preview-text {
    color: var(--text-primary); /* Stronger contrast than secondary */
    font-size: var(--text-sm);
    line-height: 1.4;
    font-weight: 400; /* Slightly heavier than 300 */
    letter-spacing: 0.01em; /* Improve readability */
}

.preview-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.ingredient-tag {
    background: rgba(184, 134, 11, 0.1);
    color: var(--accent-primary);
    padding: 3px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(184, 134, 11, 0.2);
    padding: 0 var(--space-sm);
}

@media (max-width: 768px) {
    .ingredient-tag {
        font-size: 10px;
        padding: 2px var(--space-xs);
    }
}

/* No Results - Enhanced */
.no-results-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-4xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.no-results-text {
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin: var(--space-md) 0 var(--space-xs);
    font-weight: 300;
}

.no-results-hint {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 300;
}

/* ============================================
   REFINED FULL RECIPE PAGE - SINGLE SURFACE
   ============================================ */

.recipe-detail-view {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    padding: var(--space-md) 0;
    margin-bottom: var(--space-3xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover {
    color: var(--accent-primary);
    transform: translateX(-4px);
}

.back-btn svg {
    width: 16px;
    height: 16px;
}

/* Single Surface Recipe Container */
.recipe-full {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-3xl);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px var(--shadow-sm);
}

/* Recipe Header - More refined */
.recipe-header {
    text-align: center;
    padding-bottom: var(--space-3xl);
    margin-bottom: var(--space-3xl);
    border-bottom: 1px solid var(--border-light);
}

.recipe-title-full {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
    font-weight: 200;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    line-height: 1.2;
}

.recipe-meta-full {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.meta-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 500;
}

.meta-value {
    font-size: var(--text-sm);
    color: var(--accent-primary);
    font-weight: 400;
}

.meta-divider {
    color: var(--border-light);
    font-size: var(--text-xs);
}

/* Recipe Content - Unified Sections */
.recipe-content {
    display: grid;
    gap: var(--space-3xl);
}

.recipe-section {
    position: relative;
}

.recipe-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-3xl) / 2);
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--border-light);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 600;
}

/* Progress Indicators - More refined */
.progress-indicator {
    margin-bottom: var(--space-xl);
    text-align: center;
    background: var(--bg-primary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.progress-text {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    max-width: 300px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    width: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Streamlined Ingredients & Instructions */
.ingredients-list,
.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.ingredient-item,
.instruction-step {
    margin-bottom: var(--space-sm);
    transition: opacity 0.3s ease;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
    padding: var(--space-md) 0;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: left;
    min-height: 48px; /* Adequate touch target */
}

.checkbox-label:hover {
    background: rgba(184, 134, 11, 0.03);
    border-bottom-color: rgba(184, 134, 11, 0.1);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    margin-top: 2px;
    background: transparent;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid var(--accent-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-label input:checked ~ .checkbox-custom {
    border-color: var(--accent-primary);
    background: rgba(184, 134, 11, 0.1);
}

.checkbox-label input:checked ~ .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

/* Simplified Step Numbers */
.step-number {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 28px;
    text-align: center;
    margin-top: 2px;
}

.checkbox-label input:checked ~ .step-number {
    color: var(--text-tertiary);
}

/* Clean Text Content */
.ingredient-text,
.step-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 400;
    font-size: var(--text-base);
    transition: all 0.3s ease;
}

.ingredient-quantity {
    color: var(--accent-primary);
    font-weight: 600;
}

.step-time {
    display: inline-block;
    background: rgba(184, 134, 11, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 500;
    margin-left: var(--space-sm);
}

.checkbox-label input:checked ~ .ingredient-text,
.checkbox-label input:checked ~ .step-text {
    color: var(--text-tertiary);
    text-decoration: line-through;
    opacity: 0.6;
}

/* Simplified Notes */
.notes-section {
    background: rgba(184, 134, 11, 0.03);
    border: 1px solid rgba(184, 134, 11, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    position: relative;
}

.notes-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.notes-content {
    max-width: 100%;
}

.note-line {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
    font-weight: 400;
    font-style: italic;
    margin-bottom: var(--space-md);
    text-align: left;
    border-left: 3px solid var(--accent-primary);
    padding-left: var(--space-md);
}

.note-line:last-child {
    margin-bottom: 0;
}

.note-bullet {
    display: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .recipe-full {
        padding: var(--space-xl);
    }
    
    .checkbox-label {
        gap: var(--space-sm);
        padding: var(--space-sm) 0;
        min-height: 44px;
    }
    
    .checkbox-custom {
        width: 18px;
        height: 18px;
        margin-top: 3px;
    }
    
    .checkbox-custom::after {
        top: 1px;
        left: 4px;
        width: 5px;
        height: 8px;
    }
    
    .step-number {
        font-size: var(--text-xs);
        min-width: 24px;
    }
    
    .ingredient-text,
    .step-text {
        font-size: var(--text-sm);
        line-height: 1.4;
    }
    
    .notes-section {
        padding: var(--space-lg);
    }
    
    .note-line {
        font-size: var(--text-sm);
        margin-bottom: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .recipe-full {
        padding: var(--space-lg);
    }
    
    .checkbox-label {
        padding: var(--space-xs) 0;
    }
    
    .ingredient-text,
    .step-text {
        font-size: var(--text-sm);
    }
    
    .step-time {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Highlight measurements */
.ingredient-quantity {
    color: var(--accent-primary);
    font-weight: 500;
}
.step-time {
    display: inline-block;
    background: rgba(184, 134, 11, 0.1);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    margin-left: var(--space-sm);
}

.checkbox-label input:checked ~ .ingredient-text,
.checkbox-label input:checked ~ .step-text {
    color: var(--text-tertiary);
    text-decoration: line-through;
    opacity: 0.6;
}

/* Completion Message */
.completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-elevated);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    box-shadow: 0 10px 40px var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.completion-message.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.completion-content svg {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.completion-content h3 {
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-weight: 300;
}

.completion-content p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 300;
}

/* ============================================ */
/* 9. Footer */
/* ============================================ */
.footer {
    text-align: center;
    margin-top: var(--space-4xl);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 300;
}

/* ============================================ */
/* 10. Responsive Design */
/* ============================================ */
@media (max-width: 768px) {
    .container {
        padding: var(--space-3xl) var(--space-lg);
    }
    
    .guides-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .recipe-full {
        padding: var(--space-2xl);
    }
    
    .search-container {
        width: 100%;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
        top: var(--space-md);
        right: var(--space-md);
    }
    
    .recipe-card-content {
        padding: var(--space-lg);
    }
    
    .ingredients-list,
    .instructions-list {
        max-width: 100%;
    }
    
    .checkbox-label {
        gap: var(--space-md);
    }
    .recipe-meta-full {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
        text-align: center;
        margin-bottom: var(--space-md);
    }
}

@media (max-width: 480px) {
    .tag-filters {
        gap: var(--space-xs);
    }
    
    .tag {
        padding: var(--space-xs) var(--space-md);
    }
    
    .recipe-meta-full {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }
}

.fade-in {
    opacity: 1;
}
/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px var(--shadow-md);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-lg);
}

.back-to-top-icon {
    color: var(--text-primary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover .back-to-top-icon {
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Mobile positioning adjustments */
@media (max-width: 768px) {
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: var(--space-md);
        right: var(--space-md);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 0.3s ease;
    }
}
/* Notes Section */
.notes-section {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.03) 0%, rgba(184, 134, 11, 0.01) 100%);
    border: 1px solid rgba(184, 134, 11, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-2xl);
    position: relative;
}

.notes-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.notes-content {
    max-width: 600px;
    margin: 0 auto;
}

.note-line {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
    font-weight: 300;
    font-style: italic;
    margin-bottom: var(--space-md);
}

.note-line:last-child {
    margin-bottom: 0;
}

.note-bullet {
    color: var(--accent-primary);
    font-weight: 500;
    flex-shrink: 0;
    margin-top: 2px;
}
.recipe-card-quick-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: rgba(184, 134, 11, 0.05);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
}

.quick-info-compact {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.quick-info-divider {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .recipe-card-quick-info {
        font-size: 11px;
        padding: var(--space-xs) var(--space-sm);
    }
}
/* Filter Panel */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-lg);
}

.filter-panel.expanded {
    max-height: 600px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px var(--shadow-sm);
}

.filter-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-xl);
}

.filter-category {
    min-height: 60px;
}

.filter-category-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.filter-pill {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px var(--space-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.filter-pill:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white !important; /* Force white text */
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(184, 134, 11, 0.3);
}

/* Remove the ::before pseudo-element approach entirely */
.filter-pill::before {
    display: none;
}

.filter-actions {
    padding: var(--space-md) var(--space-xl) var(--space-xl);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.clear-filters-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-tertiary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
/* Touch feedback for mobile */
.recipe-card {
    -webkit-tap-highlight-color: rgba(184, 134, 11, 0.1);
    touch-action: manipulation;
}

.recipe-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s ease;
}

/* Swipe hint on mobile */
@media (max-width: 768px) {
    .recipe-card::after {
        content: '';
        position: absolute;
        right: var(--space-md);
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid var(--accent-primary);
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
        opacity: 0.3;
        transition: opacity 0.3s ease;
    }
    
    .recipe-card:hover::after {
        opacity: 0.6;
    }
}
.difficulty-indicator {
    display: flex;
    gap: 2px;
    margin-top: var(--space-xs);
}

.difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-light);
}

.difficulty-dot.active {
    background: var(--accent-primary);
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.recipe-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.recipe-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl);
    text-align: center;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state svg {
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.error-state h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-weight: 300;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.retry-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.recipe-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.recipe-card.visible {
    opacity: 1;
    transform: translateY(0);
}