:root {
    --bg-color: #f8f9fa;
    --container-bg: #ffffff;
    --text-color: #212529;
    --primary-color: #4CAF50;
    --secondary-color: #007bff;
    --accent-color: #e83e8c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.95);
}

body.dark-mode {
    --bg-color: #121212;
    --container-bg: #1e1e1e;
    --text-color: #e9ecef;
    --primary-color: #66bb6a;
    --secondary-color: #339af0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(30, 30, 30, 0.95);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.4s, color 0.4s;
    line-height: 1.6;
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--nav-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.theme-toggle-nav button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Container & Sections */
.container {
    max-width: 1000px;
    margin: 80px auto 0;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    padding: 4rem 0;
}

.hero-section h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-desc {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

.section {
    background-color: var(--container-bg);
    padding: 4rem 3rem;
    border-radius: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 4rem;
    text-align: center;
}

h2 {
    color: var(--secondary-color);
    font-size: 2.2rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Quotes */
#quote-container { min-height: 140px; margin-bottom: 2rem; }
.quote-text { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.8rem; }
.quote-subtext { font-size: 1.2rem; opacity: 0.8; margin-bottom: 0.8rem; }
.quote-author { font-size: 1.1rem; color: var(--accent-color); font-weight: bold; }

/* Roulette Layout */
.main-layout {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.roulette-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    margin-bottom: 20px;
}

#roulette-canvas { width: 100%; height: 100%; }

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    color: var(--accent-color);
    z-index: 5;
}

/* Result Side */
.result-side { flex: 1; min-width: 300px; text-align: center; }
#selected-result {
    background: rgba(0,0,0,0.03);
    padding: 25px;
    border-radius: 24px;
    margin-bottom: 20px;
}

body.dark-mode #selected-result { background: rgba(255,255,255,0.05); }

#selected-menu-name { font-size: 1.8rem; color: var(--primary-color); margin-bottom: 15px; }

#food-image-container img {
    width: 100%;
    max-width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Insights Section */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.insight-card {
    text-align: left;
    padding: 2rem;
    background: rgba(0,0,0,0.02);
    border-radius: 24px;
    transition: transform 0.3s;
}

body.dark-mode .insight-card { background: rgba(255,255,255,0.03); }

.insight-card:hover { transform: translateY(-5px); }

.insight-card h3 { margin-bottom: 1rem; color: var(--text-color); }
.insight-card p { font-size: 0.95rem; opacity: 0.8; margin-bottom: 1.5rem; }
.read-more { color: var(--secondary-color); text-decoration: none; font-weight: 700; }

/* Animal Test */
.upload-box {
    width: 100%;
    max-width: 500px;
    height: 220px;
    border: 3px dashed var(--secondary-color);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.result-bar-bg { width: 100%; height: 24px; background: #e9ecef; border-radius: 12px; overflow: hidden; }
body.dark-mode .result-bar-bg { background: #333; }
.result-bar-fill { height: 100%; background: var(--primary-color); transition: width 1s ease-out; }
.result-bar-fill.dog { background-color: #ffc107; }
.result-bar-fill.cat { background-color: #17a2b8; }

/* Contact Form */
#contact-form { max-width: 600px; margin: 0 auto; text-align: left; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.02);
    color: var(--text-color);
    font-family: inherit;
}

/* Footer */
footer {
    background-color: var(--container-bg);
    padding: 4rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links { display: flex; gap: 2rem; }
.footer-links a { text-decoration: none; color: var(--text-color); opacity: 0.7; }

/* Modal */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: var(--container-bg); margin: 10% auto; padding: 3rem; border-radius: 32px; max-width: 600px; position: relative; }
.close { position: absolute; right: 20px; top: 20px; font-size: 2rem; cursor: pointer; }

/* Buttons */
button {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 16px;
    background-color: var(--secondary-color);
    color: white;
    transition: all 0.3s;
}

button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 1rem; }
    .nav-links { gap: 1rem; font-size: 0.8rem; }
    .hero-section h1 { font-size: 2rem; }
    .section { padding: 2rem 1.5rem; }
    .roulette-wrapper { width: 300px; height: 300px; }
}
