/* Modern Cafe Menu CSS - Fixed Layout Version */
/* Minimalist, Clean, Natural Color Palette */

/* ===== CSS Variables - Modern Dark 2025 ===== */
:root {
    /* Light Mode Colors - Professional & Clean */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ffffff;
    --bg-elevated: #ffffff;

    /* Text Hierarchy */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6b6b6b;
    --text-muted: #999999;

    /* Interactive Elements - High Contrast */
    --accent: #1f2937;           /* Dark gray for better visibility */
    --accent-hover: #374151;     /* Lighter gray on hover */
    --accent-text: #ffffff;      /* White text on dark buttons */

    /* Borders and Dividers */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --border-strong: #d1d5db;

    /* States */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Legacy Support - Direct mapping */
    --primary-dark: var(--text-primary);
    --primary-light: var(--bg-secondary);
    --accent-warm: var(--accent);
    --accent-cool: var(--accent-hover);
    --text-dark: var(--text-primary);
    --text-light: var(--text-secondary);
    --background: var(--bg-primary);
    --card-bg: var(--bg-tertiary);
    --bg-light: var(--bg-secondary);

    /* Ad Colors */
    --ad-bg: var(--bg-secondary);
    --ad-border: var(--border);
    --ad-text: var(--text-tertiary);
    
    /* Spacing - Reduced for better layout */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    --font-serif: 'Georgia', 'Noto Serif KR', serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Ad Colors */
    --ad-bg: #f8f9fa;
    --ad-border: #dee2e6;
    --ad-text: #6c757d;
}

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

/* ===== Base ===== */
html {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* ===== Remove All Internal Scroll Bars ===== */
.sidebar, aside, nav, .card, .category-section, .search-section {
    overflow-y: visible !important;
    max-height: none !important;
    position: relative !important;
    top: auto !important;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.3;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.875rem);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    margin-top: var(--spacing-md);
}

h4 {
    font-size: 1.125rem;
    font-family: var(--font-sans);
    font-weight: 600;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

a {
    color: var(--accent-cool);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-warm);
}

/* ===== Header - Compact & Fixed ===== */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--primary-dark);
}

/* ===== Navigation - Compact ===== */
nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    margin: 0;
}

/* ===== Header Controls (Timer & Theme) ===== */
.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-timer-btn,
.header-theme-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-timer-btn:hover,
.header-theme-btn:hover {
    background: var(--accent-warm);
    color: white;
    border-color: var(--accent-warm);
    transform: scale(1.05);
}

.header-timer-btn:active,
.header-theme-btn:active {
    transform: scale(0.95);
}

nav a {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 400;
    padding: var(--spacing-xs) var(--spacing-sm);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent-warm);
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 80%;
}

/* ===== Layout - Optimized Grid ===== */
.layout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    box-sizing: border-box;
}

.content-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--spacing-lg);
    align-items: start;
    box-sizing: border-box;
}

/* ===== Sidebar - Compact ===== */
.sidebar {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
}

.sidebar-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.sidebar h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-sans);
}

.sidebar h3 {
    font-size: 0.875rem;
    color: var(--primary-dark);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-sans);
}

.sidebar ul {
    list-style: none;
    margin: 0;
}

.sidebar li {
    margin-bottom: 0.125rem;
}

.sidebar a {
    display: block;
    padding: 0.375rem var(--spacing-sm);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.sidebar a:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateX(2px);
}

/* ===== Main Content ===== */
.main-content {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* ===== Hero Section - Compact ===== */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: var(--spacing-lg);
    text-align: center;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    margin-bottom: var(--spacing-xs);
}

.hero-section p {
    margin-bottom: var(--spacing-md);
}

/* ===== Stats Grid - Compact ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.stat-card {
    text-align: center;
    padding: var(--spacing-md);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--accent-warm);
    display: block;
    line-height: 1;
}

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

/* ===== Search Section - Compact ===== */
.search-section {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.search-section h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

/* ===== Category Navigation - Compact ===== */
.category-nav {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.375rem var(--spacing-md);
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-dark);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* ===== Story Intro Section ===== */
.story-intro {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--card-bg) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.story-intro h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-dark);
}

.story-intro > div {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

@media (max-width: 768px) {
    .story-intro > div {
        grid-template-columns: 1fr;
    }
}

.story-intro .lead {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

.story-intro p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Feature Box - 특징 요약 박스 */
.feature-box {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--accent-color);
    margin-top: var(--spacing-md);
}

.feature-box h4 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    font-size: 1.1rem;
}

.feature-box ul {
    margin: 0;
    padding-left: var(--spacing-lg);
}

.feature-box li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
    color: var(--text-light);
}

.feature-box li strong {
    color: var(--text-dark);
}

/* ===== Cards - Compact Bento Box ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.card {
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card h4 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
}

.card p {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.card--minimal { background: var(--bg-primary); border: 1px solid var(--border); box-shadow: none; }
.card--flat { box-shadow: none; border: 1px solid var(--border-light); }

.card ul {
    list-style: none;
    margin: 0;
}

.card li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

/* ===== Featured Recipes Grid ===== */
.featured-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.recipe-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.recipe-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-light), white);
    border-bottom: 1px solid var(--border-light);
}

.recipe-header h4 {
    margin: 0;
    font-size: 1rem;
}

.recipe-body {
    padding: var(--spacing-md);
}

.recipe-body p {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.recipe-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--accent-cool);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

/* ===== Feature Cards ===== */
.feature-card {
    background: linear-gradient(135deg, var(--primary-light), white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

/* ===== Info Boxes ===== */
.info-box {
    background-color: var(--primary-light);
    border-left: 4px solid var(--accent-cool);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.info-box h4 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

.info-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.info-box ol {
    margin: 0;
    padding-left: 1.5rem;
}

.info-box ol li {
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: var(--accent-warm);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--accent-cool);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* ===== Footer ===== */
footer {
    background-color: var(--primary-dark);
    color: var(--primary-light);
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
}

footer p {
    color: var(--primary-light);
    opacity: 0.8;
    margin: 0;
}

/* ===== Section Spacing ===== */
section {
    margin-bottom: var(--spacing-lg);
}

section:last-child {
    margin-bottom: 0;
}

/* ===== Mobile Hamburger Menu ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Mobile Sidebar Toggle ===== */
.sidebar-toggle {
    display: none;
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-align: left;
    transition: all 0.3s ease;
}

.sidebar-toggle::after {
    content: '▼';
    float: right;
    transition: transform 0.3s ease;
}

.sidebar-toggle.active::after {
    transform: rotate(180deg);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    /* Header Layout */
    .header-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .logo {
        order: 1;
        flex: 0 0 auto;
    }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        order: 2;
    }
    
    .header-controls {
        order: 3;
        display: flex;
        gap: var(--spacing-xs);
    }
    
    /* Navigation - Hidden by default on mobile */
    nav,
    nav#main-nav {
        order: 4;
        width: 100%;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease;
    }
    
    nav.mobile-nav-open,
    nav#main-nav.mobile-nav-open {
        max-height: 500px !important;
    }
    
    nav ul,
    nav#main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--spacing-sm) 0;
    }
    
    nav ul li,
    nav#main-nav ul li {
        width: 100%;
    }
    
    nav a,
    nav#main-nav a {
        display: block;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-light);
        text-align: center;
    }
    
    nav a:hover,
    nav#main-nav a:hover {
        background: var(--bg-secondary);
    }
    
    /* Content Grid - Main content first */
    .content-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .main-content,
    main.main-content {
        order: 1 !important;
    }
    
    .sidebar,
    aside.sidebar {
        order: 2 !important;
        position: relative;
        margin-top: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
        max-height: none;
        overflow-y: visible;
    }
    
    /* Sidebar collapse on mobile */
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    
    .sidebar-content.expanded {
        max-height: 5000px;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 터치 친화적 버튼 크기 */
    .category-btn {
        min-height: 44px !important;
        padding: var(--spacing-sm) var(--spacing-md) !important;
        font-size: 0.9rem;
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 검색 입력창 크기 조정 */
    #quickSearch {
        min-height: 44px;
        padding: var(--spacing-sm);
        font-size: 1rem;
    }
    
    /* 헤더 컨트롤 버튼 크기 */
    .header-timer-btn,
    .header-theme-btn {
        width: 44px;
        height: 44px;
    }
    
    /* Featured recipes - 2 columns on mobile */
    .featured-recipes {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .recipe-card {
        padding: var(--spacing-sm);
    }
    
    .recipe-header h4 {
        font-size: 0.9rem;
    }
    
    .recipe-body p {
        font-size: 0.8rem;
    }
}

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.d-block { display: block; }
.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.lead { font-size: 1.25rem; font-weight: 500; line-height: 1.4; color: var(--text-dark); }

/* ===== Advertisement Styles - AdSense Optimized ===== */
.ad-container {
    background: var(--ad-bg);
    border: 1px solid var(--ad-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    /* AdSense specific optimizations */
    clear: both;
    isolation: isolate;
}

/* AdSense ad elements should have no additional styling */
.ad-container > ins[data-ad-client] {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ad-container > script {
    display: block;
}

.ad-placeholder {
    color: var(--ad-text);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.7;
    background: var(--ad-bg);
    border: 2px dashed var(--ad-border);
    padding: var(--spacing-md);
    text-align: center;
}

/* AdSense Standard Sizes - Exact Dimensions */
.ad-banner {
    min-height: 90px;
    max-width: 728px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    /* Prevent layout shift during ad load */
    aspect-ratio: 728/90;
}

.ad-rectangle {
    min-height: 250px;
    max-width: 300px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* Prevent layout shift during ad load */
    aspect-ratio: 300/250;
}

.ad-large-rectangle {
    min-height: 280px;
    max-width: 336px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 336/280;
}

.ad-square {
    min-height: 250px;
    max-width: 250px;
    width: 100%;
    aspect-ratio: 1;
    margin-left: auto;
    margin-right: auto;
}

.ad-skyscraper {
    min-height: 600px;
    max-width: 160px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.ad-mobile-banner {
    min-height: 50px;
    max-width: 320px;
    width: 100%;
}

.ad-large-mobile-banner {
    min-height: 100px;
    max-width: 320px;
    width: 100%;
}

/* Ad positioning classes */
.ad-top {
    margin: 0 auto var(--spacing-lg);
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.ad-bottom {
    margin: var(--spacing-lg) auto 0;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.ad-sidebar {
    position: relative;
    margin: var(--spacing-md) 0;
    width: 100%;
    box-sizing: border-box;
}

.ad-inline {
    margin: var(--spacing-lg) auto;
    max-width: 100%;
    clear: both;
}

.ad-floating,
#ad-floating {
    display: none !important; /* 플로팅 광고 비활성화 */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 40;  /* 타이머보다 낮은 z-index */
    box-shadow: var(--shadow-lg);
    max-width: 300px;
    opacity: 0.95;
}

/* AdSense Mobile Optimization */
@media (max-width: 768px) {
    .ad-banner {
        max-width: 320px;
        min-height: 50px;
        aspect-ratio: 320/50;
    }
    
    .ad-rectangle,
    .ad-large-rectangle {
        max-width: 300px;
        min-height: 250px;
        aspect-ratio: 300/250;
    }
    
    .ad-square {
        max-width: 250px;
        min-height: 250px;
        aspect-ratio: 1;
    }
    
    .ad-skyscraper {
        display: none; /* Hide skyscraper on mobile */
    }
    
    .ad-floating {
        position: fixed;
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        box-shadow: var(--shadow-lg);
        z-index: 30;  /* 낮은 z-index로 겹침 방지 */
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .ad-banner {
        max-width: 320px;
        min-height: 50px;
    }
    
    .ad-floating {
        position: static;
        margin: var(--spacing-md) auto;
        box-shadow: none;
        left: auto;
        right: auto;
        bottom: auto;
    }
}

/* Ad loading state */
.ad-loading {
    background: linear-gradient(90deg, var(--ad-bg) 25%, #f0f0f0 50%, var(--ad-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Ad close button (for floating ads) */
.ad-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: none;
    z-index: 100;
    transition: background 0.2s ease;
    line-height: 1;
}

/* Dialogue and Quote Styles - Dark Mode Compatible */
.dialogue {
    background: var(--bg-light, #f8f9fa);
    color: var(--text-dark, #2c2c2c);
    border-left: 4px solid var(--accent-warm, #8a6914);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    position: relative;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
}

.dialogue::before {
    content: '"';
    font-size: 2rem;
    color: var(--accent-warm, #8a6914);
    position: absolute;
    left: 0.5rem;
    top: -0.5rem;
    opacity: 0.3;
}

.dialogue::after {
    content: '"';
    font-size: 2rem;
    color: var(--accent-warm, #8a6914);
    position: absolute;
    right: 0.5rem;
    bottom: -1rem;
    opacity: 0.3;
}

/* Story box for narrative sections */
.story-box {
    background: var(--bg-secondary, #f1f3f4);
    border: 1px solid var(--border-light, #e8e4de);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius-md, 8px);
    position: relative;
}

.story-date {
    font-size: 0.9rem;
    color: var(--text-light, #6b6b6b);
    margin-bottom: 1rem;
    font-style: italic;
}

/* Highlight box for important content */
.highlight-box {
    background: var(--bg-light, #f8f9fa) !important;
    color: var(--text-dark, #2c2c2c) !important;
    border: 1px solid var(--border-light, #e8e4de) !important;
    padding: 1.5rem !important;
    border-radius: var(--radius-sm, 8px) !important;
    text-align: center !important;
    margin: 1.5rem 0 !important;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1)) !important;
}

.ad-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ad-floating .ad-close {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide ads for ad blockers with fallback content */
.ad-fallback {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Show fallback when ad is blocked */
.ad-container:empty + .ad-fallback {
    display: block;
}

/* ===== 광고 승인 전 숨김 스타일 ===== */
.ad-hidden {
    display: none !important;
}

/* 관리자 모드 표시 */
.ad-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10000;
    opacity: 0.8;
}

/* 광고 승인 대기 메시지 */
.ad-pending-notice {
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    display: none;
}

.ad-pending-notice.show {
    display: block;
}

.ad-pending-notice .notice-icon {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* 개발자 도구 버튼 (숨김) */
.dev-ad-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

.dev-mode .dev-ad-toggle {
    opacity: 0.7;
}

.dev-ad-toggle:hover {
    opacity: 1;
    background: var(--accent-hover);
}

/* ===== Dark Mode (Optional) ===== */
/* ===== 다크모드 지원 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Professional Dark 2025 - 20+ Sources Research */
        /* 기본 배경 (Nord + VS Code Dark 혼합) */
        --bg-primary: #1e1e1e;     /* VS Code Dark 기본 */
        --bg-secondary: #252526;   /* VS Code Dark 보조 */
        --bg-tertiary: #2d2d30;    /* VS Code Dark 카드/패널 */
        --bg-elevated: #3e3e42;    /* VS Code Dark 상승 요소 */

        /* 텍스트 계층 - 최고 가독성 */
        --text-primary: #d4d4d4;   /* VS Code Dark 메인 텍스트 */
        --text-secondary: #cccccc; /* 보조 텍스트 */
        --text-tertiary: #969696;  /* 3차 텍스트 */
        --text-muted: #6a6a6a;     /* 음소거된 텍스트 */

        /* 인터랙티브 요소 - Discord + Slack 혼합 */
        --accent: #007acc;         /* VS Code 블루 */
        --accent-hover: #1177bb;   /* 호버 상태 */
        --accent-text: #ffffff;    /* 버튼 내 텍스트 */

        /* 테두리 - Tailwind 기반 */
        --border: #404040;
        --border-light: #4a4a4a;
        --border-strong: #5a5a5a;

        /* 상태 색상 - 다크모드 최적화 */
        --success: #4caf50;
        --warning: #ff9800;
        --error: #f44336;
        --info: #2196f3;

        /* 신규 컬러 시스템 변수 */
        --color-background: var(--bg-primary);
        --color-surface: var(--bg-secondary);
        --color-surface-elevated: var(--bg-elevated);
        --color-card: var(--bg-tertiary);
        --color-border: var(--border-light);
        --color-text-primary: var(--text-primary);
        --color-text-secondary: var(--text-secondary);

        /* 레거시 지원 */
        --primary-dark: var(--text-primary);
        --primary-light: var(--bg-secondary);
        --text-dark: var(--text-primary);
        --text-light: var(--text-secondary);
        --background: var(--bg-primary);
        --card-bg: var(--bg-tertiary);
        --bg-light: var(--bg-secondary);
        --accent-warm: var(--accent);
        --accent-cool: var(--accent-hover);

        /* 광고 색상 */
        --ad-bg: var(--bg-secondary);
        --ad-border: var(--border);
        --ad-text: var(--text-tertiary);

        /* Enhanced Shadows for Dark Mode */
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.7);
    }
    
    /* 본문 스타일 */
    body {
        background-color: var(--background);
        color: var(--text-dark);
        /* 다크모드에서 안티앨리어싱 강화 */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* 다크모드 타이포그래피 조정 */
    body, p, span, div {
        /* 폰트 가중치 살짝 증가 */
        font-weight: 450; /* 400에서 증가 */
        /* 자간 살짝 증가 */
        letter-spacing: 0.01em;
    }
    
    /* 제목 폰트 가중치 조정 */
    h1, h2, h3, h4, h5, h6 {
        font-weight: 600; /* 다크모드에서 더 굵게 */
        letter-spacing: 0.02em;
    }
    
    /* 작은 텍스트 가독성 개선 */
    small, .text-sm, .stat-label {
        font-weight: 500;
        letter-spacing: 0.02em;
    }
    
    /* 헤더 다크모드 */
    header {
        background-color: rgba(30, 30, 30, 0.95);
        backdrop-filter: blur(10px);
        border-bottom-color: var(--color-border);
    }
    
    /* 헤더 컨트롤 버튼 다크모드 */
    .header-timer-btn,
    .header-theme-btn {
        background: var(--card-bg);
        border-color: var(--border-light);
        color: var(--text-dark);
    }
    
    /* Interactive states for dark mode */
    button:hover,
    .category-btn:hover,
    .btn:hover {
        background-color: var(--color-surface-elevated);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }
    
    /* Card improvements - 자연스러운 다크모드 스타일 */
    .card,
    .sidebar-card,
    .recipe-card {
        background: var(--color-card);
        border: 1px solid var(--color-border);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.15),
            0 1px 3px rgba(0, 0, 0, 0.08);
        /* 미세한 내부 하이라이트로 질감 추가 */
        position: relative;
    }
    
    .card::before,
    .sidebar-card::before,
    .recipe-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    
    /* 카드 호버 효과 개선 */
    .card:hover,
    .sidebar-card:hover,
    .recipe-card:hover {
        transform: translateY(-2px);
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.2),
            0 3px 10px rgba(0, 0, 0, 0.1);
        border-color: rgba(129, 140, 248, 0.2);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .card:hover::before,
    .sidebar-card:hover::before,
    .recipe-card:hover::before {
        background: rgba(129, 140, 248, 0.1);
    }
    
    /* Input improvements */
    input,
    select,
    textarea {
        background: var(--color-surface);
        border: 1.5px solid var(--color-border);
        color: var(--color-text-primary);
        font-weight: 500;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
        outline: none;
    }
    
    /* Table improvements */
    table {
        background: var(--color-card);
        border: 1px solid var(--color-border);
    }
    
    th {
        background: var(--color-surface-elevated);
        color: var(--color-text-primary);
        font-weight: 600;
        border-bottom: 2px solid var(--color-border-strong);
    }
    
    td {
        border-color: var(--color-border);
        color: var(--color-text-secondary);
    }
    
    tr:hover {
        background: rgba(129, 140, 248, 0.05);
    }
    
    /* Code blocks */
    code,
    pre {
        background: var(--color-surface-elevated);
        color: #e6db74; /* Monokai yellow for code */
        border: 1px solid var(--color-border);
        font-weight: 500;
    }
    
    /* Links */
    a {
        color: var(--color-accent-hover);
        text-decoration-color: rgba(129, 140, 248, 0.4);
    }
    
    a:hover {
        color: var(--color-accent);
        text-decoration-color: var(--color-accent);
    }
    
    /* Blockquotes */
    blockquote {
        background: var(--color-surface);
        border-left: 4px solid var(--color-accent);
        color: var(--color-text-secondary);
    }
    
    /* Ad placeholders improvements */
    .ad-placeholder {
        background: linear-gradient(135deg, var(--color-surface), var(--color-surface-elevated));
        border: 2px dashed var(--color-border);
        color: var(--color-text-muted);
        font-weight: 500;
    }
    
    /* Navigation improvements */
    nav {
        background: rgba(30, 30, 30, 0.98);
        border-color: var(--color-border);
    }
    
    nav a {
        color: var(--color-text-secondary);
        font-weight: 500;
    }
    
    nav a:hover,
    nav a.active {
        color: var(--color-text-primary);
        background: rgba(129, 140, 248, 0.1);
    }
    
    /* Lists improvements */
    ul,
    ol {
        color: var(--color-text-secondary);
    }
    
    li::marker {
        color: var(--color-accent);
    }
    
    /* Better selection styling */
    ::selection {
        background: rgba(129, 140, 248, 0.3);
        color: var(--color-text-primary);
    }
    
    /* Scrollbar styling */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--color-surface);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--color-border-strong);
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-accent);
    }
    
    /* 강제적인 카드 배경색 수정 - 최고 우선순위로 모든 흰색 배경 제거 */
    body.dark-mode .card,
    body.dark-mode .sidebar-card,
    body.dark-mode .recipe-card,
    body.dark-mode .menu-category-card,
    body.dark-mode .featured-recipes .recipe-card,
    body.dark-mode section,
    body.dark-mode div[class*="card"],
    body.dark-mode div[style*="background: #fff"],
    body.dark-mode div[style*="background: white"],
    body.dark-mode div[style*="background-color: #fff"],
    body.dark-mode div[style*="background-color: white"],
    body.dark-mode div[style*="background: rgb(255, 255, 255)"],
    body.dark-mode *[style*="background: #ffffff"],
    body.dark-mode *[style*="background-color: #ffffff"],
    body.dark-mode input[type="text"],
    body.dark-mode input[type="number"] {
        background: var(--color-card) !important;
        background-color: var(--color-card) !important;
    }
    
    /* 특정 카드 클래스 강제 수정 */
    body.dark-mode div[data-category],
    body.dark-mode .featured-recipes > .recipe-card,
    body.dark-mode .recipe-card[data-category],
    body.dark-mode .timer-widget,
    body.dark-mode .active-timer {
        background: var(--color-card) !important;
        background-color: var(--color-card) !important;
    }
    
    /* 카테고리 버튼 강제 색상 수정 */
    body.dark-mode .category-btn,
    body.dark-mode button[class*="category"],
    body.dark-mode .filter-btn,
    body.dark-mode .nav-btn,
    body.dark-mode .feature-link,
    body.dark-mode .back-to-top,
    body.dark-mode .btn-primary,
    body.dark-mode *[style*="background: var(--accent-warm)"],
    body.dark-mode *[style*="background: var(--accent-cool)"],
    body.dark-mode *[style*="background: rgb(184, 164, 255)"],
    body.dark-mode *[style*="background: rgb(159, 133, 255)"] {
        background: var(--color-surface-elevated) !important;
        color: var(--color-text-primary) !important;
        border: 1px solid var(--color-border) !important;
    }
    
    body.dark-mode .category-btn:hover,
    body.dark-mode button[class*="category"]:hover,
    body.dark-mode .filter-btn:hover,
    body.dark-mode .nav-btn:hover,
    body.dark-mode .feature-link:hover,
    body.dark-mode .back-to-top:hover,
    body.dark-mode .btn-primary:hover {
        background: var(--color-accent) !important;
        color: var(--color-accent-text) !important;
        border-color: var(--color-accent) !important;
    }
    
    body.dark-mode .category-btn.active,
    body.dark-mode button[class*="category"].active,
    body.dark-mode .filter-btn.active {
        background: var(--color-accent) !important;
        color: var(--color-accent-text) !important;
        border-color: var(--color-accent) !important;
    }
    
    .header-timer-btn:hover,
    .header-theme-btn:hover {
        background: var(--accent-warm);
        color: var(--background);
        border-color: var(--accent-warm);
    }
    
    /* 히어로 섹션 */
    .hero-section {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    }
    
    /* 제목 요소들 가독성 강화 */
    h1, h2, h3, h4, h5, h6 {
        color: var(--primary-dark) !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }
    
    /* 특별히 H1 제목 강조 */
    h1 {
        color: #ffffff !important;
        font-weight: 500 !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    }
    
    /* 카드 및 섹션들 - Material Design elevation 적용 */
    .card,
    .sidebar-card {
        background: var(--color-surface) !important;
        border: 1px solid var(--color-border) !important;
        box-shadow: var(--shadow-md) !important;
    }
    
    .stat-card,
    .search-section,
    .recipe-card,
    .feature-card {
        background: var(--color-surface-elevated) !important;
        border: 1px solid var(--color-border) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    }
    
    .info-box {
        background: var(--color-surface) !important;
        border-left: 4px solid var(--color-accent) !important;
        border-right: 1px solid var(--color-border) !important;
        border-top: 1px solid var(--color-border) !important;
        border-bottom: 1px solid var(--color-border) !important;
    }
    
    /* 메인 콘텐츠 영역 */
    .main-content {
        background: var(--color-surface) !important;
        box-shadow: var(--shadow-lg) !important;
    }
    
    /* 본문 텍스트 가독성 개선 */
    p {
        color: var(--text-light) !important;
    }
    
    /* span 요소 색상 수정 */
    span {
        color: var(--text-dark) !important;
    }
    
    /* 버튼 내부의 span 요소들 */
    button span {
        color: inherit !important;
    }
    
    /* TOP 버튼 관련 span */
    .back-to-top span,
    .back-to-top-text {
        color: inherit !important;
    }
    
    /* 타이머 토글 버튼 내 span */
    .timer-toggle span {
        color: inherit !important;
    }
    
    /* 사이드바 텍스트 개선 */
    .sidebar a {
        color: var(--text-light) !important;
    }
    
    .sidebar a:hover {
        color: var(--primary-dark) !important;
    }
    
    /* 버튼 스타일 */
    .category-btn {
        background: var(--card-bg);
        color: var(--text-dark);
        border-color: var(--border-light);
    }
    
    .category-btn:hover {
        background: var(--accent-warm);
        color: var(--background);
    }
    
    /* 폼 요소들 */
    input, select, textarea {
        background: var(--card-bg);
        border-color: var(--border-light);
        color: var(--text-dark);
    }
    
    input:focus, select:focus, textarea:focus {
        border-color: var(--accent-warm);
        box-shadow: 0 0 0 2px rgba(184, 164, 255, 0.2);
    }
    
    /* 사이드바 다크모드 */
    .sidebar,
    .sidebar-card {
        background-color: var(--card-bg);
    }
    
    aside {
        background-color: var(--card-bg) !important;
    }
    
    /* 메인 콘텐츠 */
    .main-content {
        background-color: var(--card-bg);
    }
    
    /* 푸터 */
    footer {
        background-color: #0a0a0a;
        color: var(--primary-dark);
    }
    
    /* 링크 색상 강화 - 고대비 */
    a {
        color: var(--color-accent) !important;
        text-decoration: underline !important;
        text-decoration-color: rgba(129, 140, 248, 0.4) !important;
        text-underline-offset: 2px !important;
        font-weight: 450;
    }
    
    a:hover {
        color: var(--color-accent-hover) !important;
        text-decoration-color: var(--color-accent-hover) !important;
    }
    
    /* 포커스 상태 개선 */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid var(--color-accent) !important;
        outline-offset: 2px !important;
    }
    
    /* 특별한 링크들 (기능 배너 등) - 대비율 개선 */
    .new-features-banner .feature-link,
    a.feature-link {
        color: #000000 !important;
        background: #ffffff !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 4px !important;
        text-decoration: none !important;
        border: 2px solid var(--accent-warm) !important;
        font-weight: 500 !important;
    }
    
    .new-features-banner .feature-link:hover,
    a.feature-link:hover {
        background: var(--accent-warm) !important;
        color: #000000 !important;
        border-color: #ffffff !important;
    }
    
    /* 버튼 스타일 개선 - 고대비 및 가독성 */
    .new-features-banner button,
    button,
    .btn {
        color: var(--color-accent-text) !important;
        background: var(--color-accent) !important;
        border: 1px solid var(--color-accent) !important;
        border-radius: var(--radius-sm) !important;
        padding: 0.5rem 1rem !important;
        font-weight: 500 !important;
        cursor: pointer;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    }
    
    .new-features-banner button:hover,
    button:hover,
    .btn:hover {
        background: var(--color-accent-hover) !important;
        border-color: var(--color-accent-hover) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.4) !important;
    }
    
    /* 카테고리 버튼 다크모드 */
    .category-btn {
        background: var(--color-surface-elevated) !important;
        color: var(--color-text-primary) !important;
        border-color: var(--color-border) !important;
    }
    
    .category-btn:hover {
        background: var(--color-accent) !important;
        color: var(--color-accent-text) !important;
        border-color: var(--color-accent) !important;
    }
    
    /* 기능 버튼들의 텍스트 가독성 강화 */
    .feature-link,
    button.feature-link {
        color: #ffffff !important;
        background: var(--accent-warm) !important;
        border: none !important;
    }
    
    .feature-link:hover,
    button.feature-link:hover {
        color: #ffffff !important;
        background: var(--accent-cool) !important;
    }
    
    /* 색상 배경을 가진 링크들 수정 */
    a[style*="background"] {
        color: #000000 !important;
        background: #ffffff !important;
        border: 1px solid var(--accent-warm) !important;
    }
    
    /* 빠른메뉴 링크 다크모드 스타일 - 특이성 증가 */
    nav ul li a.quick-menu-link,
    a.quick-menu-link {
        color: #000000 !important;
        background: #ffffff !important;
        border: 2px solid var(--accent-warm) !important;
        border-radius: 4px !important;
        padding: 0.5rem 1rem !important;
        font-weight: 500 !important;
        text-decoration: none !important;
    }
    
    nav ul li a.quick-menu-link:hover,
    a.quick-menu-link:hover {
        background: var(--accent-warm) !important;
        color: #000000 !important;
        border-color: #ffffff !important;
    }
    
    /* 그라디언트 배경 */
    .recipe-header,
    .feature-card {
        background: linear-gradient(135deg, var(--card-bg), #2a2a2a);
    }
    
    /* 광고 관련 */
    .ad-close {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .ad-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* 광고 플레이스홀더 다크모드 개선 */
    .ad-placeholder {
        color: var(--text-light) !important;
        background: var(--card-bg) !important;
        border-color: var(--accent-warm) !important;
        opacity: 0.8 !important;
    }
    
    /* 개발환경 안전모드 텍스트 */
    .ad-placeholder small {
        color: var(--accent-warm) !important;
    }
    
    /* UL 요소 색상 개선 */
    ul {
        color: var(--text-light) !important;
        line-height: 1.6;
    }
    
    /* 리스트 항목 가독성 개선 */
    li {
        color: var(--text-light) !important;
    }
}

/* ===== Back to Top 버튼 ===== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--accent-warm);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.back-to-top span {
    color: white !important;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== 다크모드 토글 버튼 (Fallback용, 헤더에 버튼이 없을 때만) ===== */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-warm);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   궁극 다크모드 강제 적용 - 모든 흰색 배경 제거
   ============================================ */

/* 모든 흰색 또는 밝은 배경을 가진 요소를 강제로 다크로 변경 */
body.dark-mode *:not(img):not(svg):not(video):not(iframe) {
    background-color: var(--color-background) !important;
}

body.dark-mode div,
body.dark-mode section,
body.dark-mode article,
body.dark-mode main,
body.dark-mode aside,
body.dark-mode header,
body.dark-mode footer,
body.dark-mode .container,
body.dark-mode .content {
    background: var(--color-background) !important;
    background-color: var(--color-background) !important;
    color: var(--color-text-primary) !important;
}

/* 카드와 표면 요소들 */
body.dark-mode .card,
body.dark-mode .recipe-card,
body.dark-mode .sidebar-card,
body.dark-mode .panel,
body.dark-mode .widget,
body.dark-mode .timer-widget,
body.dark-mode [class*="card"],
body.dark-mode [class*="panel"],
body.dark-mode [class*="widget"] {
    background: var(--color-card) !important;
    background-color: var(--color-card) !important;
    border-color: var(--color-border) !important;
}

/* 검색 및 입력 요소 */
body.dark-mode .search-section,
body.dark-mode .search-container,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .search-input,
body.dark-mode .time-input {
    background: var(--color-surface) !important;
    background-color: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}

/* 메인 콘텐츠 영역들 */
body.dark-mode .main-content,
body.dark-mode main.main-content,
body.dark-mode main,
body.dark-mode .content-area {
    background: var(--color-background) !important;
    background-color: var(--color-background) !important;
}

/* Body와 HTML 전체 */
body.dark-mode,
html.dark-mode body {
    background: var(--color-background) !important;
    background-color: var(--color-background) !important;
    color: var(--color-text-primary) !important;
}

/* 입력 필드 추가 강제 */
body.dark-mode input.search-input,
body.dark-mode .search-input,
body.dark-mode input[type="search"],
body.dark-mode input.time-input,
body.dark-mode .time-input {
    background: var(--color-surface) !important;
    background-color: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}

/* 타이머 위젯 강제 다크 */
body.dark-mode .timer-widget,
body.dark-mode div.timer-widget {
    background: var(--color-card) !important;
    background-color: var(--color-card) !important;
    border-color: var(--color-border) !important;
}

/* 다크모드에서 카드 내부 텍스트 가독성 개선 */
body.dark-mode .card h3,
body.dark-mode .card h4,
body.dark-mode .recipe-card h3,
body.dark-mode .recipe-card h4,
body.dark-mode [class*="card"] h3,
body.dark-mode [class*="card"] h4 {
    color: #e0e0e0 !important;
}

body.dark-mode .card p,
body.dark-mode .card span,
body.dark-mode .recipe-card p,
body.dark-mode .recipe-card span,
body.dark-mode [class*="card"] p,
body.dark-mode [class*="card"] span {
    color: #b0b0b0 !important;
}

/* 모든 흰색 배경 요소 강제 변경 - 최후의 수단 */
body.dark-mode *[style*="rgb(255, 255, 255)"],
body.dark-mode *[style*="background: white"],
body.dark-mode *[style*="background-color: white"],
body.dark-mode *[style*="background: #fff"],
body.dark-mode *[style*="background-color: #fff"],
body.dark-mode *[style*="background: #ffffff"],
body.dark-mode *[style*="background-color: #ffffff"] {
    background: var(--color-card) !important;
    background-color: var(--color-card) !important;
}

/* ===== Manual Dark Mode Support ===== */
:root[data-theme="dark"] {
    /* Professional Dark 2025 - 20+ Sources Research */
    /* 기본 배경 (Nord + VS Code Dark 혼합) */
    --bg-primary: #1e1e1e;     /* VS Code Dark 기본 */
    --bg-secondary: #252526;   /* VS Code Dark 보조 */
    --bg-tertiary: #2d2d30;    /* VS Code Dark 카드/패널 */
    --bg-elevated: #3e3e42;    /* VS Code Dark 상승 요소 */

    /* 텍스트 계층 - 최고 가독성 */
    --text-primary: #d4d4d4;   /* VS Code Dark 메인 텍스트 */
    --text-secondary: #cccccc; /* 보조 텍스트 */
    --text-tertiary: #969696;  /* 3차 텍스트 */
    --text-muted: #6a6a6a;     /* 음소거된 텍스트 */

    /* 인터랙티브 요소 - Discord + Slack 혼합 */
    --accent: #007acc;         /* VS Code 블루 */
    --accent-hover: #1177bb;   /* 호버 상태 */
    --accent-text: #ffffff;    /* 버튼 내 텍스트 */

    /* 테두리 - Tailwind 기반 */
    --border: #404040;
    --border-light: #4a4a4a;
    --border-strong: #5a5a5a;

    /* 상태 색상 - 다크모드 최적화 */
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --info: #2196f3;

    /* 신규 컬러 시스템 변수 */
    --color-background: var(--bg-primary);
    --color-surface: var(--bg-secondary);
    --color-surface-elevated: var(--bg-elevated);
    --color-card: var(--bg-tertiary);
    --color-border: var(--border-light);
    --color-text-primary: var(--text-primary);
    --color-text-secondary: var(--text-secondary);

    /* 레거시 지원 - !important로 강제 덮어쓰기 */
    --primary-dark: var(--text-primary) !important;
    --primary-light: var(--bg-secondary) !important;
    --text-dark: var(--text-primary) !important;
    --text-light: var(--text-secondary) !important;
    --background: var(--bg-primary) !important;
    --card-bg: var(--bg-tertiary) !important;
    --bg-light: var(--bg-secondary) !important;
    --accent-warm: var(--accent) !important;
    --accent-cool: var(--accent-hover) !important;

    /* 광고 색상 */
    --ad-bg: var(--bg-secondary);
    --ad-border: var(--border);
    --ad-text: var(--text-tertiary);

    /* Enhanced Shadows for Dark Mode */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.7);
}

[data-theme="dark"] body {
    background-color: var(--background);
    color: var(--text-dark);
    /* 다크모드에서 안티앨리어싱 강화 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme="dark"] header {
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] .card,
[data-theme="dark"] .sidebar-card,
[data-theme="dark"] .recipe-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 헤더 아이콘 SVG 스타일 */
.header-timer-btn svg,
.header-theme-btn svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* 다크모드에서 버튼 스타일 개선 */
body.dark-mode .header-timer-btn,
body.dark-mode .header-theme-btn {
    background: #2d2d30 !important;
    background-color: #2d2d30 !important;
    border: 1px solid #404040 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* 타이머 버튼 특별 처리 */
body.dark-mode #header-timer-btn,
body.dark-mode button.header-timer-btn {
    background: #2d2d30 !important;
    background-color: #2d2d30 !important;
    color: #ffffff !important;
}

/* 다크모드 호버 스타일 - 높은 우선순위 */
body.dark-mode .header-controls .header-timer-btn:hover,
body.dark-mode .header-controls .header-theme-btn:hover,
body.dark-mode .header-controls #header-timer-btn:hover,
body.dark-mode .header-controls #header-theme-btn:hover,
body.dark-mode button#header-timer-btn:hover,
body.dark-mode button#header-theme-btn:hover {
    background: #5a67d8 !important;
    background-color: #5a67d8 !important;
    border: 1px solid #5a67d8 !important;
    border-color: #5a67d8 !important;
    color: #ffffff !important;
    transform: scale(1.05) !important;
}

/* 다크모드에서 SVG 색상 */
body.dark-mode .header-timer-btn svg,
body.dark-mode .header-theme-btn svg {
    stroke: #ffffff !important;
    fill: none !important;
    opacity: 0.9;
}

body.dark-mode .header-timer-btn:hover svg,
body.dark-mode .header-theme-btn:hover svg,
body.dark-mode #header-timer-btn:hover svg,
body.dark-mode #header-theme-btn:hover svg {
    stroke: #ffffff !important;
    fill: none !important;
    opacity: 1;
}

.header-timer-btn:hover svg,
.header-theme-btn:hover svg {
    stroke: white;
}

/* Font Awesome 대체용 (선택사항) */
.header-timer-btn::before {
    content: none !important;
}
.header-theme-btn::before {
    content: none !important;
}
