/* Bluelayer Recipe Collection - Elite Cyber-Terminal Brand Edition */
:root {
    --cyan: #16eeff;
    --cyan-glow: rgba(22, 238, 255, 0.45);
    --cyan-medium: rgba(22, 238, 255, 0.25);
    --cyan-soft: rgba(22, 238, 255, 0.08);
    --cyan-dim: rgba(22, 238, 255, 0.55);
    --bg: #020204;
    --bg-panel: #07090e;
    --bg-card: #0c0f17;
    --bg-hover: #121824;
    --text: #e2f5f8;
    --text-dim: #7794a0;
    --border: rgba(22, 238, 255, 0.18);
    --border-glow: rgba(22, 238, 255, 0.45);
    --radius: 4px;
    --nav-h: 3.5rem;
    --font: "Courier New", Courier, monospace;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.85), inset 0 0 15px rgba(22, 238, 255, 0.03);
    --shadow-glow: 0 0 12px rgba(22, 238, 255, 0.35);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan-dim) var(--bg-panel);
    background-color: var(--bg);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: calc(var(--nav-h) + 2rem) 1.5rem 5rem;
    min-height: 100vh;
    letter-spacing: 0.03em;
    position: relative;
}

/* System Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(22, 238, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 238, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    pointer-events: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); box-shadow: 0 0 8px var(--cyan); }

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.6rem 1.2rem;
    background: var(--cyan);
    color: var(--bg);
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}
.skip-link:focus { top: 0.75rem; outline: none; }

/* Navigation Bar */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(7, 9, 14, 0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.site-nav::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.7;
}

.site-nav .nav-brand {
    font-weight: bold;
    font-size: 1.15rem;
    color: var(--cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 8px var(--cyan-glow);
    transition: var(--transition);
}

.site-nav .nav-brand:hover {
    text-shadow: 0 0 15px var(--cyan);
    transform: scale(1.02);
}

.site-nav .nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Interactive elements */
.site-nav a,
.btn-load-more,
.btn-print,
.btn-share {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--cyan);
    background: var(--cyan-soft);
    border: 1px solid var(--border);
    padding: 0.45rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.site-nav a:hover,
.btn-load-more:hover,
.btn-print:hover,
.btn-share:hover {
    background: var(--cyan);
    color: var(--bg);
    border-color: var(--cyan);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Main Container Panel */
.recipe-book {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(7, 9, 14, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem 3rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.recipe-book::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

/* Tech indicator at top-right of container */
.recipe-book::after {
    content: '[SYS.STATUS: ONLINE]';
    position: absolute;
    top: 0.75rem; right: 1.5rem;
    font-size: 0.65rem;
    color: var(--cyan-dim);
    letter-spacing: 0.1em;
    font-weight: bold;
    opacity: 0.7;
}

.brand-header {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.brand-header h1 {
    font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    font-weight: bold;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.brand-header p {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Toolbar & Filters */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.toolbar input[type="search"],
.toolbar select {
    flex: 1 1 240px;
    min-width: 0;
    padding: 0.8rem 1.2rem;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(2, 2, 4, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.toolbar input[type="search"]::placeholder {
    color: rgba(119, 148, 160, 0.45);
}

.toolbar input:focus,
.toolbar select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(22, 238, 255, 0.25);
    background: rgba(2, 2, 4, 0.95);
}

.toolbar-meta {
    font-size: 0.85rem;
    color: var(--cyan-dim);
    font-weight: bold;
    letter-spacing: 0.05em;
}

.index-toolbar select {
    flex: 0 1 200px;
}

/* Stats panel */
.index-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    flex: 1 1 180px;
    max-width: 260px;
    text-align: left;
    padding: 1.5rem;
    background: rgba(12, 15, 23, 0.6);
    border: 1px solid var(--border);
    border-left: 3px solid var(--cyan);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::after {
    content: '// TELEMETRY';
    position: absolute;
    bottom: 0.5rem; right: 0.75rem;
    font-size: 0.55rem;
    font-weight: bold;
    color: var(--cyan-dim);
    opacity: 0.3;
}

.stat-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(22, 238, 255, 0.15);
    transform: translateY(-2px);
}

.stat-card .stat-value {
    display: block;
    font-size: 2.25rem;
    font-weight: bold;
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan-glow);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    font-weight: bold;
}

/* Category Grid on Index */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    list-style: none;
}

.category-card a {
    display: block;
    padding: 1.5rem;
    background: rgba(12, 15, 23, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.category-card a::before {
    content: '[ ]';
    color: var(--cyan-dim);
    margin-right: 0.5rem;
    font-weight: bold;
    transition: var(--transition);
}

.category-card a:hover {
    border-color: var(--cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(22, 238, 255, 0.2);
    background: var(--bg-hover);
}

.category-card a:hover::before {
    content: '[>]';
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan);
}

.category-card .cat-name {
    display: inline-block;
    font-weight: bold;
    color: var(--cyan);
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.category-card .cat-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Recipe Page Layout with Sticky Sidebar */
.layout-recipe {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.toc-panel {
    position: sticky;
    top: calc(var(--nav-h) + 1.5rem);
    max-height: calc(100vh - var(--nav-h) - 4rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toc-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.toc-section h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--cyan);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    font-weight: bold;
}

.toc-grid {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    font-size: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan-dim) transparent;
}

.toc-grid li { margin-bottom: 0.35rem; }

.toc-grid a {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 2px;
    line-height: 1.4;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-grid a:hover {
    background: var(--cyan-soft);
    color: var(--cyan);
    padding-left: 0.75rem;
}

.toc-total {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--cyan-dim);
    font-weight: bold;
}

/* Recipes Panel */
.recipes-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.recipes-container { min-height: 200px; }

/* Dynamic Recipe Cards */
.recipe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--cyan);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    transition: var(--transition);
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.recipe-card::after {
    content: '// DATA_DOCKET';
    position: absolute;
    top: 0.75rem; right: 1rem;
    font-size: 0.55rem;
    color: var(--cyan-dim);
    opacity: 0.25;
}

.recipe-card:hover {
    border-color: var(--cyan-medium);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75);
}

.recipe-card.highlighted-recipe {
    border-color: var(--cyan);
    border-left-width: 6px;
    box-shadow: 0 0 20px var(--cyan-glow);
    animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
    0% { background: var(--cyan-medium); }
    100% { background: var(--bg-card); }
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
}

.recipe-id { color: var(--cyan-dim); font-weight: bold; }

.recipe-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.recipe-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--cyan);
    line-height: 1.3;
    text-shadow: 0 0 4px var(--cyan-glow);
}

/* Card Control Panel (Servings & Share) */
.recipe-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(2, 2, 4, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.servings-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.servings-label {
    color: var(--text-dim);
    font-weight: bold;
}

.btn-servings {
    background: rgba(22, 238, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--cyan);
    width: 1.8rem;
    height: 1.8rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-servings:hover {
    background: var(--cyan);
    color: var(--bg);
    border-color: var(--cyan);
    box-shadow: 0 0 8px rgba(22, 238, 255, 0.5);
    transform: scale(1.05);
}

.servings-value {
    color: var(--cyan);
    font-weight: bold;
    min-width: 2.5rem;
    text-align: center;
}

.recipe-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--cyan-dim);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
    font-weight: bold;
}

/* Custom Interactive Ingredient Checklist */
.ingredients { margin-bottom: 2rem; }
.ingredients ul { list-style: none; }

.ingredient-item {
    position: relative;
    padding: 0.4rem 0.5rem 0.4rem 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.ingredient-item:hover {
    background: var(--cyan-soft);
}

.ingredient-item::before {
    content: '[ ]';
    position: absolute;
    left: 0.3rem;
    color: var(--cyan-dim);
    font-weight: bold;
    font-family: var(--font);
    transition: var(--transition);
}

.ingredient-item.completed {
    color: var(--text-dim);
    text-decoration: line-through rgba(22, 238, 255, 0.35);
    opacity: 0.5;
    background: rgba(22, 238, 255, 0.02);
}

.ingredient-item.completed::before {
    content: '[✓]';
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan);
}

/* Custom Interactive Direction Cooking Steps */
.directions ol {
    list-style: none;
    counter-reset: direction-counter;
}

.direction-step {
    position: relative;
    padding: 0.6rem 0.5rem 0.6rem 2.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.direction-step::before {
    counter-increment: direction-counter;
    content: counter(direction-counter) '.';
    position: absolute;
    left: 0.5rem;
    color: var(--cyan-dim);
    font-weight: bold;
}

.direction-step:hover {
    background: var(--cyan-soft);
}

/* Dimmed state when another step is active */
.recipe-card.step-active-mode .direction-step {
    opacity: 0.35;
}

/* Active Cooking Step styling */
.recipe-card .direction-step.active-step {
    opacity: 1 !important;
    background: rgba(22, 238, 255, 0.08);
    border-left: 3px solid var(--cyan);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: inset 4px 0 10px rgba(22, 238, 255, 0.05);
}

.recipe-card .direction-step.active-step::before {
    content: '>';
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan);
    animation: terminalBlink 0.8s infinite;
}

@keyframes terminalBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.recipe-source {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--border);
    font-size: 0.85rem;
    text-align: right;
}

.recipe-source a {
    color: var(--cyan-dim);
    text-decoration: none;
    transition: var(--transition);
}

.recipe-source a:hover {
    color: var(--cyan);
    text-decoration: underline;
}

/* Load More Area */
.load-more-wrap {
    text-align: center;
    padding: 2rem 0;
}

.btn-load-more {
    padding: 0.8rem 2.5rem;
    font-size: 0.95rem;
}

/* Skeletons & Shimmers */
.loading-state {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(22, 238, 255, 0.08) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.skeleton-title { height: 2rem; width: 60%; margin-bottom: 1rem; }
.skeleton-line { height: 1rem; width: 100%; margin-bottom: 0.5rem; }
.skeleton-line.short { width: 45%; }
.skeleton-card { height: 6rem; width: 100%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.error-state {
    padding: 1.25rem;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: var(--radius);
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* Floating Actions */
.back-to-top {
    position: fixed;
    bottom: 2rem; right: 2rem;
    z-index: 90;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--cyan);
    background: rgba(7, 9, 14, 0.9);
    color: var(--cyan);
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.back-to-top:hover {
    background: var(--cyan);
    color: var(--bg);
    transform: translateY(-4px);
    box-shadow: 0 0 15px var(--cyan);
}

/* Footer Section */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.8;
}

footer a {
    color: var(--cyan-dim);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--cyan);
    text-decoration: underline;
}

.affiliate-banner {
    margin: 2rem auto 0;
    padding: 1.25rem;
    text-align: center;
    border: 1px dotted var(--border);
    border-radius: var(--radius);
    background: rgba(7, 9, 14, 0.4);
    max-width: 500px;
}

.affiliate-banner a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

.affiliate-banner img {
    max-width: 100%;
    height: auto;
    border: 0;
    opacity: 0.75;
    transition: var(--transition);
}

.affiliate-banner img:hover {
    opacity: 1;
}

/* Responsive Rules */
@media (max-width: 900px) {
    .layout-recipe {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .toc-panel {
        position: static;
        max-height: 250px;
    }

    body { padding-top: calc(var(--nav-h) + 1.5rem); }
}

@media (max-width: 600px) {
    .recipe-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-share {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .site-nav,
    .toolbar,
    .filter-tags,
    .toc-panel,
    .load-more-wrap,
    .back-to-top,
    .skip-link,
    .recipe-controls,
    .affiliate-banner { display: none !important; }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        font-family: serif !important;
        font-size: 11pt !important;
    }

    .recipe-book {
        border: none !important;
        box-shadow: none !important;
        max-width: none !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .recipe-card {
        break-inside: avoid;
        border: 1px solid #000000 !important;
        border-left: 6px solid #000000 !important;
        background: #ffffff !important;
        margin-bottom: 2rem !important;
        padding: 1.5rem !important;
    }

    .recipe-title {
        color: #000000 !important;
        font-size: 16pt !important;
    }
    
    .recipe-card h3 {
        color: #000000 !important;
        border-bottom: 1px solid #000000 !important;
    }
    
    .ingredient-item {
        padding-left: 1.5rem !important;
    }
    
    .ingredient-item::before {
        content: '\2610' !important;
        font-family: sans-serif !important;
        left: 0 !important;
        color: #000000 !important;
    }

    .direction-step {
        padding-left: 1.5rem !important;
    }

    .direction-step::before {
        left: 0 !important;
        color: #000000 !important;
    }
}

/* SEO content details */
.seo-intro {
    font-size: 0.95rem;
    color: var(--text-dim);
    max-width: 52rem;
    margin: 0 auto 1.5rem;
    text-align: center;
    line-height: 1.6;
}

.noscript-categories,
.noscript-recipes {
    margin: 1.25rem 0 1.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.noscript-categories a,
.noscript-recipes a {
    color: var(--cyan);
    text-decoration: none;
}

.noscript-categories a:hover,
.noscript-recipes a:hover {
    text-decoration: underline;
}

noscript h2 {
    font-size: 1.1rem;
    color: var(--cyan);
    margin: 1.5rem 0 0.75rem;
    border-bottom: 1px dotted var(--border);
    padding-bottom: 0.25rem;
}
