:root {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #1c1e21;
    --primary-color: #4dabf7;
    --secondary-color: #adb5bd;
    --accent-color: #ff922b;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-color: #18191a;
    --container-bg: #242526;
    --text-color: #e4e6eb;
    --primary-color: #339af0;
    --secondary-color: #495057;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    background-color: var(--container-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    transition: background-color var(--transition-speed);
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.7;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

/* Dinner Section */
.dinner-section {
    text-align: center;
    margin-bottom: 40px;
}

.menu-display {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(128, 128, 128, 0.05);
    border-radius: 20px;
    margin-bottom: 30px;
    padding: 20px;
}

.menu-placeholder {
    color: var(--secondary-color);
}

.menu-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.recommended-menu {
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-category {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.menu-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.menu-desc {
    font-size: 1rem;
    color: var(--secondary-color);
}

h1 {
    font-size: 1.6rem;
    font-weight: 800;
}

#theme-toggle {
    background: none;
    border: 2px solid var(--secondary-color);
    color: var(--text-color);
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI Test Section */
.ai-test-section {
    margin-bottom: 40px;
}

.upload-container {
    border: 3px dashed var(--secondary-color);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: rgba(128, 128, 128, 0.03);
    position: relative;
    overflow: hidden;
}

.upload-container:hover {
    border-color: var(--primary-color);
    background-color: rgba(77, 171, 247, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-top: -40px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Results */
.result-container {
    margin-top: 30px;
    text-align: center;
}

#result-message {
    font-size: 1.4rem;
    margin-bottom: 25px;
    font-weight: 700;
}

.label-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.animal-label {
    width: 60px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
}

.bar-bg {
    flex-grow: 1;
    height: 12px;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    width: 0%;
    transition: width 1s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.probability-text {
    width: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(128, 128, 128, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-bottom: 15px;
}

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

/* Shared styles */
.retry-btn, .submit-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.retry-btn {
    background-color: var(--secondary-color);
    color: white;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.retry-btn:active, .submit-btn:active { transform: scale(0.98); }

.divider { border: none; border-top: 1px solid var(--secondary-color); opacity: 0.2; margin: 40px 0; }

.contact-section h3, .comment-section h3 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Content Section (SEO & Text) */
.content-section {
    margin-top: 40px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.text-content h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.text-content h3 {
    font-size: 1.1rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.text-content p {
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.9;
}

.text-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.9;
}

.text-content li {
    margin-bottom: 8px;
}

.text-content strong {
    color: var(--primary-color);
}

.contact-form { display: flex; flex-direction: column; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--secondary-color); }
.form-group input, .form-group textarea {
    background-color: rgba(128, 128, 128, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px;
    color: var(--text-color);
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary-color); outline: none; background: none; }

footer { margin-top: 60px; text-align: center; font-size: 0.85rem; color: var(--secondary-color); }

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .container { padding: 25px; }
    h1 { font-size: 1.3rem; }
}
