:root {
    /* Dark Mode (Default) */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --tetonam-color: #60a5fa;
    --egennam-color: #f472b6;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 20px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --shadow-deep: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
    --loader-bg: rgba(59, 130, 246, 0.1);
    --tag-bg: #1e293b;
    --retry-bg: #ef4444;
    --retry-hover: #dc2626;
    --hub-bg: #3b82f6;
    --hub-hover: #2563eb;
}

.light-mode {
    /* Light Mode */
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --shadow-deep: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
    --tetonam-color: #1e3a8a;
    --loader-bg: rgba(59, 130, 246, 0.05);
    --tag-bg: #f1f5f9;
    --retry-bg: #e2e8f0;
    --retry-hover: #cbd5e1;
    --hub-bg: #3b82f6;
    --hub-hover: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
}

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

/* Texture overlay */
.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3ClientReference id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Navbar */
.navbar {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-color);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-logo {
    font-size: 1.2rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: 0.1em;
}

/* Side Navigation Links */
.hub-view {
    position: relative;
}

.side-link {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-link.left-link {
    left: 40px;
}

.side-link.right-link {
    right: 40px;
}

.link-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.arrow-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

/* Hover/Touch Animation */
.side-link:hover .arrow-icon,
.side-link:active .arrow-icon {
    transform: scale(1.5);
}

.side-link:hover {
    background: var(--loader-bg);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-deep);
}

@media (max-width: 1200px) {
    .side-link {
        padding: 1rem;
    }
    .link-text {
        display: none; /* Hide text on smaller screens to prevent overlap */
    }
    .side-link.left-link { left: 20px; }
    .side-link.right-link { right: 20px; }
}

/* Romantic Theme (Some & Couple) */
.romantic-view {
    --romantic-primary: #ff5c8d;
    --romantic-secondary: #ff85a1;
    --romantic-accent: #fbb1bd;
    --romantic-bg: linear-gradient(135deg, #fff5f7 0%, #fce4ec 100%);
    --card-bg-romantic: rgba(255, 255, 255, 0.8);
    --text-romantic: #7d1a33;
    --text-romantic-muted: #a35a6d;
}

.romantic-view.test-view {
    background: var(--romantic-bg);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(255, 92, 141, 0.15);
}

.romantic-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 92, 141, 0.15));
    padding: 5rem 2rem;
    border-radius: 40px;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 92, 141, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 92, 141, 0.05);
}

.romantic-view .title {
    background: linear-gradient(135deg, #ff4d6d, #ff85a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.romantic-view .subtitle {
    color: var(--text-romantic);
}

.romantic-view .description {
    color: var(--text-romantic-muted);
}

.romantic-view .test-card {
    background: var(--card-bg-romantic);
    border: 1px solid rgba(255, 92, 141, 0.15);
    backdrop-filter: blur(10px);
}

.romantic-view .card-content h3 {
    color: var(--text-romantic);
}

.romantic-view .card-content p {
    color: var(--text-romantic-muted);
}

.romantic-card:hover {
    border-color: var(--romantic-primary) !important;
    box-shadow: 0 15px 35px rgba(255, 92, 141, 0.2) !important;
    transform: translateY(-8px);
}

.card-icon.romantic {
    background: linear-gradient(135deg, #fff0f3, #ffccd5);
    color: var(--romantic-primary);
    box-shadow: 0 5px 15px rgba(255, 92, 141, 0.1);
}

.status-tag.romantic {
    background: linear-gradient(135deg, var(--romantic-primary), var(--romantic-secondary)) !important;
    box-shadow: 0 4px 10px rgba(255, 92, 141, 0.3);
}

.romantic-view .hub-btn {
    background: linear-gradient(135deg, var(--romantic-secondary), var(--romantic-primary));
    border: none;
    box-shadow: 0 8px 20px rgba(255, 92, 141, 0.3);
}

.romantic-view .hub-btn:hover {
    background: linear-gradient(135deg, var(--romantic-primary), #ff4061);
    transform: translateY(-3px) scale(1.02);
}

/* Custom background for romantic view in dark mode */
body:not(.light-mode) .romantic-view {
    --romantic-bg: linear-gradient(135deg, #3d0c1a 0%, #1a050a 100%);
    --card-bg-romantic: rgba(89, 23, 41, 0.6);
    --text-romantic: #ffccd5;
    --text-romantic-muted: #d68ea0;
    background: var(--romantic-bg);
}

body:not(.light-mode) .romantic-header {
    background: linear-gradient(135deg, rgba(255, 92, 141, 0.1), rgba(0, 0, 0, 0.2));
    border-color: rgba(255, 92, 141, 0.3);
}

.romantic-card:hover {
    border-color: var(--romantic-primary) !important;
    box-shadow: 0 10px 30px rgba(255, 77, 109, 0.2) !important;
}

.card-icon.romantic {
    background: rgba(255, 77, 109, 0.1);
    color: var(--romantic-primary);
}

.status-tag.romantic {
    background: var(--romantic-primary) !important;
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.nav-btn-float {
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.nav-btn-float:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
}

/* Hub View */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.test-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.test-card:hover.active {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-deep);
}

.test-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--loader-bg);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.status-tag {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
}

.status-tag.active {
    background: var(--primary-color);
    color: white;
}

.status-tag.pending {
    background: var(--text-muted);
    color: white;
}

/* View switching */
.hidden {
    display: none !important;
}

.test-view {
    animation: slideUp 0.5s ease-out;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--tetonam-color), var(--egennam-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.description {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-deep);
    transition: transform 0.3s ease;
}

/* Upload Section */
.upload-zone {
    border: 3px dashed var(--text-muted);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--loader-bg);
}

.upload-prompt i {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.upload-prompt h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.upload-prompt p {
    color: var(--text-muted);
}

.preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Scan Line Animation */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.6);
    z-index: 20;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--retry-bg);
    color: white;
}

.secondary-btn:hover {
    background: var(--retry-hover);
    transform: translateY(-2px);
}

.hub-btn {
    background: var(--hub-bg);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.hub-btn:hover {
    background: var(--hub-hover);
    transform: translateY(-2px);
}

.light-mode .secondary-btn {
    color: var(--text-main);
}

.accent-btn {
    background: #10b981;
    color: white;
}

/* Loader */
.loader {
    margin-top: 1.5rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Results Section */
.result-section {
    animation: fadeIn 0.5s ease-out;
}

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

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

.tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: inline-block;
}

.result-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.score-container {
    margin: 2rem 0;
}

.score-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.score-value {
    font-weight: 800;
    font-size: 1.2rem;
}

.result-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 600px) {
    .result-content {
        grid-template-columns: 1fr;
    }
    .title { font-size: 2.5rem; }
}

.result-description h3, .celeb-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.result-description ul {
    list-style: none;
}

.result-description li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-description li::before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
}

.celeb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.celeb-tag {
    background: var(--tag-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

/* Tetonam vs Egennam Result Themes */
.theme-tetonam .tag { background: var(--tetonam-color); }
.theme-tetonam .result-title { color: var(--tetonam-color); }
.theme-tetonam .progress-fill { background: var(--tetonam-color); }

.theme-egennam .tag { background: var(--egennam-color); }
.theme-egennam .result-title { color: var(--egennam-color); }
.theme-egennam .progress-fill { background: var(--egennam-color); }
