:root {
    --primary: #6d28d9;
    --primary-light: #8b5cf6;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --font-inter: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-inter);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.status-badge {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.dot.offline { background: #ef4444; }
.dot.pulse { animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Config Bar */
.config-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Auth & Model Box */
.auth-box, .model-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.auth-box:focus-within, .model-box:focus-within {
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.6);
}

.auth-box input, .model-box select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-inter);
    font-size: 0.875rem;
    width: 100%;
    outline: none;
}

.model-box select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.model-box select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.icon-small {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Upload Area */
.drop-zone {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 2px dashed var(--border);
    border-radius: 24px;
    padding: 4rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.drop-zone:hover, .drop-zone.dragging {
    border-color: var(--primary-light);
    transform: scale(1.02);
    background: rgba(30, 41, 59, 0.9);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-light);
}

.drop-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.drop-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.small-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.progress-bar-wrapper {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    transition: width 0.3s ease;
}

/* Result Section */
.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.result-body {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-main);
    max-height: 400px;
    overflow-y: auto;
}

.result-footer {
    display: flex;
    gap: 2rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Docs Section */
.docs-section {
    width: 100%;
    margin-top: 2rem;
}

.docs-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: left;
}

.docs-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.docs-header i {
    color: var(--primary-light);
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

pre {
    background: #020617;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border);
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.info-box {
    background: rgba(30, 41, 59, 0.4);
    border-left: 4px solid var(--primary-light);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.small {
    font-size: 0.8rem;
    color: var(--text-muted);
}
