:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --primary-lunch: #ff9f43;
    /* Warm Orange */
    --primary-dinner: #5f27cd;
    /* Deep Purple */
    --primary-cafe: #10ac84;
    /* Calm Green/Teal */
    --accent-color: #ff6b6b;

    --card-bg: #ffffff;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);

    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

/* Dark Mode Support (optional, but good for premium feel) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #f0f0f0;
        --card-bg: #2d2d2d;
        --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

header {
    width: 100%;
    height: 60vh;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)), url('assets/hero.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 20px;
    position: relative;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Controls Section */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: -30px auto 40px;
    /* Overlap header */
    padding: 0 20px;
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
    /* Safe wrap */
}

/* Toggle Switch Style - Updated Container for 3 items */
.mode-switch {
    background: var(--card-bg);
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 5px;
    width: auto;
    /* Changed from fixed width */
    min-width: 300px;
    flex: 2;
    /* Takes more space */
}

.mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #888;
    font-family: var(--font-main);
    white-space: nowrap;
}

.mode-btn.active.lunch {
    background-color: var(--primary-lunch);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 159, 67, 0.4);
}

.mode-btn.active.dinner {
    background-color: var(--primary-dinner);
    color: white;
    box-shadow: 0 4px 10px rgba(95, 39, 205, 0.4);
}

.mode-btn.active.cafe {
    background-color: var(--primary-cafe);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 172, 132, 0.4);
}

/* Random Pick Button */
.random-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    /* Takes less space */
    justify-content: center;
    min-width: 150px;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.random-btn:active {
    transform: scale(0.95);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 50vh;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 30px;
    background-color: var(--primary-lunch);
    /* Default */
    border-radius: 3px;
    transition: background-color 0.3s;
}

body.dinner-mode .section-title::before {
    background-color: var(--primary-dinner);
}

body.cafe-mode .section-title::before {
    background-color: var(--primary-cafe);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding-bottom: 50px;
}

/* Card Style */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.03);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.card:hover .card-icon {
    transform: rotate(10deg) scale(1.1);
}

.card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.card .category {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .desc {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 20px;
    flex-grow: 1;
}

.card .menu-highlight {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-lunch);
    transition: color 0.3s;
}

body.dinner-mode .card .menu-highlight {
    color: var(--primary-dinner);
}

body.cafe-mode .card .menu-highlight {
    color: var(--primary-cafe);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease backwards;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-switch,
    .random-btn {
        width: 100%;
        min-width: unset;
        flex: unset;
    }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #999;
}

.close-btn:hover {
    color: var(--text-color);
}