:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --bg-color: #f9f9fb;
    --text-color: #2d3436;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.container {
    width: 95%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

header {
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    color: #636e72;
    font-size: 1.1rem;
}

/* Ad Container */
.ad-container {
    margin: 1.5rem 0;
    min-height: 100px;
    background-color: #fafafa;
    border: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-section {
    margin-bottom: 3rem;
}

.upload-box {
    border: 2px dashed var(--secondary-color);
    border-radius: 20px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fdfdff;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.upload-box:hover {
    background-color: #f0f0ff;
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.upload-box img, #webcam-container canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    object-fit: cover;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 2rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
}

.btn:active {
    transform: scale(0.97);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.primary-btn:hover {
    background-color: #5849c4;
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background-color: #b2bec3;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.secondary-btn {
    background-color: #dfe6e9;
    color: var(--text-color);
}

.section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0));
    margin: 4rem 0;
}

/* Info Sections */
.info-section {
    text-align: left;
    margin-bottom: 4rem;
}

.info-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
}

.info-card {
    background-color: #f8f9fe;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #edf0ff;
}

.info-card p {
    margin-bottom: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.type-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s;
}

.type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.type-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.type-card p {
    font-size: 0.9rem;
    color: #636e72;
}

/* Results */
.result-area {
    margin-top: 2rem;
    padding: 2rem;
    background-color: #fcfcff;
    border-radius: 20px;
    border: 1px solid #f0f0ff;
}

/* Footer */
.footer {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #eee;
    color: #636e72;
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    text-decoration: none;
    color: #636e72;
    font-weight: 600;
}

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

.footer-note {
    font-size: 0.8rem;
    margin-top: 1rem;
    color: #b2bec3;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .nav-menu {
        display: none;
    }
}

/* (Spinner and Bar styles remain same as before or slightly adjusted) */
.loading-spinner { margin: 2rem 0; }
.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 40px; height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.prediction-bar { margin-bottom: 1.2rem; text-align: left; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-weight: 600; }
.bar-outer { height: 14px; background-color: #eee; border-radius: 7px; overflow: hidden; }
.bar-inner { height: 100%; background: linear-gradient(90deg, var(--secondary-color), var(--primary-color)); transition: width 0.6s ease-out; }
