:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --secondary-color: #28a745;
    --secondary-hover-color: #1e7e34;
    --danger-color: #dc3545;
    --danger-hover-color: #c82333;
    --background-color: #f8f9fa;
    --container-background: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --light-text-color: #ffffff;
    --border-color: #dee2e6;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --nav-bg: #ffffff;
    --toggle-bg: #f1f3f5;
    --info-box-bg: #e7f1ff;
    --info-box-text: #084298;
}

[data-theme="dark"] {
    --background-color: #121212;
    --container-background: #1e1e1e;
    --text-color: #e9ecef;
    --text-muted: #adb5bd;
    --border-color: #343a40;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --nav-bg: #1e1e1e;
    --toggle-bg: #2b2b2b;
    --info-box-bg: #031633;
    --info-box-text: #cfe2ff;
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Main Container */
.main-content {
    max-width: 800px;
    margin: 6rem auto 3rem;
    padding: 0 1.5rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Card Style */
.card {
    background-color: var(--container-background);
    border-radius: 1rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
}

/* Animal Test Styles */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--toggle-bg);
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

#preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
}

/* Lotto Styles */
.number-display {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    min-height: 60px;
}

.number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* Buttons */
.buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-text {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
}

/* Info Box */
.info-box {
    background-color: var(--info-box-bg);
    color: var(--info-box-text);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.info-box h4 { margin-top: 0; margin-bottom: 0.5rem; }
.info-box p { margin: 0; }

/* History Section */
.history-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

#history-list {
    list-style: none;
    padding: 0;
}

#history-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Form */
.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Footer */
.footer {
    background-color: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
}

.footer p { color: var(--text-muted); font-size: 0.9rem; }
.footer-links { margin-top: 1rem; }
.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.85rem;
}

/* Result Bars */
.result-container { margin-top: 2rem; }
.result-bar-wrapper { margin-bottom: 1rem; }
.result-label { display: flex; justify-content: space-between; margin-bottom: 0.3rem; font-size: 0.9rem; }
.bar-container { background: var(--toggle-bg); height: 12px; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.bar-fill.dog { background: #f39c12; }
.bar-fill.cat { background: #9b59b6; }

/* Theme Toggle */
.theme-toggle {
    background: var(--toggle-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .hero h1 { font-size: 1.75rem; }
    .card { padding: 1.5rem; }
    .nav-links { display: none; }
}