* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #080b12;
    color: #f1f5f9;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 5%;
    border-bottom: 1px solid #1e293b;
    background: #0b1019;
}

.topbar h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.topbar p {
    color: #94a3b8;
    font-size: 14px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #22c55e;
    font-size: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 35px auto;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.hero h2 {
    font-size: 25px;
    margin-bottom: 8px;
}

.hero p {
    color: #94a3b8;
}

button {
    border: none;
    padding: 13px 18px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.card {
    background: #0f1622;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 22px;
}

.card p {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 32px;
    margin-bottom: 8px;
}

.card h3 span {
    color: #64748b;
    font-size: 18px;
}

.card small {
    color: #64748b;
}

.score-card {
    border-color: #2563eb;
}

.grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.panel {
    min-width: 0;
    background: #0f1622;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 18px;
}

.panel-header span {
    color: #22c55e;
    font-size: 12px;
}

.event {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #111827;
    border-left: 4px solid;
}

.event strong {
    font-size: 15px;
}

.event p {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.source-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.event b {
    flex-shrink: 0;
    font-size: 11px;
}

.event.high {
    border-color: #f97316;
}

.event.medium {
    border-color: #eab308;
}

.event.safe {
    border-color: #22c55e;
}

.event {
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
}

.event:hover {
    transform: translateX(4px);
    background: #1e293b;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-bar select {
    background: #111827;
    color: #f1f5f9;
    border: 1px solid #1e293b;
    padding: 8px;
    border-radius: 6px;
    outline: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0f1622;
    padding: 24px;
    border: 1px solid #1e293b;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #94a3b8;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

#modalDetails p {
    margin: 8px 0;
    color: #cbd5e1;
}

#modalDetails h2, #modalDetails h3 {
    margin-bottom: 12px;
}

#modalDetails ul {
    margin-left: 20px;
    margin-top: 8px;
    color: #cbd5e1;
}

/* AI analysis panel */
.analysis {
    text-align: center;
    padding: 35px 15px;
}

.ai-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1e3a8a;
    color: #93c5fd;
    font-weight: bold;
}

.analysis h3 {
    margin-bottom: 10px;
}

.analysis p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Keep recommendation bullets beside the text, not outside the panel */
.analysis ul {
    display: inline-block;
    max-width: 100%;
    margin: 6px auto 0;
    padding-left: 22px;
    list-style-position: inside;
    text-align: left;
}

.analysis li {
    margin: 7px 0;
    line-height: 1.5;
    color: #f1f5f9;
    overflow-wrap: anywhere;
}

footer {
    text-align: center;
    padding: 30px;
    color: #475569;
    font-size: 13px;
}

@media (max-width: 900px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 550px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .container {
        width: 94%;
        margin: 24px auto;
    }

    .panel {
        padding: 16px;
    }

    .event {
        padding: 12px;
    }

    .hero h2 {
        font-size: 22px;
    }
}