:root {
    --bg-color: #f0f2f5;
    --app-bg: white;
    --text-color: #333;
    --shadow: rgba(0, 0, 0, 0.1);
    --toggle-bg: #e0e0e0;
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --app-bg: #16213e;
    --text-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.4);
    --toggle-bg: #0f3460;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 2rem 0;
    gap: 2rem;
    background-color: var(--bg-color);
    transition: background-color 0.3s;
}

#app {
    text-align: center;
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: background 0.3s, box-shadow 0.3s;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

h1 {
    color: var(--text-color);
    margin: 0;
    transition: color 0.3s;
}

#theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--toggle-bg);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 동물상 테스트 */
#animal-test {
    text-align: center;
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    transition: background 0.3s, box-shadow 0.3s;
}

#animal-test h2 {
    color: var(--text-color);
    margin: 0 0 0.5rem;
    transition: color 0.3s;
}

.animal-desc {
    color: var(--text-color);
    opacity: 0.7;
    margin: 0 0 1.2rem;
    font-size: 0.9rem;
}

#preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

#preview-container canvas {
    border-radius: 10px;
}

#upload-preview {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

#animal-buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

#animal-buttons button,
#animal-buttons label {
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#camera-btn { background-color: #007bff; }
#camera-btn:hover { background-color: #0056b3; }
#upload-btn { background-color: #ff9800; }
#upload-btn:hover { background-color: #e68900; }
#capture-btn { background-color: #28a745; }
#capture-btn:hover { background-color: #1e7e34; }
#retry-btn { background-color: #6c757d; }
#retry-btn:hover { background-color: #545b62; }

#result-container {
    margin-top: 1.2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#result-emoji {
    font-size: 4rem;
    margin-bottom: 0.3rem;
}

#result-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 1rem;
}

#result-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.result-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bar-label {
    color: var(--text-color);
    font-size: 0.85rem;
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0;
}

.dog-bar { background: linear-gradient(90deg, #f6d365, #fda085); }
.cat-bar { background: linear-gradient(90deg, #a18cd1, #fbc2eb); }

.bar-pct {
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: bold;
    width: 42px;
    text-align: left;
    flex-shrink: 0;
}

#result-desc {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* 제휴문의 폼 */
#contact {
    text-align: center;
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    transition: background 0.3s, box-shadow 0.3s;
}

#contact h2 {
    color: var(--text-color);
    margin: 0 0 1.2rem;
    transition: color 0.3s;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#contact-form input,
#contact-form select,
#contact-form textarea {
    padding: 0.7rem 1rem;
    border: 1px solid var(--toggle-bg);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    resize: vertical;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: #007bff;
}

#contact-form button {
    padding: 0.7rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#contact-form button:hover {
    background-color: #0056b3;
}

#form-status {
    margin: 0.8rem 0 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* 댓글 섹션 */
#comments {
    text-align: center;
    background: var(--app-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    transition: background 0.3s, box-shadow 0.3s;
}

#comments h2 {
    color: var(--text-color);
    margin: 0 0 1.2rem;
    transition: color 0.3s;
}