/* Variables & Themes */
:root {
    --bg-main: radial-gradient(circle at 50% 50%, #15112e 0%, #0a0814 100%);
    --bg-darker: #07060f;
    --sidebar-bg: rgba(13, 10, 26, 0.6);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-hover-border: rgba(147, 51, 234, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-purple: #9333ea;
    --accent-glow: rgba(147, 51, 234, 0.25);
    --accent-blue: #06b6d4;
    --accent-gold: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-main) no-repeat fixed;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, select {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 360px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Search Box */
.search-box {
    padding: 16px 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 40px 12px 16px;
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(0, 0, 0, 0.4);
}

.search-icon {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-fast);
    padding: 4px;
}

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

/* Filters */
.filter-controls {
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--card-border);
}

.filter-group label, .filter-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.category-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.cat-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 8px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-fast);
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.cat-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.filter-row {
    display: flex;
    gap: 12px;
}

.filter-field {
    flex: 1;
}

.filter-field select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-field select:focus {
    border-color: var(--accent-purple);
}

/* Recipe List */
.recipe-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.list-stats {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
}

.recipe-list {
    list-style: none;
    padding: 8px 12px;
}

.recipe-item {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 6px;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.recipe-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    transition: var(--transition-fast);
}

.recipe-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--card-border);
}

.recipe-item.active {
    background: rgba(147, 51, 234, 0.08);
    border-color: rgba(147, 51, 234, 0.25);
}

.recipe-item.active::before {
    background: var(--accent-purple);
}

.recipe-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0; /* allows text truncation */
}

.recipe-name {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.recipe-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.difficulty-dot.easy { background: var(--accent-emerald); }
.difficulty-dot.medium { background: var(--accent-gold); }
.difficulty-dot.hard { background: var(--accent-rose); }

.recipe-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.alc-percentage {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: var(--font-heading);
}

.recipe-id-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    background: rgba(0,0,0,0.05);
}

/* Welcome Screen */
.welcome-container {
    max-width: 900px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-section {
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 100%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 60px 40px;
    backdrop-filter: blur(5px);
}

.hero-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

.hero-section h2 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px 24px;
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-hover-border);
    box-shadow: 0 10px 20px rgba(147, 51, 234, 0.1);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 14px;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Quick Guides */
.quick-guides {
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    background: var(--card-bg);
}

.quick-guides h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.guide-step {
    position: relative;
    padding-top: 36px;
}

.step-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    font-family: var(--font-heading);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.guide-step h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.guide-step p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Recipe Detail View */
.detail-container {
    max-width: 960px;
    margin: 0 auto;
    animation: fadeIn var(--transition-normal);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 24px;
    transition: var(--transition-fast);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.back-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
}

/* Recipe Header Card */
.recipe-detail-header-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 100%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.recipe-color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    border: 2px solid #fff;
    flex-shrink: 0;
}

.recipe-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recipe-title-wrapper h2 {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.recipe-id-badge {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.recipe-id-badge span {
    color: var(--text-secondary);
}

.recipe-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.badge strong {
    color: #fff;
}

.badge-difficulty strong {
    color: var(--accent-gold);
}

.badge-alcohol strong {
    color: var(--accent-blue);
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.detail-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
}

.detail-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.card-title-icon {
    font-size: 20px;
}

/* Ingredients List */
.ingredients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 14px;
}

.ingredient-item.custom-brew-link {
    cursor: pointer;
    transition: var(--transition-fast);
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.03);
}

.ingredient-item.custom-brew-link:hover {
    border-color: var(--accent-blue);
    background: rgba(6, 182, 212, 0.08);
    transform: translateX(4px);
}

.ing-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.ing-link-indicator {
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.ing-amount {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
}

/* Effects List */
.effects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.effect-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
}

.effect-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.effect-name {
    font-weight: 600;
    font-size: 14px;
}

.effect-level {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 13px;
}

.effect-duration {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Timeline Process */
.process-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 20px;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 15px;
    bottom: 15px;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-step {
    display: flex;
    gap: 20px;
    position: relative;
}

.step-marker {
    width: 16px;
    height: 16px;
    background: var(--bg-darker);
    border: 2px solid var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex-shrink: 0;
    margin-top: 4px;
    font-size: 10px;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.step-content strong {
    color: #fff;
}

/* Lore Card */
.lore-content-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 80px;
}

.lore-footer-info {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.lore-footer-info code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-blue);
}

/* --- Minecraft Styling Classes --- */
.mc-black { color: #000000; }
.mc-dark-blue { color: #0000AA; text-shadow: 0 0 5px rgba(0, 0, 170, 0.4); }
.mc-dark-green { color: #00AA00; text-shadow: 0 0 5px rgba(0, 170, 0, 0.4); }
.mc-dark-aqua { color: #00AAAA; text-shadow: 0 0 5px rgba(0, 170, 170, 0.4); }
.mc-dark-red { color: #AA0000; text-shadow: 0 0 5px rgba(170, 0, 0, 0.4); }
.mc-dark-purple { color: #AA00AA; text-shadow: 0 0 5px rgba(170, 0, 170, 0.4); }
.mc-gold { color: #FFAA00; text-shadow: 0 0 8px rgba(255, 170, 0, 0.5); }
.mc-gray { color: #AAAAAA; }
.mc-dark-gray { color: #555555; }
.mc-blue { color: #5555FF; text-shadow: 0 0 8px rgba(85, 85, 255, 0.5); }
.mc-green { color: #55FF55; text-shadow: 0 0 8px rgba(85, 255, 85, 0.5); }
.mc-aqua { color: #55FFFF; text-shadow: 0 0 8px rgba(85, 255, 255, 0.5); }
.mc-red { color: #FF5555; text-shadow: 0 0 8px rgba(255, 85, 85, 0.5); }
.mc-light-purple { color: #FF55FF; text-shadow: 0 0 8px rgba(255, 85, 255, 0.5); }
.mc-yellow { color: #FFFF55; text-shadow: 0 0 8px rgba(255, 255, 85, 0.5); }
.mc-white { color: #FFFFFF; text-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }

.mc-bold { font-weight: bold; }
.mc-italic { font-style: italic; }
.mc-underline { text-decoration: underline; }
.mc-strike { text-decoration: line-through; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: 450px;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    
    body {
        overflow-y: auto;
        height: auto;
    }
    
    .main-content {
        padding: 20px;
        overflow-y: visible;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .guide-steps {
        grid-template-columns: 1fr;
    }
}
