:root {
    --bg-main: #0a0e1a;
    --bg-card: rgba(18, 25, 44, 0.75);
    --bg-card-hover: rgba(28, 38, 64, 0.85);
    --bg-input: rgba(13, 19, 33, 0.85);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.4);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-purple: #a855f7;

    --glow-primary: rgba(99, 102, 241, 0.25);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
}

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

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

.background-glow {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: floatGlow 14s ease-in-out infinite alternate;
}

.glow-1 { width: 500px; height: 500px; background: var(--accent-primary); top: -100px; left: 10%; }
.glow-2 { width: 450px; height: 450px; background: var(--accent-cyan); bottom: 5%; right: 5%; animation-delay: -5s; }
.glow-3 { width: 350px; height: 350px; background: var(--accent-purple); top: 40%; left: 50%; animation-delay: -9s; }

@keyframes floatGlow {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(60px) scale(1.15); }
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1380px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 32px;
}

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

.brand-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 20px -4px var(--glow-primary);
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-title span {
    font-size: 13px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-primary));
    color: #fff;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
}

.brand-subtitle { font-size: 14px; color: var(--text-muted); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.countdown-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 25, 44, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
}

.pulse-dot {
    width: 8px; height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.countdown-time {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #4338ca);
    color: #fff;
    box-shadow: 0 6px 18px -4px var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px var(--glow-primary);
    background: linear-gradient(135deg, #4f46e5, #3730a3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.icon-teal { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.main-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-layout { grid-template-columns: 1fr; }
}

.section-container {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.section-header { margin-bottom: 20px; }

.section-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.section-desc { font-size: 13px; color: var(--text-muted); }

.badge {
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.live-tag {
    font-size: 11px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    animation: pulseDot 2s infinite;
}

.bots-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bot-card {
    background: rgba(13, 19, 33, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.bot-card:hover {
    border-color: var(--border-active);
    background: rgba(18, 25, 44, 0.85);
    transform: translateY(-2px);
}

.bot-card.status-error { border-left: 4px solid var(--accent-red); }
.bot-card.status-online { border-left: 4px solid var(--accent-green); }
.bot-card.status-pending { border-left: 4px solid var(--accent-amber); }

.bot-main-info { flex: 1; min-width: 0; }

.bot-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.bot-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-url {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
}

.bot-url:hover { color: var(--accent-cyan); text-decoration: underline; }

.bot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.pill-online { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.pill-error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.pill-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.bot-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-dim);
}

.bot-meta span { display: flex; align-items: center; gap: 4px; }

.bot-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-subtle);
}

.icon-btn.btn-delete:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.12);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cloud-info-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.cloud-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cloud-icon { font-size: 22px; }
.cloud-card-header h3 { font-size: 16px; font-weight: 700; }

.cloud-info-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 14px;
}

.cloud-links { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.logs-section { padding: 20px; }

.log-stream {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.log-item {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 9px 12px;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.log-item.success { border-left: 3px solid var(--accent-green); }
.log-item.failed { border-left: 3px solid var(--accent-red); }

.log-left { display: flex; align-items: center; gap: 8px; overflow: hidden; }

.log-code { font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.log-code.code-200 { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.log-code.code-err { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.log-name { color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.log-right {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--text-dim);
    font-size: 11px;
}

.log-duration { color: var(--accent-cyan); }
.log-empty { text-align: center; padding: 30px 10px; color: var(--text-dim); font-size: 13px; }

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
    background: #0f1629;
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 28px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card { transform: scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.modal-header h3 { font-size: 18px; font-weight: 700; }

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
}

.form-hint { display: block; font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: #1e293b;
    color: #fff;
    border: 1px solid var(--border-subtle);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
