:root {
    --background-color: #f0f2f5;
    --main-accent-color: #4a90e2;
    --text-color: #333;
    --white-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: 'Noto Sans KR', sans-serif;
    --toggle-bg: #fff;
    --toggle-color: #333;
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --main-accent-color: #64b5f6;
    --text-color: #e0e0e0;
    --white-color: #2c2c2c;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --toggle-bg: #333;
    --toggle-color: #fff;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    background-color: var(--toggle-bg);
    color: var(--toggle-color);
    border: 2px solid var(--main-accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

main {
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--main-accent-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0.8;
}

#test-container {
    background-color: var(--white-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px var(--shadow-color);
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#upload-area {
    border: 2px dashed var(--main-accent-color);
    border-radius: 0.5rem;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#upload-area:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

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

#image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#result-area {
    margin-top: 2rem;
    text-align: left;
}

#result-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--main-accent-color);
}

.result-bar-container {
    margin-bottom: 1rem;
}

.result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.result-bar-bg {
    background-color: #eee;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

[data-theme="dark"] .result-bar-bg {
    background-color: #444;
}

.result-bar-fill {
    height: 100%;
    background-color: var(--main-accent-color);
    transition: width 0.5s ease-out;
}

#retry-btn {
    width: 100%;
    background-color: #aaa;
    color: var(--white-color);
    font-size: 1rem;
    font-weight: bold;
    padding: 0.8rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background-color 0.3s;
}

#retry-btn:hover {
    background-color: #888;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--main-accent-color);
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-spinner {
    margin-top: 2rem;
}

#contact-section {
    background-color: var(--white-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px var(--shadow-color);
    max-width: 500px;
    margin: 0 auto 3rem auto;
    text-align: left;
}

#contact-section h2 {
    text-align: center;
    color: var(--main-accent-color);
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    box-sizing: border-box;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    border-color: #444;
}

#submit-btn {
    width: 100%;
    background-color: var(--main-accent-color);
    color: var(--white-color);
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.8rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#submit-btn:hover {
    opacity: 0.9;
}

#comments-section {
    background-color: var(--white-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px var(--shadow-color);
    max-width: 800px;
    margin: 0 auto;
}
