/* 
==========================================
DESIGN THINKING BOOKLET - MAIN STYLESHEET
==========================================

This file contains all the CSS styling for the Design Thinking Booklet application.
It includes styles for both desktop and mobile responsive design.

KEY STYLING AREAS:
- Main layout and sidebar navigation
- Interactive booklet modal and pages
- Mobile responsive design (hamburger menu, page flipping)
- Search functionality styling
- Method cards and stage modules
- Color-coded mode indicators

BOOKLET STYLES:
- .booklet: Main booklet container
- .booklet .pages: Two-page layout structure
- .method-modal: Full-screen modal overlay
- Mobile page flipping animations
- Mode color indicators and buttons

TEACHER NOTE: This file makes the booklet look professional and interactive.
The booklet styles start around line 800 with "Method Modes in Booklet" section.
*/

:root {
    --bg: #f7faf9;
    --text: #1f2937;
    --muted: #6b7280;
    --surface: #fff;
    --border: #e5e7eb;
    --stage-color-1: #06b6d4;
    /* EMPATHIZE */
    --stage-color-2: #10b981;
    /* DEFINE */
    --stage-color-3: #f59e0b;
    /* IDEATE */
    --stage-color-4: #ef4444;
    /* PROTOTYPE */
    --stage-color-5: #7f1d1d;
    /* TEST */
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background:
        radial-gradient(1200px 500px at -10% -10%, rgba(6, 182, 212, .06), transparent 45%),
        radial-gradient(1200px 500px at 110% -10%, rgba(245, 158, 11, .05), transparent 45%),
        radial-gradient(900px 400px at 110% 110%, rgba(239, 68, 68, .05), transparent 45%),
        radial-gradient(900px 400px at -10% 110%, rgba(16, 185, 129, .05), transparent 45%),
        var(--bg);
    color: var(--text);
}

h1 {
    margin: .25rem 0;
    font-size: 1.8rem;
}

p {
    color: var(--muted);
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

main {
    padding: 2rem 2rem 2.5rem 2rem;
    flex: 1;
    max-width: 1200px;
    margin: 0;
}

/* Sidebar */
.sidebar {
    width: 320px;
    border-right: 2px solid rgba(59, 130, 246, 0.1);
    background:
        radial-gradient(1200px 400px at 10% 8%, rgba(6, 182, 212, .08), transparent 45%),
        radial-gradient(1000px 360px at 85% 12%, rgba(16, 185, 129, .08), transparent 45%),
        radial-gradient(900px 320px at 55% 70%, rgba(245, 158, 11, .08), transparent 45%),
        radial-gradient(900px 320px at 30% 55%, rgba(239, 68, 68, .08), transparent 45%),
        radial-gradient(800px 300px at 92% 72%, rgba(127, 29, 29, .08), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 2rem 1.5rem 2rem 1.5rem;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
}

.sidebar h3 {
    margin: 0 0 1.5rem 0;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1f2937;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.1);
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sidebar .nav button {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.sidebar .nav button .color-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sidebar .nav button:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.sidebar .nav button:focus {
    outline: 2px solid rgba(59, 130, 246, 0.3);
    outline-offset: 2px;
}

.sidebar .nav button.active {
    border-color: var(--active-color, #3b82f6);
    box-shadow: inset 4px 0 0 var(--active-color, #3b82f6), 0 8px 25px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f9fbff 0%, #f0f9ff 100%);
    transform: translateY(-1px);
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Hero intro */
.hero {
    position: relative;
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    background:
        radial-gradient(1200px 400px at 10% 8%, rgba(6, 182, 212, .08), transparent 45%),
        radial-gradient(1000px 360px at 85% 12%, rgba(16, 185, 129, .08), transparent 45%),
        radial-gradient(900px 320px at 55% 70%, rgba(245, 158, 11, .08), transparent 45%),
        radial-gradient(900px 320px at 30% 55%, rgba(239, 68, 68, .08), transparent 45%),
        radial-gradient(800px 300px at 92% 72%, rgba(127, 29, 29, .08), transparent 45%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2.5rem 2rem 4rem 2rem;
    margin: 2rem 0 4rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: -0.5px;
}

.hero-sub {
    margin: 1.5rem 0 1.5rem 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #374151;
}

.hero p {
    color: #4b5563;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero p:last-of-type {
    margin-bottom: 3rem;
}

.hero-credit {
    font-size: .85rem;
    color: var(--muted);
    margin-top: 3rem;
    margin-bottom: 2rem;
    display: block;
    padding-bottom: 1rem;
}

/* Add extra spacing before the footer area */
.hero>*:last-child {
    margin-bottom: 2rem;
}

.chips {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 2rem 0 3rem 0;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.chip {
    padding: 1rem 1.5rem;
    background: var(--chip);
    color: #fff;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.chip:hover::before {
    left: 100%;
}

.chip:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.chip:active {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.1s ease;
}

.no-modules {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.hero-legend {
    display: flex;
    gap: 0;
    margin-top: 1.5rem;
    width: max-content;
    border: 2px solid rgba(59, 130, 246, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.hero-legend .swatch {
    width: 60px;
    height: 28px;
    background: var(--c);
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hero-legend .swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Force card height - cache busting version - Updated: 2024-12-19 15:30 */
.card,
#stages-container .card,
#methods-container .card {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #e5e7eb, #f3f4f6) border-box !important;
    padding: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease !important;
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.card h4 {
    margin: .2rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Force card paragraph height - cache busting version */
.card p,
#stages-container .card p,
#methods-container .card p {
    margin: 0.5rem 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: #6b7280 !important;
    flex-grow: 1 !important;
    display: -webkit-box !important;

    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 4.2em !important;
    word-wrap: break-word !important;
    /* Fallback for browsers that don't support line-clamp */
    position: relative !important;
    box-sizing: border-box !important;
}

.card p::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 1em;
    height: 1.4em;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

.tag {
    margin-top: auto;
    font-size: .8rem;
    padding: .2rem .5rem;
    border-radius: 8px;
    color: #fff;
    width: max-content;
    align-self: flex-start;
}

/* Headings */
h2 {
    margin-top: 0;
    padding-bottom: .25rem;
    border-bottom: 1px dashed #e5e7eb;
}

/* Buttons */
.back-btn {
    display: inline-block;
    margin: 1.5rem 0 2rem 0;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    border: none;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

/* Modal (booklet) */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .6);
    z-index: 200;
    padding: 1rem;
}

.modal.open {
    display: flex;
}

.booklet {
    width: min(1200px, 95vw);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.15), 0 12px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    --accent: #3b82f6;
    backdrop-filter: blur(10px);
}

.booklet .ribbon {
    position: absolute;
    height: 6px;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(90deg, var(--accent), var(--stage-color-4), var(--stage-color-1));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.page-number-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    z-index: 20;
    display: none;
}

@media (max-width: 768px) {
    .page-number-indicator {
        display: block;
    }
}

.booklet .pages {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    min-height: 500px;
    overflow: auto;
    max-height: calc(95vh - 80px);
    overscroll-behavior: contain;
    padding: 1rem 0 2rem 0;
}

.booklet .pages.single-page .page:last-child {
    visibility: hidden;
}

.page {
    padding: 2.5rem 3rem;
    min-width: 0;
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    max-height: 100%;
}

.page h2 {
    margin: .2rem 0 .5rem 0;
}

.meta {
    color: var(--muted);
    font-size: .95rem;
}

.divider {
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.close-modal {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .35rem .5rem;
    cursor: pointer;
}

.close-modal:hover {
    filter: brightness(.95);
}

/* Responsive booklet */
@media (max-width: 768px) {
    .booklet {
        background: #fff;
    }

    .booklet .pages {
        grid-template-columns: 1fr;
        max-height: calc(90vh - 24px);
    }

    .divider {
        display: none;
    }
}

/* Booklet typography and footer */
.booklet h2 {
    font-size: 1.8rem;
    letter-spacing: .3px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    position: relative;
}

.booklet h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}

.booklet h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem;
    letter-spacing: .2px;
    font-weight: 600;
    color: #374151;
}

.booklet p {
    line-height: 1.8;
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.method-content {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.method-content p {
    margin-bottom: 1.25rem;
    text-align: left;
    hyphens: auto;
    white-space: pre-line;
}

.method-content p:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar styling */
.method-content::-webkit-scrollbar {
    width: 8px;
}

.method-content::-webkit-scrollbar-track {
    background: transparent;
}

.method-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.method-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Method Image Styling */
#method-image-container {
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#method-image {
    max-width: 380px;
    max-height: 280px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    background: white;
    padding: 0.25rem;
    display: block;
    object-fit: contain;
}

#method-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar styling for sections */
#method-sections::-webkit-scrollbar {
    width: 8px;
}

#method-sections::-webkit-scrollbar-track {
    background: transparent;
}

#method-sections::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

#method-sections::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Subtle accent decorations */
.page:first-child::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 0;
    height: 100%;
    width: 6px;
    background: linear-gradient(to bottom, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    opacity: .08;
}



.booklet .footer-row {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.booklet .footer {
    font-size: .65rem;
    color: var(--muted);
    opacity: .8;
    position: static;
}

.booklet .legend {
    position: static;
    display: flex;
    gap: 0;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .9);
}

.booklet .legend .swatch {
    width: 42px;
    height: 18px;
    background: var(--c, #e5e7eb);
    display: inline-block;
}

.booklet .legend .swatch.accent {
    background: var(--accent);
}

/* Sections */
#method-sections {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.section-item {
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--stage-color-4));
    border-radius: 0 2px 2px 0;
}

.section-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.section-title {
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.section-desc {
    margin: 0.75rem 0 1rem 0;
    color: #4b5563;
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
    text-align: left;
}

.section-children {
    margin-top: 1rem;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left: 3px solid rgba(59, 130, 246, 0.2);
    position: relative;
}

.section-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1.5px;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), transparent);
    border-radius: 2px;
}

/* Method Modes in Booklet */
.method-mode {
    display: inline-block;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mode Selection Styling */
.mode-selection {
    margin: 1.5rem 0;
    padding: 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.mode-selection:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.mode-label {
    display: block;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mode-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.mode-checkbox::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.mode-checkbox:hover::before {
    left: 100%;
}

.mode-checkbox:hover {
    background: #f0f7ff;
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.15);
}

.mode-checkbox input[type="checkbox"] {
    margin: 0;
    width: 22px;
    height: 22px;
    accent-color: #3b82f6;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mode-checkbox input[type="checkbox"]:checked {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.mode-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-color::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.mode-checkbox:hover .mode-color::after {
    transform: translateX(100%);
}

.mode-checkbox:hover .mode-color {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.mode-checkbox span:last-child {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.mode-checkbox:hover span:last-child {
    color: #1e40af;
}

/* Selected state styling */
.mode-checkbox input[type="checkbox"]:checked+.mode-color+span {
    color: #1e40af;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.1);
}

.mode-checkbox input[type="checkbox"]:checked {
    transform: scale(1.05);
    border-color: #1e40af;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.15);
}

/* Mode Color Management */
.mode-colors {
    margin: 2rem 0;
    padding: 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.mode-colors::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--stage-color-1), var(--stage-color-4), var(--stage-color-2), var(--stage-color-3), var(--stage-color-5));
    border-radius: 24px 24px 0 0;
}

.mode-colors:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.mode-colors .title {
    font-weight: 800;
    margin-bottom: 2rem;
    color: #1f2937;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 1rem;
    position: relative;
}



.mode-color-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    background: white;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.mode-color-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    transition: left 0.6s ease;
}

.mode-color-item:hover::before {
    left: 100%;
}

.mode-color-item:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.mode-color-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.mode-name {
    font-weight: 700;
    color: #1f2937;
    min-width: 140px;
    font-size: 1.2rem;
    letter-spacing: 0.75px;
    text-transform: uppercase;
}

.mode-color-item input[type="color"],
.mode-color-item .color-input {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* Color picker wrapper and indicator */
.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.color-indicator {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Make sure it's visible */
    display: block !important;
    min-width: 32px !important;
    min-height: 32px !important;
}

.color-indicator:hover {
    transform: scale(1.1);
    border-color: #9ca3af;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-input {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.save-color-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    font-size: 0.9rem;
}

.save-color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.save-color-btn:active {
    transform: translateY(0);
}

/* Beautiful Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animations to mode elements */
.mode-selection {
    animation: fadeInUp 0.6s ease-out;
}

.mode-colors {
    animation: slideInLeft 0.6s ease-out 0.1s both;
}

.mode-checkbox {
    animation: fadeInUp 0.4s ease-out;
}

.mode-checkbox:nth-child(1) {
    animation-delay: 0.1s;
}

.mode-checkbox:nth-child(2) {
    animation-delay: 0.2s;
}

.mode-checkbox:nth-child(3) {
    animation-delay: 0.3s;
}

.mode-checkbox:nth-child(4) {
    animation-delay: 0.4s;
}

.mode-checkbox:nth-child(5) {
    animation-delay: 0.5s;
}

/* New Color Palette in Footer */
.new-color-palette {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
}

.color-block {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mode Buttons in Footer */
.mode-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 20px;
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.mode-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn.restore {
    background: #10b981;
    color: white;
    border-color: #10b981;
    animation: pulse 2s infinite;
}

.btn.restore:hover {
    background: #059669;
    border-color: #059669;
}

.btn.warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn.warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.btn.danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn.small {
    padding: 6px 12px;
    font-size: 12px;
    background: #e5e7eb;
    color: #6b7280;
}

/* Pulse animation for restore button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Search Header Styling */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 2rem 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 1.5rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    transform: translateY(-3px);
    border-color: rgba(102, 126, 234, 0.3);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: transparent;
    color: #374151;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
    transform: scale(0.95);
}



/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

.search-results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.search-results-header h3 {
    margin: 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f9fafb;
    transform: translateX(4px);
}

.result-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    margin-top: 0.25rem;
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.result-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.result-labels {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.result-color-palette {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-type {
    background: #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.matched-fields {
    color: #059669;
    font-size: 0.75rem;
    font-weight: 500;
}

.no-results {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Undo section styling */
.undo-section {
    text-align: center;
}

.undo-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Stages Header */
.stages-header h2 {
    margin-bottom: 2rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .layout {
        display: flex;
        min-height: 100vh;
    }

    .search-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        padding: 0.75rem 1rem;
        margin: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 0;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .sidebar {
        width: 280px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        padding: 1rem;
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        z-index: 150;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar h3 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 1rem 0;
    }

    .nav {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav button {
        display: flex;
        align-items: center;
        width: 100%;
        font-size: 0.9rem;
        font-weight: 500;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        border: none;
        background: transparent;
        color: var(--text);
        transition: all 0.2s ease;
        text-align: left;
    }

    .nav button .color-indicator {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin-right: 0.75rem;
        flex-shrink: 0;
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .nav button:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .nav button.active {
        background: rgba(0, 0, 0, 0.1);
        font-weight: 600;
    }

    main {
        flex: 1;
        padding: 1rem;
        max-width: 100%;
        margin-top: 80px;
    }

    .sidebar-toggle {
        position: relative;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 10px;
        padding: 0.6rem;
        cursor: pointer;
        backdrop-filter: blur(10px);
        transition: all 0.2s ease;
        color: white;
        flex-shrink: 0;
    }

    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

    .sidebar-toggle:active {
        transform: scale(0.95);
    }

    .sidebar-toggle svg {
        width: 18px;
        height: 18px;
        stroke: white;
        stroke-width: 2.5;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 140;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .search-container {
        flex: 1;
        max-width: 100%;
    }

    .search-input-wrapper {
        display: flex;
        gap: 0.75rem;
        align-items: center;
    }

    .search-input {
        flex: 1;
        font-size: 16px;
        padding: 0.875rem 1rem;
        border-radius: 12px;
        border: none;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .search-input:focus {
        background: white;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    }

    .search-btn {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(10px);
        color: white;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: pointer;
    }

    .search-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

    .search-results {
        max-height: 60vh;
        overflow-y: auto;
        margin-top: 1rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .search-result-item {
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        background: white;
        border: 1px solid #e5e7eb;
    }

    .result-title {
        font-size: 1rem;
        font-weight: 600;
    }

    .result-description {
        font-size: 0.9rem;
        color: #6b7280;
    }

    .back-btn {
        display: none;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
        font-weight: 700;
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

    #stages-overview-section h2 {
        display: none;
    }

    .hero {
        padding: 1.5rem 1rem;
        margin: 1rem;
        border-radius: 16px;
        background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
        border: 1px solid #bae6fd;
    }

    .hero-content {
        font-size: 0.9rem;
        line-height: 1.6;
        color: #1e40af;
    }

    .chips {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 1rem 0;
        justify-content: center;
    }

    .chip {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        border-radius: 20px;
        background: rgba(59, 130, 246, 0.1);
        color: #1e40af;
        border: 1px solid rgba(59, 130, 246, 0.2);
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }

    .card {
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        padding: 1.25rem;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }

    .card p {
        font-size: 0.85rem;
        line-height: 1.5;
        color: #6b7280;

        display: block !important;
    }

    .card::after {
        display: none !important;
    }

    .modal {
        padding: 0.5rem;
    }

    .booklet {
        width: 100%;
        max-width: 100%;
        height: 70vh;
        max-height: 70vh;
        margin: 0;
        border-radius: 16px;
        position: relative;
        background: #f8f9fa;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        overflow: hidden;
    }

    .booklet .pages {
        padding: 0;
        height: 100%;
        position: relative;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    .booklet .page {
        flex: 1;
        padding: 1.5rem 1rem;
        background: white;
        margin: 0.25rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        position: relative;
        overflow-y: auto;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
        transform-style: preserve-3d;
    }

    /* Page flip animation states */
    .booklet .page.flip-out {
        transform: rotateY(-90deg) scale(0.95) !important;
        opacity: 0 !important;
    }

    .booklet .page.flip-in {
        transform: rotateY(90deg) scale(0.95) !important;
        opacity: 0 !important;
    }

    .booklet .page.flip-in.active {
        transform: rotateY(0deg) scale(1) !important;
        opacity: 1 !important;
    }

    /* Add perspective to the booklet container for 3D effect */
    .booklet .pages {
        perspective: 1000px;
        transform-style: preserve-3d;
    }

    /* Mobile booklet tap hint animation */
    @media (max-width: 768px) {
        .booklet {
            cursor: pointer;
            position: relative;
        }

        .booklet::before {
            content: '👆 Tap to flip page';
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.7rem;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            z-index: 10;
        }

        .booklet:hover::before,
        .booklet:active::before {
            opacity: 1;
        }

        /* Subtle pulse animation to indicate interactivity */
        .booklet .page {
            animation: subtlePulse 3s ease-in-out infinite;
        }

        @keyframes subtlePulse {

            0%,
            100% {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }

            50% {
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
            }
        }

        /* Keyframe animations for page flip */
        @keyframes flipOut {
            0% {
                transform: rotateY(0deg) scale(1);
                opacity: 1;
            }

            100% {
                transform: rotateY(-90deg) scale(0.95);
                opacity: 0;
            }
        }

        @keyframes flipIn {
            0% {
                transform: rotateY(90deg) scale(0.95);
                opacity: 0;
            }

            100% {
                transform: rotateY(0deg) scale(1);
                opacity: 1;
            }
        }
    }

    .booklet .page:first-child {
        margin-bottom: 0.25rem;
    }

    .booklet .page:last-child {
        margin-top: 0.25rem;
    }

    .booklet .divider {
        display: none;
    }

    .booklet .divider::before {
        content: '';
        position: absolute;
        top: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        background: #e5e7eb;
        border-radius: 50%;
    }

    .booklet-exit-areas {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 10;
    }

    .booklet-exit-left,
    .booklet-exit-right {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20%;
        pointer-events: auto;
        cursor: pointer;
        background: transparent;
        transition: background 0.2s ease;
    }

    .booklet-exit-left {
        left: 0;
    }

    .booklet-exit-right {
        right: 0;
    }

    .booklet-exit-left:hover,
    .booklet-exit-right:hover {
        background: rgba(0, 0, 0, 0.05);
    }



    .booklet h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

    .booklet .meta {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        color: #6b7280;
    }

    .booklet p {
        font-size: 0.85rem;
        line-height: 1.6;
        color: #374151;
    }

    #method-image-container {
        margin-bottom: 1rem;
        text-align: center;
    }

    #method-image {
        max-width: 100%;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: #1f2937;
    }

    .section-content {
        font-size: 0.85rem;
        line-height: 1.5;
        color: #6b7280;
    }

    .footer-row {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .footer {
        font-size: 0.75rem;
        text-align: center;
        color: #9ca3af;
    }

    .mode-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .mode-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-width: 50px;
        border-radius: 6px;
    }

    .result-color-palette {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .color-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .search-header {
        padding: 0.6rem 0.75rem;
    }

    .sidebar {
        top: 55px;
        padding: 0.4rem 0.75rem;
    }

    .nav {
        gap: 0.25rem;
    }

    .nav button {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    main {
        margin-top: 70px;
    }

    .sidebar-toggle {
        padding: 0.5rem;
    }

    .sidebar-toggle svg {
        width: 16px;
        height: 16px;
    }

    .search-input {
        font-size: 16px;
        padding: 0.75rem;
    }

    .search-btn {
        width: 44px;
        height: 44px;
    }

    .hero {
        padding: 1rem 0.75rem;
        margin: 0.75rem;
    }

    .hero-content {
        font-size: 0.85rem;
    }

    .cards {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .card {
        padding: 1rem;
    }

    .card h3 {
        font-size: 0.95rem;
    }

    .card p {
        font-size: 0.8rem;
    }

    .booklet .pages {
        padding: 0.75rem;
    }

    .booklet h2 {
        font-size: 1.2rem;
    }

    .booklet p {
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .section-content {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.1rem;
    }
}