/* Font-face declaration */
@font-face {
    font-family: 'GmarketSans';
    font-style: normal;
    font-weight: 300;
    src: url('./fonts/GmarketSansTTF/GmarketSansTTFLight.ttf') format('truetype');
}

@font-face {
    font-family: 'GmarketSans';
    font-style: normal;
    font-weight: 500;
    src: url('./fonts/GmarketSansTTF/GmarketSansTTFMedium.ttf') format('truetype');
}

@font-face {
    font-family: 'GmarketSans';
    font-style: normal;
    font-weight: 700;
    src: url('./fonts/GmarketSansTTF/GmarketSansTTFBold.ttf') format('truetype');
}

/* General Body Styles */
body {
    font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    background-color: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header and Navigation */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.75rem 5%;
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    box-sizing: border-box;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #5a4bff;
    text-decoration: none;
    white-space: nowrap;
}

.ranking-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ranking-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    cursor: pointer;
    font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.ranking-btn:hover, .ranking-btn.active {
    color: #5a4bff;
    border-color: #5a4bff;
    background-color: rgba(90, 75, 255, 0.05);
}

/* Content Background Section */
.content-background {
    background-color: #f4f4f9;
    width: 100%;
    flex-grow: 1;
    padding: 2rem 0;
}

/* Page Wrapper */
.page-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Main Content Container */
.container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

/* Intro Card */
.intro-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.intro-image {
    width: 100%;
    height: clamp(180px, 40vw, 420px);
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: block;
}

h1 {
    margin-top: 0;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    color: #5a4bff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    color: #555;
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin: 0.5rem 0 0;
    line-height: 1.6;
}

/* Main Button */
.main-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #5a4bff, #8a4bff);
    color: white;
    font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 75, 255, 0.3);
    margin-top: 1.5rem;
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 75, 255, 0.4);
}

.main-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(90, 75, 255, 0.3);
}

.menu-card, #recommendation-text-area {
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 12px;
}

#menu-image {
    width: 100%;
    height: clamp(160px, 30vw, 280px);
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#recommendation-text-area h3 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: #5a4bff;
    margin: 1rem 0 0;
    font-weight: 700;
}

#select-menu-btn {
    width: 40%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #5a4bff, #8a4bff);
    color: white;
    font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 75, 255, 0.3);
    margin-top: 1.5rem;
}

#select-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 75, 255, 0.4);
}

#select-menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(90, 75, 255, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: #f8f9fa;
    color: #888;
    width: 100%;
    font-size: 0.85rem;
    box-sizing: border-box;
    margin-top: auto;
}

footer a {
    color: #666;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    text-align: left;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: #5a4bff;
    margin-top: 0;
    text-align: center;
    font-size: 1.3rem;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-content ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content ul li:last-child {
    border-bottom: none;
}

.modal-content ul li strong {
    color: #333;
}

.modal-content ul li span {
    color: #888;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 4%;
    }

    .content-background {
        padding: 1rem 0;
    }

    .page-wrapper {
        padding: 0 0.75rem;
    }

    .intro-container {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .main-btn {
        padding: 0.9rem 1rem;
        margin-top: 1.25rem;
    }

    #select-menu-btn {
        width: 60%;
        padding: 0.9rem 1rem;
        font-size: clamp(0.95rem, 2.5vw, 1rem);
        margin-top: 1.25rem;
    }

    footer {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ranking-btn {
        padding: 0.35rem 0.55rem;
    }

    .intro-container {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    #select-menu-btn {
        width: 80%;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
}
