@font-face {
  font-family: 'ITF Qomra Arabic Bold';
  src: url('../01_zakaria_wan/fonts/itfQomraArabic-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    --bg-color: #002623;
    --panel-bg: rgba(5, 66, 57, 0.65);
    --border-color: rgba(185, 167, 121, 0.28);
    --text-primary: #edebe0;
    --text-secondary: #b9a779;
    
    --primary: #988561; 
    --success: #10b981; 
    --warning: #f59e0b; 
    --danger: #ef4444;  
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'ITF Qomra Arabic Bold', 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Glassmorphism utilities */
.glass-panel, .glass-box {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Dashboard Sidebar */
.dashboard {
    width: 380px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid var(--border-color);
}

.header {
    margin-bottom: 25px;
    position: relative;
    padding-top: 10px;
}

.header h2 { font-size: 20px; font-weight: 800; color: #e0e7ff; display: flex; align-items: center; gap: 10px; }
.header p { color: var(--text-secondary); font-size: 14px; margin-top: 5px; }

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-info { display: flex; flex-direction: column; gap: 4px; }
.stat-info .label { font-size: 11px; color: var(--text-secondary); }
.stat-info .value { font-size: 13px; font-weight: 600; }
.status-active { color: var(--success); }
.status-danger { color: var(--danger); }

.glass-select {
    width: 100%;
    margin-top: 5px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(185, 167, 121, 0.4);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    flex: 1; /* fills remaining height */
}

.btn {
    padding: 14px 15px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.success-btn { background-color: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid var(--success); }
.success-btn:hover { background-color: var(--success); color: #002623; box-shadow: 0 0 15px var(--glow-success); }

.warning-btn { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid var(--danger); }
.warning-btn:hover { background-color: var(--danger); color: white; box-shadow: 0 0 15px var(--glow-danger); }

.logs-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.log-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.logs-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: inherit; /* Use standard font instead of monospace for Arabic readability */
    font-size: 11px;
}

.log-item {
    color: #cbd5e1;
    padding: 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; } }

.log-item.danger { color: #fca5a5; background: rgba(239, 68, 68, 0.1); border-right: 3px solid var(--danger); }
.log-item.success { color: #6ee7b7; background: rgba(16, 185, 129, 0.1); border-right: 3px solid var(--success); }
.log-item.info { color: #93c5fd; border-right: 3px solid var(--primary); }

/* Network View */
.network-view {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image: 
        url('../01_zakaria_wan/pattern.png'),
        linear-gradient(rgba(185, 167, 121, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(185, 167, 121, 0.04) 1px, transparent 1px);
    background-size: 380px, 40px 40px, 40px 40px;
    background-position: center;
    background-repeat: repeat;
    opacity: 0.4;
    z-index: 1;
}

#lines-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.line {
    stroke: rgba(255,255,255,0.15);
    stroke-width: 2.5;
}
.line.danger-path { stroke: rgba(239, 68, 68, 0.4); stroke-dasharray: 6,6; }
.line.secure-path { stroke: rgba(16, 185, 129, 0.6); }

.topology {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 60px;
}

.layout-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.end-point {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    z-index: 10;
}

.clouds-layer {
    display: flex;
    flex-direction: column;
    gap: 80px;
    flex: 1;
    align-items: center;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 38, 35, 0.95);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 16px;
    min-width: 170px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}
.node i { font-size: 26px; }
.node span { font-size: 13px; font-weight: 700; color: #e0e7ff; }

.router-node { border-color: var(--primary); }
.router-node i { color: var(--primary); }

.client-node i, .server-node i { color: #cbd5e1; }

.ip-tag {
    font-size: 10px;
    background: rgba(255,255,255,0.1);
    padding: 3px 8px;
    border-radius: 6px;
    color: #e2e8f0;
    margin-top: 4px;
}
.monospaced { font-family: monospace; letter-spacing: 1px; color: #a7f3d0; }

.path-arrow {
    color: var(--border-color);
    font-size: 24px;
}

.cloud {
    width: 320px;
    height: 160px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}
.cloud span { font-weight: 800; font-size: 15px; }

.public-cloud {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-style: dashed;
}
.public-cloud.glow {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3), inset 0 0 20px rgba(0,0,0,0.5);
    background: rgba(239, 68, 68, 0.15);
}

.secure-cloud {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.secure-cloud.glow {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3), inset 0 0 20px rgba(0,0,0,0.5);
}

.tunnel-shape {
    position: absolute;
    inset: 10px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-radius: 30px;
    z-index: 1;
}

.hacker-node {
    position: absolute;
    top: -25px;
    right: 30px;
    background: #7f1d1d;
    color: #fca5a5;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ef4444;
    box-shadow: 0 0 15px rgba(239,68,68,0.5);
    opacity: 0.5;
    transition: opacity 0.3s;
}
.public-cloud.glow .hacker-node {
    opacity: 1;
    animation: hackPulse 0.5s infinite alternate;
}
@keyframes hackPulse { from { transform: scale(1); } to { transform: scale(1.1); background: #ef4444; color: white;} }

.sec-badge {
    position: absolute;
    bottom: -15px;
    background: #059669;
    color: #002623;
    padding: 4px 15px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(16,185,129,0.4);
}

/* Packets container */
#packets-container { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.packet {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 21;
}

/* Concise Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 38, 35, 0.95);
    color: #edebe0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 200px;
    max-width: 250px;
    white-space: normal;
    border: 1px solid var(--primary);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    pointer-events: none;
    line-height: 1.5;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
