/* ============================================
   MetaScrub - Unified Design System
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --color-primary: #6366f1;
    --color-primary-light: #818cf8;
    --color-primary-dark: #4f46e5;
    --color-accent: #a855f7;
    --color-surface: #18181b;
    --color-surface-alt: #09090b;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-text: #f4f4f5;
    --color-text-muted: #a1a1aa;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --radius: 12px;
    --radius-lg: 16px;
}

/* --- Base --- */
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-surface-alt);
    color: var(--color-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
}

/* --- Focus --- */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* --- Text Gradient --- */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glass --- */
.glass-nav {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* --- Card --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

/* --- Button Primary --- */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    font-weight: 700;
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Button Secondary --- */
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

/* --- Progress Bar --- */
.progress-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* --- Form Inputs --- */
.input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.2s;
}

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

.input::placeholder {
    color: var(--color-text-muted);
}

/* --- Select --- */
.select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
}

.select:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--color-primary-light);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

/* --- Code Block --- */
.code-block {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    position: relative;
}

.code-block .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.code-block:hover .copy-btn {
    opacity: 1;
}

/* --- Tabs --- */
.tab {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border: none;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* --- Alert --- */
.alert {
    border-radius: var(--radius);
    padding: 1rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

/* --- Error Page --- */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.error-icon { font-size: 4rem; margin-bottom: 1.25rem; }
.error-icon.warning { color: var(--color-warning); }
.error-icon.danger { color: var(--color-danger); }
.error-icon.info { color: var(--color-primary); }

/* --- Legal Pages --- */
.legal-content {
    color: #d4d4d8;
    line-height: 1.8;
}

.legal-content h2 {
    color: white;
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.legal-content ul {
    list-style: disc inside;
    margin-left: 1rem;
}

.legal-content ul li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-content a:hover {
    color: var(--color-primary);
}

/* --- Feature Card --- */
.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* --- Pricing Card --- */
.pricing-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pricing-card.featured {
    border-color: var(--color-primary);
    border-width: 2px;
}

/* --- Spinner --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spin { animation: spin 1s linear infinite; }

/* --- Responsive helpers --- */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
}
