/* ========================================
   MitM Attack Simulator - Styles
   Premium Dark Hacker Aesthetic
======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;
    --bg-glass: rgba(22, 22, 31, 0.8);

    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --accent-gradient: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);

    --danger-primary: #ff3366;
    --danger-secondary: #ff6b6b;
    --danger-gradient: linear-gradient(135deg, #ff3366 0%, #ff6b6b 100%);

    --warning: #ffaa00;
    --success: #00ff88;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 255, 136, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 255, 136, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-primary: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ========================================
   Loading Screen
======================================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.hacker-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.pulse-icon {
    animation: pulse 2s ease-in-out infinite;
}

.heartbeat {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes heartbeat {

    0%,
    100% {
        stroke-dashoffset: 200;
    }

    50% {
        stroke-dashoffset: 0;
    }
}

.glitch {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: glitch 2s infinite;
}

@keyframes glitch {

    0%,
    90%,
    100% {
        opacity: 1;
    }

    92%,
    94%,
    96%,
    98% {
        opacity: 0.8;
        transform: translateX(-2px);
    }

    93%,
    95%,
    97%,
    99% {
        opacity: 0.9;
        transform: translateX(2px);
    }
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin: 1.5rem auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

/* ========================================
   App Container
======================================== */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.app.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   Header
======================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.logo-text .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.network-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

.btn-info:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Network Visualization
======================================== */
.network-visualization {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 1.5rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.network-visualization::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* WiFi Router */
.wifi-router {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 5;
}

.router-icon {
    font-size: 2.5rem;
    animation: routerPulse 2s ease-in-out infinite;
}

@keyframes routerPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.router-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.router-ssid {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
}

/* WiFi Connection Lines */
.wifi-connections {
    display: flex;
    justify-content: center;
    gap: 80px;
    height: 40px;
    margin-bottom: 0.5rem;
    position: relative;
}

.wifi-line {
    width: 2px;
    height: 100%;
    background: var(--bg-tertiary);
    position: relative;
}

.wifi-line.center {
    background: rgba(255, 51, 102, 0.3);
}

.wifi-signal {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    opacity: 0.3;
}

.wifi-signal.active {
    background: var(--accent-primary);
    opacity: 1;
    box-shadow: 0 0 10px var(--accent-primary);
    animation: signalPulse 1.5s ease-in-out infinite;
}

.wifi-line.center .wifi-signal.active {
    background: var(--danger-primary);
    box-shadow: 0 0 10px var(--danger-primary);
}

@keyframes signalPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 0.7;
    }
}

/* WiFi Status on Nodes */
.wifi-status {
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    opacity: 0.4;
    filter: grayscale(1);
}

.wifi-status:hover {
    transform: scale(1.1);
}

.wifi-status.connected {
    opacity: 1;
    filter: grayscale(0);
    animation: wifiConnected 2s ease-in-out infinite;
}

.wifi-status.disconnected {
    opacity: 0.4;
    filter: grayscale(1);
}

@keyframes wifiConnected {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.network-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.network-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.node-avatar {
    position: relative;
    width: 80px;
    height: 80px;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: ringPulse 3s ease-in-out infinite;
}

.avatar-ring.danger {
    border-color: var(--danger-primary);
    animation: ringPulseDanger 3s ease-in-out infinite;
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

@keyframes ringPulseDanger {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 var(--danger-primary);
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
        box-shadow: 0 0 20px var(--danger-primary);
    }
}

.avatar-icon {
    position: absolute;
    inset: 4px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.attacker-avatar .avatar-icon {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1015 100%);
}

.security-shield {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.25rem;
    animation: shieldBounce 2s ease-in-out infinite;
}

.security-shield.hidden {
    display: none;
}

@keyframes shieldBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.intercept-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    animation: eyePulse 1s ease-in-out infinite;
}

.intercept-indicator.hidden {
    display: none;
}

@keyframes eyePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.node-label {
    font-weight: 600;
    font-size: 1rem;
}

.danger-text {
    color: var(--danger-primary);
}

.node-status {
    display: flex;
    gap: 0.5rem;
}

.protocol-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

.protocol-badge.secure {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.attack-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
}

.attack-badge.active {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--danger-primary);
    color: var(--danger-primary);
    animation: badgePulse 1s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(255, 51, 102, 0.2);
    }
}

/* Connection Lines */
.connection-line {
    flex: 1;
    height: 60px;
    position: relative;
    max-width: 200px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.03) 10%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.03) 90%,
            transparent 100%);
}

.connection-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--danger-primary));
    opacity: 0.3;
    transform: translateY(-50%);
}

.packet-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.packet {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    animation: packetMove 1.5s linear forwards;
    z-index: 5;
}

.packet.reverse {
    animation: packetMoveReverse 1.5s linear forwards;
}

@keyframes packetMove {
    0% {
        left: -30px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: calc(100% + 30px);
        opacity: 0;
    }
}

@keyframes packetMoveReverse {
    0% {
        right: -30px;
        left: auto;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        right: calc(100% + 30px);
        left: auto;
        opacity: 0;
    }
}

/* Event Ticker */
.event-ticker {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.ticker-content {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    animation: ticker 20s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ========================================
   Main Content Grid
======================================== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

/* ========================================
   Panels
======================================== */
.user-panel,
.attacker-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.user-panel:hover,
.attacker-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.panel-header.danger {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1) 0%, var(--bg-secondary) 100%);
    border-bottom-color: rgba(255, 51, 102, 0.2);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-title h2 {
    font-size: 1rem;
    font-weight: 600;
}

.user-indicator {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.user-indicator.b {
    background: linear-gradient(135deg, #00d4ff 0%, #0088cc 100%);
}

.attacker-indicator {
    font-size: 1.5rem;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Security Tools */
.security-tools {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    max-height: 400px;
    overflow-y: auto;
}

.security-tools.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
    border: none;
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.tools-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
}

.security-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.security-score span {
    color: var(--accent-primary);
    font-weight: 600;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-item,
.attack-tool {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.tool-item:hover,
.attack-tool:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-secondary);
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0;
}

.tool-desc {
    display: none;
}

.tool-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tool-status {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: 0.2rem 0.4rem;
    background: var(--bg-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.tool-status.active {
    color: var(--danger-primary);
    background: rgba(255, 51, 102, 0.1);
}

.tool-status.blocked {
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
}

/* Toggle Switch */
.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 36px;
    height: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-input:checked+.toggle-label {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-primary);
}

.toggle-input:checked+.toggle-label::after {
    left: 18px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.toggle-label.danger.toggle-input:checked+.toggle-label,
.toggle-input:checked+.toggle-label.danger {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--danger-primary);
}

.toggle-input:checked+.toggle-label.danger::after {
    background: var(--danger-primary);
    box-shadow: 0 0 10px var(--danger-primary);
}

.toggle-label.attack {
    background: var(--bg-primary);
}

.toggle-input:checked+.toggle-label.attack {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--danger-primary);
}

.toggle-input:checked+.toggle-label.attack::after {
    background: var(--danger-primary);
    box-shadow: 0 0 10px var(--danger-primary);
}

/* Big Toggle for Intercept */
.attack-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.big-toggle .toggle-label {
    width: 56px;
    height: 28px;
    border-radius: 14px;
}

.big-toggle .toggle-label::after {
    width: 22px;
    height: 22px;
}

.big-toggle .toggle-input:checked+.toggle-label::after {
    left: 30px;
}

/* ========================================
   Chat Window
======================================== */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty p {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.chat-empty span {
    font-size: 0.875rem;
}

.message {
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
}

.message.sent .message-bubble {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.message-content img {
    max-width: 200px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.375rem;
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-time {
    font-family: var(--font-mono);
}

.message-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-status.intercepted {
    color: var(--danger-primary);
}

.message-status.secure {
    color: var(--accent-primary);
}

/* Chat Input */
.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-attach {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-attach:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.file-input {
    display: none;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    background: var(--accent-gradient);
    border: none;
    color: var(--bg-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-send:active {
    transform: scale(0.95);
}

/* ========================================
   Attacker Panel Specific
======================================== */
.attack-tools {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.tools-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.attack-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Packet Inspector */
.packet-inspector {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.inspector-header h3 {
    font-size: 0.875rem;
    margin: 0;
}

.inspector-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.packet-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.packet-empty,
.captured-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.packet-empty span,
.captured-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.packet-empty .hint {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.5rem;
}

.packet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
}

.packet-item:hover {
    border-color: var(--danger-primary);
    background: rgba(255, 51, 102, 0.05);
}

.packet-icon {
    font-size: 1rem;
}

.packet-info {
    flex: 1;
    min-width: 0;
}

.packet-type {
    font-weight: 600;
    font-family: var(--font-mono);
}

.packet-preview {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.packet-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Captured Data */
.captured-data {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.captured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.captured-header h3 {
    font-size: 0.875rem;
    margin: 0;
}

.capture-count {
    font-size: 0.75rem;
    color: var(--danger-primary);
    font-family: var(--font-mono);
}

.captured-list {
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
}

.captured-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 51, 102, 0.05);
    border: 1px solid rgba(255, 51, 102, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.captured-item .icon {
    font-size: 1.25rem;
}

.captured-item .content {
    flex: 1;
}

.captured-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.captured-item .value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--danger-primary);
    word-break: break-all;
}

/* ========================================
   Modal
======================================== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: all var(--transition-normal);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.25rem;
    background: var(--bg-secondary);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-section ul {
    list-style: none;
    padding: 0;
}

.info-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.info-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.info-section li strong {
    color: var(--text-primary);
}

/* Packet Detail Modal */
.packet-detail {
    max-width: 700px;
}

.packet-detail-content {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.detail-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.detail-section h4 {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section pre {
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

.detail-section .encrypted {
    color: var(--text-muted);
    font-style: italic;
}

.detail-section .plaintext {
    color: var(--danger-primary);
}

/* Packet Status Badges */
.packet-status {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.packet-status.readable {
    background: rgba(255, 51, 102, 0.2);
    color: var(--danger-primary);
}

.packet-status.encrypted {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-primary);
}

.packet-item.encrypted {
    opacity: 0.7;
    border-left: 2px solid var(--accent-primary);
}

.packet-item.encrypted .packet-preview {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Tool Info Button */
.tool-info-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-info-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.tool-info-btn.attack {
    border-color: var(--danger-primary);
    color: var(--danger-primary);
}

.tool-info-btn.attack:hover {
    background: var(--danger-primary);
    color: var(--bg-primary);
}

/* Tool Tooltip Card */
.tool-tooltip {
    position: fixed;
    width: 320px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: tooltipFadeIn 0.2s ease-out;
    overflow: hidden;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tool-tooltip.defense {
    border-color: rgba(0, 255, 136, 0.3);
}

.tool-tooltip.attack {
    border-color: rgba(255, 51, 102, 0.3);
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tool-tooltip.defense .tooltip-header {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, var(--bg-secondary) 100%);
}

.tool-tooltip.attack .tooltip-header {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1) 0%, var(--bg-secondary) 100%);
}

.tooltip-icon {
    font-size: 1.5rem;
}

.tooltip-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
}

.tool-tooltip.defense .tooltip-title {
    color: var(--accent-primary);
}

.tool-tooltip.attack .tooltip-title {
    color: var(--danger-primary);
}

.tooltip-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.tooltip-close:hover {
    background: var(--danger-primary);
    color: white;
}

.tooltip-body {
    padding: 1rem;
}

.tooltip-short {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-desc {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tooltip-section {
    margin-bottom: 0.875rem;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
}

.tooltip-section p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.tooltip-section pre {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.6;
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-status {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .network-container {
        flex-direction: column;
        gap: 0;
    }

    .connection-line {
        width: 60px;
        height: 60px;
        max-width: none;
        transform: rotate(90deg);
    }

    .main-content {
        padding: 1rem;
        gap: 1rem;
    }

    .tools-grid,
    .attack-tools-grid {
        grid-template-columns: 1fr;
    }
}