/* ==========================================
   OMNIPOP ROVING AI
   ========================================== */

:root {
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --light: #f8fafc;
}

/* ==========================================
   CONTAINER
   ========================================== */

.omnipop-container {

    max-width: 1200px;

    margin:
        40px auto;

    padding:
        20px;
}

/* ==========================================
   HERO
   ========================================== */

.omnipop-hero {

    background:
        linear-gradient(
            135deg,
            #1e40af,
            #2563eb
        );

    color:
        white;

    padding:
        50px;

    border-radius:
        15px;

    text-align:
        center;

    margin-bottom:
        30px;
}

.omnipop-hero h1 {

    font-size:
        42px;

    margin-bottom:
        10px;
}

.omnipop-hero p {

    font-size:
        18px;

    opacity:
        0.95;
}



/* ==========================================
   GRID
   ========================================== */

.stats-grid {

    display:
        grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                250px,
                1fr
            )
        );

    gap:
        20px;

    margin-bottom:
        25px;
}

.stat-card {

    background:
        white;

    border-radius:
        12px;

    padding:
        20px;

    text-align:
        center;

    box-shadow:
        0 2px 10px rgba(
            0,
            0,
            0,
            0.08
        );
}

.stat-card h3 {

    margin:
        0;

    color:
        #6b7280;
}

.stat-number {

    font-size:
        42px;

    font-weight:
        bold;

    margin-top:
        10px;

    color:
        var(--primary);
}

/* ==========================================
   STATUS
   ========================================== */

.status-safe {

    color:
        var(--success);

    font-weight:
        bold;
}

.status-warning {

    color:
        var(--warning);

    font-weight:
        bold;
}

.status-danger {

    color:
        var(--danger);

    font-weight:
        bold;
}



/* ==========================================
   THREAT LIST
   ========================================== */

.threat-list {

    list-style:
        none;

    padding:
        0;
}

.threat-list li {

    padding:
        12px;

    margin-bottom:
        10px;

    background:
        #f9fafb;

    border-left:
        4px solid var(--warning);

    border-radius:
        6px;
}

/* ==========================================
   POPUP PREVIEW
   ========================================== */

.popup-preview {

    background:
        #fff7ed;

    border:
        2px solid #f59e0b;

    border-radius:
        12px;

    padding:
        20px;

    margin-top:
        20px;
}

.popup-preview h3 {

    color:
        #b45309;

    margin-top:
        0;
}

/* ==========================================
   FOOTER
   ========================================== */

.omnipop-footer {

    text-align:
        center;

    margin-top:
        40px;

    color:
        #6b7280;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (
    max-width: 768px
) {

    .omnipop-hero h1 {

        font-size:
            30px;
    }

    .stat-number {

        font-size:
            30px;
    }

}

/* ==========================================
   OMNIPOP ROVING AI MASCOT WIDGET
   ========================================== */

#omnipop-mascot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000000;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

#omnipop-mascot-container.roving {
    transition: left 2.5s ease-in-out, top 2.5s ease-in-out;
}

#omnipop-mascot-container:active {
    cursor: grabbing;
}

/* Mascot Wrapper with Floating Animation */
.mascot-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: omnipop-float 4s ease-in-out infinite;
}

/* Mascot Avatar Image */
.mascot-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid rgba(59, 130, 246, 0.8); /* Cyan/Blue border default */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    background: #0f172a;
    object-fit: cover;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Dynamic State Colors for Mascot Border & Shadows */
#omnipop-mascot-container.state-safe .mascot-avatar {
    border-color: rgba(16, 185, 129, 0.8); /* Green */
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

#omnipop-mascot-container.state-warning .mascot-avatar {
    border-color: rgba(245, 158, 11, 0.8); /* Orange */
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

#omnipop-mascot-container.state-danger .mascot-avatar,
#omnipop-mascot-container.state-critical .mascot-avatar {
    border-color: rgba(239, 68, 68, 0.9); /* Red */
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
    animation: omnipop-shake 0.3s ease-in-out infinite;
}

#omnipop-mascot-container.state-scanning .mascot-avatar {
    border-color: rgba(139, 92, 246, 0.8); /* Purple scanning */
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

/* Outer Pulsing Glow Rings */
.omnipop-pulse-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.4);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    animation: omnipop-pulse-cyan 3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

#omnipop-mascot-container.state-safe .omnipop-pulse-ring {
    border-color: rgba(16, 185, 129, 0.4);
    animation-name: omnipop-pulse-green;
}

#omnipop-mascot-container.state-warning .omnipop-pulse-ring {
    border-color: rgba(245, 158, 11, 0.4);
    animation-name: omnipop-pulse-orange;
}

#omnipop-mascot-container.state-danger .omnipop-pulse-ring,
#omnipop-mascot-container.state-critical .omnipop-pulse-ring {
    border-color: rgba(239, 68, 68, 0.5);
    animation-name: omnipop-pulse-red;
}

#omnipop-mascot-container.state-scanning .omnipop-pulse-ring {
    border-color: rgba(139, 92, 246, 0.5);
    animation: omnipop-pulse-purple 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Glassmorphic Speech Bubble */
.omnipop-speech-bubble {
    position: absolute;
    bottom: 95px;
    width: 250px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    color: #f1f5f9;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.omnipop-speech-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.omnipop-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: calc(50% - 6px);
    width: 12px;
    height: 12px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

.omnipop-speech-bubble .bubble-header {
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#omnipop-mascot-container.state-safe .omnipop-speech-bubble .bubble-header {
    color: #10b981;
}

#omnipop-mascot-container.state-warning .omnipop-speech-bubble .bubble-header {
    color: #f59e0b;
}

#omnipop-mascot-container.state-danger .omnipop-speech-bubble .bubble-header,
#omnipop-mascot-container.state-critical .omnipop-speech-bubble .bubble-header {
    color: #ef4444;
}

#omnipop-mascot-container.state-scanning .omnipop-speech-bubble .bubble-header {
    color: #a78bfa;
}

/* Close/Minimize button for Mascot */
.mascot-close-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#omnipop-mascot-container:hover .mascot-close-btn {
    opacity: 1;
}

.mascot-close-btn:hover {
    background: #ef4444;
    color: white;
}

/* Settings button for Mascot */
.mascot-settings-btn {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#omnipop-mascot-container:hover .mascot-settings-btn {
    opacity: 1;
}

.mascot-settings-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Control Panel Modal */
.mascot-panel {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    padding: 20px;
    width: 280px;
    color: white;
    position: absolute;
    bottom: 95px;
    display: none;
    z-index: 100;
}

.mascot-panel.active {
    display: block;
}

.mascot-panel h3 {
    margin-top: 0;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    color: #3b82f6;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mascot-panel-close {
    cursor: pointer;
    font-size: 14px;
    color: #94a3b8;
}

.mascot-panel-close:hover {
    color: white;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    font-size: 0.85rem;
}

/* Custom Toggle Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2563eb;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Mascot Keyframes Animations */
@keyframes omnipop-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes omnipop-shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes omnipop-pulse-cyan {
    0% {
        transform: scale(0.85);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes omnipop-pulse-green {
    0% {
        transform: scale(0.85);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes omnipop-pulse-orange {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes omnipop-pulse-red {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes omnipop-pulse-purple {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}