:root {
    /* Color Palette - Premium Dark Theme */
    --bg-color: #0b0f19;
    --card-bg: rgba(22, 30, 46, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.5);

    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);

    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);

    --kakao-yellow: #FEE500;
    --kakao-text: #191919;
    --kakao-hover: #f4dc00;

    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #3b82f6;

    --code-bg: #0f172a;
    --code-header: #1e293b;
    --code-text: #e2e8f0;

    /* Effects */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-x: hidden;
}

/* Ambient Background with subtle moving glow */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: drift 20s infinite alternate ease-in-out;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.8s ease;
}

.logo svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.accent-text {
    color: var(--primary-color);
}

.wizard-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.text-center {
    text-align: center;
}

.inline-block {
    display: inline-block;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Step Management */
.step {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step.transition-leave {
    opacity: 0;
    transform: translateY(-10px);
}

/* Input Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

input[type="url"] {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
    outline: none;
}

input[type="url"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: inherit;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: white;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.primary-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-glow {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.7);
    }

    100% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    }
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    width: auto;
    font-size: 0.875rem;
}

.text-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.kakao-btn {
    background-color: var(--kakao-yellow);
    color: var(--kakao-text);
    width: 100%;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(254, 229, 0, 0.2);
    font-size: 1.05rem;
}

.kakao-btn:hover {
    background-color: var(--kakao-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 229, 0, 0.3);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem 0;
}

.scanner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.document-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 15px 2px var(--primary-color);
    animation: scan 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.loading-pulse {
    animation: pulse-text 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Results */
.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
}

.status-icon svg {
    width: 32px;
    height: 32px;
}

.status-icon.danger {
    background: var(--danger-bg);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-icon.success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInRight 0.5s ease forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bot-info {
    display: flex;
    flex-direction: column;
}

.bot-name {
    font-weight: 600;
    color: var(--text-primary);
}

.bot-company {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bot-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-danger {
    color: var(--danger-color);
}

.status-danger svg {
    width: 16px;
    height: 16px;
}

.status-success {
    color: var(--success-color);
}

.status-success svg {
    width: 16px;
    height: 16px;
}

.action-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Code & CTA Area */
.code-block-container {
    background: var(--code-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    margin-bottom: 2rem;
    text-align: left;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--code-header);
    border-bottom: 1px solid var(--card-border);
}

.code-label {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

pre {
    padding: 1.25rem;
    overflow-x: auto;
    margin: 0;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: var(--code-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.cta-section {
    background: linear-gradient(145deg, rgba(254, 229, 0, 0.05) 0%, rgba(254, 229, 0, 0.02) 100%);
    border: 1px dashed rgba(254, 229, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cta-content {
    margin-bottom: 1.25rem;
}

.cta-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cta-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Animations & Responsive */
@media (max-width: 640px) {
    .wizard-container {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .title {
        font-size: 1.25rem;
    }

    .app-container {
        padding: 0;
    }
}