:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --background: #f8fafc;
    --surface: rgba(255, 255, 255, 0.7);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-deep: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Fonts */
    --font-sans: 'Inter', 'Noto Sans KR', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Texture overlay for premium feel */
body::before {
    content: "";
    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'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Glass Card */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-deep);
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
}

.glass-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.glass-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

#version-log {
    margin-top: 0.5rem;
    font-family: monospace;
    opacity: 0.7;
}

/* Dashboard */
.dashboard {
    animation: fadeIn 0.5s ease-out;
}

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

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.credit-badge {
    background: white;
    padding: 0.5rem 1.2rem;
    border-radius: 99px;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Upload & Form */
.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.drop-zone:hover {
    background: rgba(99, 102, 241, 0.05);
}

.quiz-settings {
    text-align: left;
    margin-bottom: 2rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Quiz Player */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.option {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.option input[type="radio"] {
    width: 20px;
    height: 20px;
}

/* Feedback */
.feedback-area {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.feedback-area.correct {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.feedback-area.incorrect {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.feedback-area .status {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Billing */
.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.plan-card {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.plan-card.featured {
    border: 2px solid var(--primary);
    transform: scale(1.05);
}

.plan-card h3 { margin-bottom: 1rem; }
.plan-card .price { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.plan-card ul { text-align: left; margin-bottom: 2rem; list-style: none; }
.plan-card li { margin-bottom: 0.5rem; color: var(--text-muted); }
.plan-card li::before { content: "✓ "; color: var(--primary); }

/* Utilities */
.hidden { display: none; }
.text-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; }

/* Quiz Enhancements */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease-in-out;
}

.quiz-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.text-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
    margin: 1rem 0;
}

.text-input:focus {
    border-color: var(--primary);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        margin: 2rem 0;
    }
}
