/* =========================================
   Message Guard – Finalized Styles
   (NO UI / UX CHANGES)
   ========================================= */

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
}

/* ---------- Animated Background (Dashboard Parity) ---------- */
.mega-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(120,119,198,.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(88,86,214,.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(138,43,226,.2), transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(72,219,251,.2), transparent 50%),
        linear-gradient(135deg, #000000 0%, #0a0015 50%, #000520 100%);
    animation: bgPulse 20s ease infinite;
}

@keyframes bgPulse {
    0%,100% { opacity: 1; }
    50% { opacity: .8; }
}

/* ---------- Particles & Orbs ---------- */
.particle-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .5;
    pointer-events: none;
    z-index: 2;
    animation: orbFloat 30s infinite ease-in-out;
}

.orb1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7877c6, #5856d6);
    top: -15%;
    left: -10%;
}

.orb2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8a2be2, #9d4edd);
    bottom: -10%;
    right: -5%;
    animation-delay: 10s;
}

.orb3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #48dbfb, #0abde3);
    top: 40%;
    right: 5%;
    animation-delay: 20s;
}

@keyframes orbFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(80px,-80px) scale(1.15); }
    66% { transform: translate(-60px,60px) scale(.95); }
}

/* ---------- Grid Overlay ---------- */
.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(138,43,226,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138,43,226,.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 2;
    pointer-events: none;
}

/* ---------- App Layout ---------- */
#app-root {
    position: relative;
    z-index: 3;
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar (Same as Dashboard) ---------- */
.sidebar {
    width: 280px;
    background: rgba(255,255,255,.03);
    backdrop-filter: blur(30px) saturate(180%);
    border-right: 1px solid rgba(138,43,226,.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(138,43,226,.2);
}

.logo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(138,43,226,.8);
}

.sidebar-nav {
    flex: 1;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 15px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all .3s ease;
}

.nav-item:hover {
    background: rgba(138,43,226,.1);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(138,43,226,.2), rgba(72,219,251,.1));
    color: #fff;
    border: 1px solid rgba(138,43,226,.3);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(138,43,226,.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(138,43,226,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 12px;
    color: rgba(255,255,255,.5);
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 40px;
}

/* ---------- Header ---------- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(138,43,226,.6);
    margin-bottom: 8px;
}

.page-subtitle {
    color: rgba(255,255,255,.6);
    font-size: 16px;
}

/* ---------- Status Pill ---------- */
.status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(17,153,142,.1);
    border: 1px solid rgba(17,153,142,.3);
    border-radius: 25px;
}

.status-text {
    font-weight: 600;
    font-size: 14px;
    color: #38ef7d;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #38ef7d;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(56,239,125,.7); }
    50% { box-shadow: 0 0 0 10px rgba(56,239,125,0); }
}

.header-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(138,43,226,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.header-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(138,43,226,.4);
    transform: translateY(-2px);
}

/* ---------- Guard Content ---------- */
.guard-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ---------- Cards ---------- */
.scan-card,
.result-card,
.activity-card {
    background: rgba(255,255,255,.03);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(138,43,226,.3);
    border-radius: 25px;
    padding: 35px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
}

.card-badge {
    padding: 8px 16px;
    background: rgba(138,43,226,.2);
    border: 1px solid rgba(138,43,226,.4);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scan-description {
    color: rgba(255,255,255,.7);
    line-height: 1.6;
    font-size: 15px;
}

/* ---------- PREMIUM TEXTAREA STYLING ---------- */
.scan-textarea {
    width: 100%;
    min-height: 180px;
    padding: 1.25rem;
    border: 2px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #e0e7ff;
    font-size: 0.95rem;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.scan-textarea:focus {
    outline: none;
    border-color: rgba(138, 43, 226, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.2);
    transform: translateY(-2px);
}

.scan-textarea::placeholder {
    color: rgba(224, 231, 255, 0.4);
    font-size: 0.9rem;
}

/* ---------- PREMIUM BUTTON STYLING ---------- */
.scan-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.scan-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.scan-button:hover::before {
    left: 100%;
}

.scan-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
}

.scan-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
}

.scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.button-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ---------- Result Card ---------- */
.result-card.hidden {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.result-title {
    font-size: 22px;
    font-weight: 700;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-section {
    padding: 20px;
    background: rgba(255,255,255,.02);
    border-radius: 12px;
    border: 1px solid rgba(138,43,226,.2);
}

.result-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255,255,255,.8);
}

.result-text {
    color: rgba(255,255,255,.7);
    line-height: 1.6;
}

/* ---------- Risk Badges ---------- */
.risk-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.risk-badge.high-risk,
.risk-badge.highrisk,
.risk-badge.high {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.risk-badge.suspicious,
.risk-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.risk-badge.safe,
.risk-badge.low {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

/* ---------- PERFECT TABLE ALIGNMENT ---------- */
.activity-table-container {
    overflow-x: auto;
}

.activity-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.activity-table thead th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(224, 231, 255, 0.8);
    border-bottom: 2px solid rgba(138, 43, 226, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.activity-table tbody td {
    padding: 1.1rem 1.25rem;
    font-size: 0.9rem;
    color: #e0e7ff;
    border-bottom: 1px solid rgba(138, 43, 226, 0.15);
    vertical-align: middle;
}

.activity-table tbody tr {
    transition: all 0.2s ease;
}

.activity-table tbody tr:hover {
    background: rgba(138, 43, 226, 0.08);
}

/* Better badge alignment */
.channel-badge,
.action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.channel-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.action-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Risk level badges - better alignment */
.risk-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.risk-level.low,
.risk-level.safe {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.risk-level.suspicious,
.risk-level.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.risk-level.highrisk,
.risk-level.high {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 32px;
    }
    
    .scan-button {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================================
   AI DIGITAL IMMUNE SYSTEM - ALERT UX STYLES
   =============================================== */

#scam-alert-container {
    margin: 2rem 0;
    display: none;
}

.alert-ux {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* GREEN ALERT - SAFE */
.alert-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 5px solid #22c55e;
}

.alert-green .alert-icon {
    color: #16a34a;
    width: 28px;
    height: 28px;
}

.alert-green .alert-title {
    color: #166534;
    font-size: 1.25rem;
    font-weight: 700;
}

.alert-green .alert-description {
    color: #15803d;
    font-size: 0.95rem;
    margin: 0.75rem 0 1rem 0;
}

.alert-green-action {
    background: #dcfce7;
    border: 2px solid #86efac;
}

/* ORANGE ALERT - SUSPICIOUS */
.alert-orange {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 5px solid #f59e0b;
}

.alert-orange .alert-icon {
    color: #d97706;
    width: 28px;
    height: 28px;
}

.alert-orange .alert-title {
    color: #92400e;
    font-size: 1.25rem;
    font-weight: 700;
}

.alert-orange .alert-description {
    color: #b45309;
    font-size: 0.95rem;
    margin: 0.75rem 0 1rem 0;
}

.alert-orange-action {
    background: #fef3c7;
    border: 2px solid #fcd34d;
}

.alert-keyword-orange {
    background: #fcd34d;
    color: #92400e;
}

/* RED ALERT - HIGH RISK */
.alert-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 6px solid #dc2626;
}

.alert-red .alert-icon {
    color: #dc2626;
    width: 32px;
    height: 32px;
}

.alert-red .alert-title {
    color: #991b1b;
    font-size: 1.4rem;
    font-weight: 800;
}

.alert-red .alert-description {
    color: #b91c1c;
    font-size: 1rem;
    margin: 0.75rem 0 1rem 0;
}

.alert-description-bold {
    font-weight: 600;
}

.alert-red-info {
    border: 2px solid #fca5a5;
}

.alert-red-action {
    background: #fee2e2;
    border: 3px solid #fca5a5;
}

.alert-keyword-red {
    background: #fca5a5;
    color: #991b1b;
}

/* SHARED ALERT COMPONENTS */
.alert-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.alert-title {
    margin: 0;
    line-height: 1.3;
}

.alert-section {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
}

.alert-info-box {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.alert-action-box {
    border-radius: 8px;
}

.alert-help-box {
    background: #fee2e2;
    border: 2px solid #dc2626;
}

.alert-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
}

.alert-bold {
    font-weight: 800;
}

.alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alert-list li {
    font-size: 0.9rem;
    color: #374151;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.alert-text {
    font-size: 0.9rem;
    color: #374151;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.alert-emphasis {
    font-weight: 600;
    color: #1f2937;
}

.alert-critical-actions {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #fca5a5;
}

.alert-safe-actions {
    margin-top: 1rem;
}

.alert-critical-actions .alert-text,
.alert-safe-actions .alert-text {
    font-size: 0.95rem;
    margin: 0.75rem 0;
}

/* EXPAND BUTTON */
.alert-expand-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    margin: 1rem 0 0.5rem 0;
    transition: opacity 0.2s;
}

.alert-expand-btn:hover {
    opacity: 0.7;
}

.alert-orange .alert-expand-btn {
    color: #b45309;
}

.alert-red .alert-expand-btn {
    color: #dc2626;
}

.expand-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.alert-expandable {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    animation: expandIn 0.3s ease-out;
}

@keyframes expandIn {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.alert-orange .alert-expandable {
    background: #fffbeb;
    border: 2px solid #fcd34d;
}

.alert-red .alert-expandable {
    background: #fef2f2;
    border: 2px solid #fca5a5;
}

/* KEYWORDS */
.alert-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.alert-keyword {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* LINK */
.alert-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #991b1b;
    font-weight: 700;
    text-decoration: underline;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.alert-link:hover {
    color: #7f1d1d;
}

.link-icon {
    width: 16px;
    height: 16px;
}

/* ACTION BUTTONS */
.alert-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.alert-btn {
    flex: 1;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.alert-btn-primary {
    background: #dc2626;
    color: white;
}

.alert-btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.alert-btn-secondary {
    background: white;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.alert-btn-secondary:hover {
    background: #fef2f2;
    transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .alert-ux {
        padding: 1.25rem;
    }
    
    .alert-header {
        gap: 0.75rem;
    }
    
    .alert-icon {
        width: 24px;
        height: 24px;
    }
    
    .alert-title {
        font-size: 1.1rem;
    }
    
    .alert-actions {
        flex-direction: column;
    }
    
    .alert-btn {
        width: 100%;
    }
}