:root {
    /* --- THEME: OBSIDIAN CARBON (SOFT BLACK) --- */
    
    /* Backgrounds */
    --bg-deep: #050505; /* Black 98% */
    --bg-surface: #0f0f10; /* Dark Grey/Carbon */
    --bg-glass: rgba(15, 15, 16, 0.7);
    --bg-glass-hover: rgba(30, 30, 35, 0.8);
    
    /* Accents */
    --primary: #6366f1; /* Indigo 500 */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #0ea5e9; /* Sky 500 */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    
    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    /* Borders & Effects */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    --glass-blur: 20px;
    --shadow-card: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    /* Fonts */
    --font-ui: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'Fira Code', monospace;
    
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    position: relative;
}

/* Ambient Background Effects */
body::before {
    content: '';
    position: absolute;
    width: 120%; height: 100vh;
    background: 
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 40%);
    top: -10%; left: -10%;
    z-index: -1;
    filter: blur(60px);
}

/* Grid Pattern */
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

/* --- LAYOUT --- */
.app-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 10;
}

/* --- HEADER --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-box {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.logo-box::after {
    content: ''; position: absolute; inset: 0;
    background: var(--accent-gradient);
    opacity: 0.15;
}

.title-text h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.title-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.version-badge {
    background: rgba(99, 102, 241, 0.08);
    color: #818cf8;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.05);
}

/* --- CONTROL GRID --- */
.control-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;
}

@media(max-width: 850px) { .control-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-card);
    transition: transform 0.3s var(--ease-elastic), border-color 0.3s;
}

.card:hover {
    border-color: rgba(255,255,255,0.15);
}

/* Input Section */
.input-area { display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; }

.input-area::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.search-wrapper { position: relative; width: 100%; group; }

.search-wrapper i {
    position: absolute;
    left: 20px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    transition: 0.3s;
    font-size: 1.1rem;
    z-index: 2;
}

input[type="url"] {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0 20px 0 55px;
    color: var(--text-main);
    font-family: var(--font-code);
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

input[type="url"]:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

input[type="url"]:focus + i { color: var(--primary); }

.action-row { display: flex; gap: 12px; align-items: stretch; }

.main-btn {
    flex: 1;
    height: 56px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-family: var(--font-ui);
    font-size: 1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s var(--ease-elastic);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.main-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.main-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5); }
.main-btn:hover::before { left: 150%; }
.main-btn:active { transform: scale(0.98); }

/* Chips */
.chip-container { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 5px; }
.chip {
    font-size: 0.8rem; padding: 8px 16px; border-radius: 10px;
    background: rgba(255,255,255,0.03); color: var(--text-muted);
    cursor: pointer; transition: 0.2s; border: 1px solid transparent;
    font-weight: 500; font-family: var(--font-code);
}
.chip:hover { 
    background: rgba(99, 102, 241, 0.1); 
    color: var(--primary); 
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

/* Stats Section */
.stats-area { 
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    background: linear-gradient(145deg, rgba(20, 20, 23, 0.6), rgba(10, 10, 12, 0.6));
}

.stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; }
.stat-value { font-family: var(--font-code); font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.active-status { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.4); display:flex; align-items:center; gap:6px;}
.active-status::before { content:''; width:6px; height:6px; background:#4ade80; border-radius:50%; }

/* --- TERMINAL OUTPUT --- */
.terminal-card {
    display: flex; flex-direction: column; height: 600px; padding: 0; 
    overflow: hidden; position: relative; border-radius: 20px;
    background: #000000;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.terminal-header {
    padding: 16px 24px; 
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
}

.traffic-lights { display: flex; gap: 8px; }
.light { width: 12px; height: 12px; border-radius: 50%; position:relative;}
.l-red { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.3); }
.l-yellow { background: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.3); }
.l-green { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.3); }

.terminal-title {
    font-family: var(--font-code); font-size: 0.8rem; color: var(--text-dim);
    opacity: 0.7;
}

.terminal-tools { display: flex; gap: 8px; }
.tool-btn {
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
    background: rgba(255,255,255,0.05); color: var(--text-muted); cursor: pointer;
    transition: 0.2s; display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.tool-btn:hover { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.1); }
.tool-btn.danger:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

.editor-wrapper { position: relative; flex: 1; background: #050505; overflow: hidden; }

/* Custom Scrollbar for Editor */
#codeOutput::-webkit-scrollbar { width: 12px; }
#codeOutput::-webkit-scrollbar-track { background: #050505; }
#codeOutput::-webkit-scrollbar-thumb { 
    background: #334155; 
    border: 3px solid #050505; 
    border-radius: 10px; 
}
#codeOutput::-webkit-scrollbar-thumb:hover { background: #475569; }

#codeOutput {
    width: 100%; height: 100%; padding: 30px; background: transparent;
    color: #e2e8f0; border: none; resize: none; font-family: var(--font-code);
    font-size: 0.85rem; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; overflow-y: auto;
}

/* Loading Animation */
.loader-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px); display: none; flex-direction: column;
    align-items: center; justify-content: center; z-index: 20;
}
.loader-overlay.active { display: flex; }
.spinner {
    width: 40px; height: 40px; 
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%; 
    border-top-color: var(--secondary);
    animation: spin 0.8s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
}

/* --- MODERN PROFILE / FOOTER --- */
.dev-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.dev-badge-pro {
    position: relative;
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    padding-right: 30px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s var(--ease-elastic);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.dev-badge-pro:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.3);
    background: rgba(20, 20, 25, 0.9);
}

.dev-avatar {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, #18181b, #09090b);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.dev-avatar i {
    font-size: 1.8rem;
    background: linear-gradient(to bottom right, #25D366, #128C7E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(37, 211, 102, 0.2));
    transition: 0.3s;
}

.dev-info { display: flex; flex-direction: column; z-index: 2; }
.dev-name { font-size: 1rem; font-weight: 700; color: white; letter-spacing: 0.5px; }
.dev-role { 
    font-size: 0.75rem; 
    color: #818cf8; 
    font-weight: 600; 
    letter-spacing: 1px; 
    margin-top: 2px;
    text-transform: uppercase;
}

/* Status & Shine */
.status-indicator { position: absolute; top: 12px; right: 12px; }
.pulse-dot {
    width: 8px; height: 8px; background-color: #22c55e;
    border-radius: 50%; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-green 2s infinite;
}
.shine-effect {
    position: absolute; top: 0; left: -100%; width: 50px; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg); animation: shine 4s infinite; z-index: 1; pointer-events: none;
}

/* --- TOAST --- */
.toast {
    position: fixed; bottom: 40px; left: 50%;
    transform: translate(-50%, 100px); 
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-subtle);
    padding: 14px 24px;
    border-radius: 50px; 
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6); 
    z-index: 100; font-size: 0.95rem; font-weight: 500;
    backdrop-filter: blur(10px);
    transition: 0.4s var(--ease-elastic);
}
.toast.show { transform: translate(-50%, 0); }
.toast i { color: var(--secondary); font-size: 1.1rem; }
.toast.error i { color: #ef4444; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shine { 
    0% { left: -100%; opacity: 0; } 
    50% { opacity: 0.5; } 
    100% { left: 200%; opacity: 0; } 
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
