/* 
 * ODS VTU Bot Dashboard - CSS Design System
 * Space Dark Glassmorphic Design System with HSL Neon Highlights.
 */

:root {
    --bg-dark: #0a0b10;
    --bg-card: rgba(18, 20, 30, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f2f6;
    --text-secondary: #a0a5c0;
    
    /* Neon highlights */
    --neon-cyan: #00f0ff;
    --neon-green: #00e676;
    --neon-orange: #ffb300;
    --neon-red: #ff3366;
    
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    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;
    overflow-x: hidden;
    position: relative;
    padding: 2.5rem 1rem;
}

/* BACKGROUND ORBS & EFFECTS */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: radial-gradient(circle at 50% 50%, #151624 0%, var(--bg-dark) 100%);
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    z-index: -2;
    opacity: 0.23;
}

.orb-1 {
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-cyan) 0%, rgba(0,0,0,0) 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-red) 0%, rgba(0,0,0,0) 70%);
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* HEADER STYLE */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.pulse-ring {
    width: 50px;
    height: 50px;
    background: rgba(0, 240, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--neon-cyan);
}

.dashboard-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.accent-text {
    background: linear-gradient(135deg, var(--neon-cyan) 30%, var(--neon-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.clock-display {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
}

.status-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Pulse Animations based on states */
.status-pulse.offline {
    background-color: var(--neon-red);
    box-shadow: 0 0 10px var(--neon-red);
}

.status-pulse.initializing {
    background-color: var(--neon-orange);
    box-shadow: 0 0 10px var(--neon-orange);
    animation: pulse 1.5s infinite;
}

.status-pulse.qr_scan {
    background-color: var(--neon-orange);
    box-shadow: 0 0 10px var(--neon-orange);
    animation: pulse 1.5s infinite;
}

.status-pulse.ready {
    background-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 2s infinite;
}

.status-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* CARDS STYLING */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    padding: 1.8rem;
    transition: var(--transition-smooth);
}

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

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.card-icon {
    color: var(--neon-cyan);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

/* GRID SETUP */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
}

.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-column {
    display: flex;
    flex-direction: column;
}

/* BUTTONS */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.btn-start {
    background: linear-gradient(135deg, #00f0ff 0%, #0080ff 100%);
    color: #05060b;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4);
}

.btn-stop {
    background: rgba(255, 51, 102, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(255, 51, 102, 0.25);
}

.btn-stop:hover:not(:disabled) {
    background: var(--neon-red);
    color: #05060b;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
    transform: translateY(-2px);
}

.btn-disconnect {
    background: rgba(255, 179, 0, 0.1);
    color: var(--neon-orange);
    border: 1px solid rgba(255, 179, 0, 0.25);
}

.btn-disconnect:hover:not(:disabled) {
    background: var(--neon-orange);
    color: #05060b;
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* QR CONTAINER & STATES */
.qr-box-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.qr-placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.placeholder-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.15);
}

.spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.qr-scan-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

#qrCanvas {
    background: #ffffff;
    padding: 0.8rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    max-width: 200px;
    max-height: 200px;
}

.scan-instructions {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 220px;
    line-height: 1.4;
}

/* SUCCESS CHECKMARK ANIMATION */
.qr-connected-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.qr-connected-state h3 {
    font-size: 1.2rem;
    color: var(--neon-green);
    margin-top: 0.5rem;
}

.qr-connected-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 220px;
}

.success-checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 60px;
    height: 60px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--neon-green);
}

.success-checkmark .check-icon::before, 
.success-checkmark .check-icon::after {
    content: '';
    position: absolute;
    background: rgba(0,0,0,0);
}

.success-checkmark .check-icon .icon-circle {
    top: -4px;
    left: -4px;
    position: absolute;
    box-sizing: content-box;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(0, 230, 118, 0.1);
    z-index: 2;
}

.success-checkmark .check-icon .icon-line {
    height: 5px;
    background-color: var(--neon-green);
    display: block;
    position: absolute;
    z-index: 10;
    border-radius: 2px;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 31px;
    left: 11px;
    width: 17px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 26px;
    right: 9px;
    width: 30px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 10px; left: 5px; top: 25px; }
    84% { width: 17px; left: 11px; top: 31px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 35px; top: 44px; }
    65% { width: 0; right: 35px; top: 44px; }
    84% { width: 18px; right: 23px; top: 33px; }
    100% { width: 30px; right: 9px; top: 26px; }
}

/* REALTIME LOGS TERMINAL */
.console-card {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.console-header {
    background: rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 19px;
    border-top-right-radius: 19px;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.window-controls .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.window-controls .dot.red { background-color: #ff5f56; }
.window-controls .dot.yellow { background-color: #ffbd2e; }
.window-controls .dot.green { background-color: #27c93f; }

.console-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-clear:hover {
    color: var(--text-primary);
}

.console-body {
    background: rgba(5, 5, 8, 0.7);
    flex-grow: 1;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 1.2rem;
    overflow-y: auto;
    max-height: 380px;
    border-bottom-left-radius: 19px;
    border-bottom-right-radius: 19px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Log lines styling */
.log-line {
    word-break: break-all;
    white-space: pre-wrap;
    color: #c7cbdc;
}

.log-line.system-line {
    color: var(--neon-cyan);
}

.log-line.error-line {
    color: var(--neon-red);
}

.log-line.success-line {
    color: var(--neon-green);
}

.log-line.message-line {
    color: #e2a8ff;
}

/* Custom Scrollbar for console and scroll wrappers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* USER LISTING DASHBOARD */
.users-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.users-badge {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
    background: rgba(0, 0, 0, 0.2);
}

th, td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-glass);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.35);
}

tr:last-child td {
    border-bottom: none;
}

tr.empty-row td {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

td .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff 0%, #00e676 100%);
    color: #05060b;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.85rem;
}

.name-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

.timestamp-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.platform-badge {
    background: rgba(0, 230, 118, 0.1);
    color: var(--neon-green);
    border: 1px solid rgba(0, 230, 118, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* UTILITY CLASSES */
.hidden {
    display: none !important;
}

/* RESPONSIVENESS */
@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    body {
        padding: 1rem 0.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1.2rem;
        text-align: center;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
}
