/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Roboto:wght@300;400;500;700&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e0e0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 247, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 247, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #00f7ff;
    animation: pulse 2s ease-in-out infinite;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00f7ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 247, 255, 0.5);
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-item i {
    font-size: 1.5rem;
    color: #00f7ff;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-active {
    background: linear-gradient(90deg, #00ff88, #00f7ff);
    color: #0a0e27;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    animation: glow 2s ease-in-out infinite;
}

.badge-inactive {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Panel Base */
.panel {
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(0, 247, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 247, 255, 0.1);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 25px;
    background: rgba(0, 247, 255, 0.05);
    border-bottom: 1px solid rgba(0, 247, 255, 0.2);
}

.panel-header i {
    font-size: 1.5rem;
    color: #00f7ff;
}

.panel-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #00f7ff;
}

.panel-content {
    padding: 25px;
}

/* Video Panel */
.video-panel {
    height: fit-content;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-stack { position: relative; width: 100%; height: 100%; }
#client-video, #server-img { width: 100%; height: 100%; object-fit: cover; display: block; }
#bbox-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.hidden { display: none !important; }

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.video-overlay i {
    font-size: 5rem;
    color: #00f7ff;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.video-overlay p {
    font-size: 1.2rem;
    color: #999;
}

.video-overlay.hidden {
    display: none;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px 25px;
    background: rgba(0, 247, 255, 0.05);
}

.stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 247, 255, 0.2);
}

.stat i {
    font-size: 2rem;
    color: #00f7ff;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00ff88;
    font-family: 'Orbitron', sans-serif;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Control Panel */
.control-panel .panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #00f7ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 247, 255, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #00f7ff;
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(90deg, #00ff88, #00f7ff);
    color: #0a0e27;
    box-shadow: 0 4px 15px rgba(0, 247, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 247, 255, 0.5);
}

.btn-danger {
    background: linear-gradient(90deg, #ff0055, #ff3366);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.5);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(255, 0, 85, 0.5);
    color: #ff0055;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-icon:hover {
    background: rgba(255, 0, 85, 0.1);
    border-color: #ff0055;
}

/* Alert Panel */
.alert-panel {
    flex: 1;
}

.alert-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-list::-webkit-scrollbar {
    width: 8px;
}

.alert-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.alert-list::-webkit-scrollbar-thumb {
    background: rgba(0, 247, 255, 0.3);
    border-radius: 10px;
}

.alert-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 247, 255, 0.5);
}

.no-alerts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-alerts i {
    font-size: 3rem;
    color: #00ff88;
    margin-bottom: 10px;
}

.alert-item {
    padding: 15px;
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

.alert-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.alert-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ff3366;
}

.alert-item-title i {
    font-size: 1.2rem;
}

.alert-item-time {
    font-size: 0.85rem;
    color: #999;
}

.alert-item-body {
    font-size: 0.9rem;
    color: #ccc;
}

.alert-item-details {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    font-size: 0.85rem;
    color: #999;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.alert-modal-content {
    background: rgba(26, 31, 58, 0.95);
    border: 2px solid #ff0055;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 50px rgba(255, 0, 85, 0.5);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    padding: 25px;
    background: rgba(255, 0, 85, 0.1);
    border-bottom: 1px solid rgba(255, 0, 85, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header i {
    font-size: 2.5rem;
    color: #ff0055;
    animation: pulse 1s ease-in-out infinite;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #ff3366;
}

.modal-body {
    padding: 30px 25px;
}

.modal-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.alert-time {
    font-size: 0.95rem;
    color: #999;
}

.modal-footer {
    padding: 25px;
    border-top: 1px solid rgba(255, 0, 85, 0.3);
    display: flex;
    justify-content: center;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .right-panel {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .right-panel {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
}
