/* Shared Premium Theme for ThreatSynop */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0f24;
    --bg-mid: #1c2e4a;
    --glass-bg: rgba(20, 40, 80, 0.4);
    --glass-border: rgba(0, 200, 255, 0.4);
    --glass-glow: rgba(0, 180, 255, 0.15);
    --accent-cyan: #00d4ff;
    --accent-teal: #00b8d4;
    --text-white: #ffffff;
    --text-gray: #8fa3c0;
    --danger: #ff4433;
    --danger-light: #ff6644;
    --warning: #ffa502;
    --purple: #a855f7;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-dark) 100%);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Circuit Board Background */
.bg-circuit {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/bg-circuit.png') center center;
    background-size: cover;
    pointer-events: none;
    z-index: 0;
    animation: pulseBg 8s ease-in-out infinite;
}

@keyframes pulseBg {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, var(--accent-cyan), transparent);
    border-radius: 50%;
    opacity: 0.6;
    animation: floatParticle 10s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 25%;
    left: 85%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    top: 70%;
    left: 20%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    top: 45%;
    left: 75%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    top: 80%;
    left: 60%;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    top: 35%;
    left: 40%;
    animation-delay: 5s;
}

@keyframes floatParticle {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-30px) scale(1.3);
        opacity: 0.8;
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px var(--glass-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px 28px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px var(--glass-glow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0) 0%, rgba(0, 212, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 50px rgba(0, 212, 255, 0.2);
}

.glass-card:hover::before {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0.08) 0%, rgba(0, 212, 255, 0) 70%);
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    margin: 12px 40px;
    padding: 12px 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px var(--glass-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-logo {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.6));
}

.header-nav {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--accent-cyan);
    text-shadow: 0 0 25px var(--accent-cyan);
}

/* Main Layouts */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
    position: relative;
    z-index: 2;
}

.main-layout {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 40px;
    padding: 20px 40px;
    position: relative;
    z-index: 2;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar Styling */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-btn,
.sidebar-item {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px var(--glass-glow);
    color: var(--text-gray);
    text-decoration: none;
}

.sidebar-btn:hover,
.sidebar-item:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 50px rgba(0, 212, 255, 0.3);
    transform: translateX(4px);
    color: var(--text-white);
}

.sidebar-btn.active,
.sidebar-item.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 60px rgba(0, 212, 255, 0.4);
    color: var(--accent-cyan);
}

.sidebar-icon {
    font-size: 1.6rem;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.sidebar-label {
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Content Area */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    color: var(--text-white);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

/* Card Content Standard */
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-summary {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-gray);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.meta-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-cyan);
    font-size: 0.9rem;
}

.timestamp {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Right Panel & Widgets */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px var(--glass-glow);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 100px rgba(0, 212, 255, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-white);
    flex: 1;
    margin-right: 20px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-white);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 80, 80, 0.3);
    border-color: rgba(255, 80, 80, 0.5);
}

.modal-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
    color: var(--bg-dark);
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.modal-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

/* Forms */
input,
select,
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 240px 1fr;
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .main-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .main-layout.with-sidebar {
        /* Specific override for pages with sidebar */
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .sidebar .filter-group {
        display: inline-block;
        width: 48%;
        /* 2 cols on tablet */
        vertical-align: top;
        margin-right: 1%;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
        margin: 10px;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .container,
    .main-layout {
        padding: 10px;
        margin: 10px 0;
    }

    .sidebar .filter-group {
        width: 100%;
        /* 1 col on mobile */
        display: block;
    }

    .results-grid {
        grid-template-columns: 1fr;
        /* Single column cards */
    }

    .search-input {
        font-size: 1rem;
        padding: 12px 15px 12px 40px;
    }
}

/* Utilities */
.grid-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .grid-half {
        grid-template-columns: 1fr;
    }
}