:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    /* Reduced for sleekness */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: #6366f1;
    /* Indigo/purple vibes */
    --accent-glow-2: #c026d3;
    /* Fuchsia */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 1rem;
}

/* Animated Background Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    opacity: 0.5;
    animation: orbFloat 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: var(--accent-glow);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 40vw;
    height: 40vw;
    background: var(--accent-glow-2);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 30vw;
    height: 30vw;
    background: #0ea5e9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(5vw, 5vh) scale(1.1);
    }

    100% {
        transform: translate(-5vw, 10vh) scale(0.9);
    }
}

/* Dashboard Wrapper */
.dashboard-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1050px;
    animation: fadeUpIn 1s ease-out;
}

@keyframes fadeUpIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 2.5rem 3rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-logo {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sync-timer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.sync-timer i {
    font-size: 0.75rem;
    color: var(--accent-glow);
    animation: rotateIcon 4s linear infinite;
}

@keyframes rotateIcon {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#countdownTimer {
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.timer-divider {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 0.25rem;
}

.force-sync-btn {
    background: rgba(99, 102, 241, 0.15);
    /* Indigo tint */
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    /* Light indigo */
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.force-sync-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    transform: translateY(-1px);
}

.force-sync-btn:active {
    transform: translateY(0);
}

.force-sync-btn i {
    font-size: 0.75rem;
    color: #818cf8;
}

.force-sync-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.force-sync-btn.loading i {
    animation: rotateIcon 1s linear infinite;
}

.force-sync-btn.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.force-sync-btn.success i {
    color: #34d399;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.pulse-dot.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulseObj 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.pulse-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.pulse-dot.error {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

@keyframes pulseObj {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-text {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

/* Main Content Area */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2.5rem;
    align-items: stretch;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Stat Cards */
.card-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: #e2e8f0;
    transition: background 0.3s;
}

.glass-card:hover .card-icon {
    background: rgba(255, 255, 255, 0.1);
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.domain-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
    word-break: break-all;
}

.domain-value i {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.domain-value:hover {
    color: #38bdf8;
}

.highlight-val {
    color: #38bdf8;
}

.success-val {
    color: var(--success);
}

.domain-card {
    grid-column: span 2;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

.domain-card .card-icon {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.domain-card:hover .card-icon {
    background: rgba(56, 189, 248, 0.25);
}

/* Graphic Section */
.graphic-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 24px;
    position: relative;
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

.bot-3d-model {
    max-width: 90%;
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.5));
    animation: float-bot 6s infinite ease-in-out;
}

@keyframes float-bot {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px) rotate(1deg);
    }

    100% {
        transform: translateY(0);
    }
}

/* Responsiveness */
@media (max-width: 860px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .graphic-section {
        order: -1;
        padding: 3rem 0;
        min-height: 300px;
    }

    .bot-3d-model {
        max-height: 220px;
    }
}

@media (max-width: 560px) {
    .glass-panel {
        padding: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .domain-card {
        grid-column: span 1;
    }

    .dash-header {
        flex-direction: column;
        gap: 1.25rem;
        align-items: flex-start;
    }
}