/* --- RECIPES PAGE STYLES --- */
:root {
    --bg-color: #1a202c;
    --surface-color: #2d3748;
    --border-color: #4a5568;
    --text-color: #e2e8f0;
    --text-muted: #a0aec0;
    --primary-accent: #805ad5;
    --primary-accent-hover: #9f7aea;
    --secondary-accent: #f0a048;
    --glow-color: rgba(159, 122, 234, 0.6);
    --success-color: #48bb78;
    --danger-color: #ff4136;
    --warning-color: #f0a048;
    --legendary-color: #00B894;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Fira Code', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- HEADER --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
}

#main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 0 0 5px var(--glow-color);
    text-decoration: none;
}

#main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#main-nav ul a {
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.2s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

#main-nav ul a:hover,
#main-nav ul a.active {
    color: var(--primary-accent-hover);
}

.nav-cta-button {
    background-color: var(--primary-accent);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-cta-button:hover {
    background-color: var(--primary-accent-hover);
    color: white !important;
}

/* --- RECIPES CONTAINER --- */
.recipes-container {
    display: flex;
    padding-top: 70px;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
#sidebar {
    width: 280px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 2rem 0;
    top: 70px;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1rem;
    color: var(--primary-accent-hover);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- SEARCH BOX --- */
.search-box {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-accent-hover);
    box-shadow: 0 0 0 2px rgba(159, 122, 234, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* --- CATEGORY NAVIGATION --- */
.category-nav {
    padding: 1.5rem 0;
}

.category-nav ul {
    list-style: none;
    padding: 0 1.5rem;
}

.category-link {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    margin-left: -1rem;
}

.category-link:hover,
.category-link.active {
    color: var(--primary-accent-hover);
    border-left-color: var(--primary-accent-hover);
    transform: translateX(5px);
}

/* --- STATS BOX --- */
.stats-box {
    padding: 1.5rem;
    margin: 1.5rem;
    background-color: rgba(128, 90, 213, 0.1);
    border: 1px solid var(--primary-accent);
    border-radius: 4px;
}

.stats-box h4 {
    color: var(--secondary-accent);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.stat-line {
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

.stat-line span {
    color: var(--primary-accent-hover);
    font-weight: 700;
}

/* --- MAIN CONTENT --- */
#content {
    margin-left: 280px;
    padding: 3rem;
    max-width: 1400px;
    flex-grow: 1;
}

/* --- PAGE HEADER --- */
.page-header {
    margin-bottom: 3rem;
}

.glitch-text {
    font-size: 3rem;
    color: var(--primary-accent-hover);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.header-line {
    height: 2px;
    background: linear-gradient(90deg, var(--primary-accent), transparent);
    margin-top: 1rem;
}

/* --- RECIPE SECTIONS --- */
.recipe-section {
    margin-bottom: 4rem;
}

.recipe-section.hidden {
    display: none;
}

.section-title {
    font-size: 2rem;
    color: var(--secondary-accent);
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

/* --- RECIPES GRID --- */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* --- RECIPE CARD --- */
.recipe-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card.hidden {
    display: none;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.recipe-card.special-recipe {
    border-left: 3px solid var(--warning-color);
}

.recipe-card.legendary-recipe {
    border: 2px solid var(--legendary-color);
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(243, 156, 18, 0.1) 100%);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

/* --- RECIPE HEADER --- */
.recipe-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recipe-icon {
    font-size: 3rem;
    text-shadow: 0 0 10px currentColor;
    min-width: 60px;
    text-align: center;
}

.recipe-title h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.recipe-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-accent);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- RECIPE BODY --- */
.recipe-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe-time,
.recipe-machine {
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.recipe-time .label,
.recipe-machine .label {
    color: var(--secondary-accent);
    font-weight: 600;
}

.recipe-time .value,
.recipe-machine .value {
    color: var(--text-color);
}

/* --- INGREDIENTS --- */
.recipe-ingredients h4 {
    color: var(--secondary-accent);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.ingredient-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ingredient {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.ing-icon {
    font-size: 1.5rem;
    text-shadow: 0 0 5px currentColor;
    min-width: 30px;
    text-align: center;
}

.ing-name {
    flex-grow: 1;
    color: var(--text-color);
    font-size: 0.9rem;
}

.ing-amount {
    color: var(--primary-accent-hover);
    font-weight: 700;
    font-size: 0.95rem;
}

/* --- RECIPE OUTPUT --- */
.recipe-output {
    padding: 0.75rem;
    background-color: rgba(72, 187, 120, 0.1);
    border-left: 3px solid var(--success-color);
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-color);
}

.recipe-output.legendary {
    background-color: rgba(243, 156, 18, 0.1);
    border-left-color: var(--legendary-color);
    color: var(--legendary-color);
    font-size: 1.1rem;
}

.recipe-output.multi-output {
    background-color: rgba(128, 90, 213, 0.1);
    border-left-color: var(--primary-accent);
}

.recipe-output h4 {
    color: var(--secondary-accent);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.output-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.output-list div {
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* --- NOTE BOX --- */
.note-box {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(128, 90, 213, 0.1);
    border-left: 3px solid var(--primary-accent);
    border-radius: 4px;
    font-size: 0.85rem;
}

.note-box strong {
    color: var(--primary-accent-hover);
}

.legendary-note {
    background-color: rgba(243, 156, 18, 0.15);
    border-left-color: var(--legendary-color);
    animation: legendary-glow 2s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(243, 156, 18, 0.2); }
    50% { box-shadow: 0 0 20px rgba(243, 156, 18, 0.4); }
}

.legendary-note strong {
    color: var(--legendary-color);
}

/* --- BUTTONS --- */
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
    text-transform: uppercase;
    text-decoration: none;
    margin: 0 0.5rem;
}

.primary-button {
    background-color: var(--primary-accent);
    color: #edf2f7;
}

.primary-button:hover {
    background-color: var(--primary-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow-color);
    color: #edf2f7;
    text-decoration: none;
}

.secondary-button {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.secondary-button:hover {
    background-color: var(--border-color);
    border-color: var(--primary-accent-hover);
    color: var(--text-color);
    text-decoration: none;
}

.back-to-main {
    text-align: center;
    margin: 4rem 0;
}

/* --- FOOTER --- */
#main-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: #111827;
    margin-left: 280px;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.status-ok {
    color: var(--success-color);
    font-weight: bold;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-accent-hover);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    #sidebar {
        width: 240px;
    }
    
    #content {
        margin-left: 240px;
        padding: 2rem;
    }
    
    #main-footer {
        margin-left: 240px;
    }
    
    .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .recipes-container {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    #content {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    #main-footer {
        margin-left: 0;
    }
    
    #main-nav ul {
        gap: 0.75rem;
        font-size: 0.8rem;
    }
    
    .glitch-text {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    .recipe-header {
        flex-direction: column;
        text-align: center;
    }
}

/* --- SCROLLBAR STYLING --- */
#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-track {
    background: var(--bg-color);
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-accent);
}

/* --- SMOOTH SCROLL OFFSET --- */
.recipe-section {
    scroll-margin-top: 90px;
}

/* --- IMPROVED MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    #sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    #content {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    #main-footer {
        margin-left: 0;
    }
    
    #main-nav ul {
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.75rem;
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .glitch-text {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .recipe-card {
        padding: 1rem;
    }
    
    .recipe-icon {
        font-size: 2rem;
    }
    
    .recipe-title h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .page-subtitle {
        font-size: 1rem;
    }
    
    .search-box input {
        font-size: 0.85rem;
    }
    
    .stats-box {
        margin: 1rem;
        padding: 1rem;
    }
}

/* --- MOBILE MENU TOGGLE --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    #main-nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background-color: rgba(26, 32, 44, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        align-items: flex-start;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
        z-index: 100;
        overflow-y: auto;
    }
    
    #main-nav ul.mobile-menu-active {
        right: 0;
    }
    
    #main-nav ul li {
        width: 100%;
    }
    
    #main-nav ul a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.1rem;
        width: 100%;
    }
    
    .nav-cta-button {
        display: block;
        text-align: center;
        width: 100%;
        padding: 0.75rem 1rem;
    }
}
