:root {
    --bg-color: #f4f4f4;
    --container-bg: #ffffff;
    --text-color: #333333;
    --button-bg: #e0e0e0;
    --button-text: #333333;
    --button-hover: #d0d0d0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --container-bg: #1e1e1e;
    --text-color: #ffffff;
    --button-bg: #333333;
    --button-text: #ffffff;
    --button-hover: #444444;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    border-radius: 15px;
    background-color: var(--container-bg);
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-switch-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

#theme-toggle {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin: 0;
}

h1 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    letter-spacing: 1px;
}

.buttons {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 1rem 2rem;
    margin: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

button:hover {
    background-color: var(--button-hover);
    transform: translateY(-3px);
}

#player {
    margin: 2rem auto;
    width: 100%;
    max-width: 640px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#song-title {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 24px;
}

.animal-test-section {
    margin: 2rem 0;
    padding: 1rem;
}

.animal-test-section h2 {
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
}

.upload-container {
    border: 2px dashed var(--button-bg);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
}

.upload-container:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.upload-label {
    cursor: pointer;
}

#upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
}

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

.hidden {
    display: none;
}

#loading {
    margin: 2rem 0;
    font-weight: bold;
    color: #007bff;
}

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

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

#result-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    height: 30px;
    width: 100%;
    background-color: #eee;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    transition: width 1s ease-in-out;
}

.progress-bar.dog {
    background-color: #ffca28; /* 강아지 - 노랑/주황 */
}

.progress-bar.cat {
    background-color: #42a5f5; /* 고양이 - 파랑 */
}

.labels {
    display: flex;
    justify-content: space-around;
    font-weight: bold;
    margin-bottom: 2rem;
}

.reset-btn {
    background-color: #6c757d;
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
}

.divider {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--button-bg);
}

.contact-section {
    margin-top: 1rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--button-bg);
    background-color: var(--container-bg);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
    border-color: #555;
}

textarea {
    height: 120px;
    resize: none;
}

.submit-btn {
    width: 100%;
    margin-top: 0.5rem;
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.comments-section {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #ffffff; /* Disqus looks best on light background, or we can let it auto-theme */
    border-radius: 10px;
}

[data-theme="dark"] .comments-section {
    background-color: transparent;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    button {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    #song-title {
        font-size: 1rem;
    }
}
