:root {
     --blue: #00a6ff;
     --black: #101416;
     --green: #00ff41; 
     --bg-dark: #111;
 }
 * { margin: 0; padding: 0; box-sizing: border-box; }
 
 body {
     background-color: var(--black);
     font-family: 'Segoe UI', sans-serif;
     color: white;
     overflow-x: hidden;
 }
 /* --- LAYOUT --- */
 #contact {
     width: 100%;
     min-height: 100vh;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 40px 20px;
 }
 .comm-interface {
     width: 100%;
     max-width: 1000px;
     background: var(--bg-dark);
     border: 1px solid #333;
     border-radius: 15px;
     box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
     overflow: hidden;
     display: flex;
     flex-direction: column;
     position: relative;
 }
 /* --- HEADER --- */
 .comm-header {
     background: #1a1a1a;
     padding: 20px 30px;
     border-bottom: 1px solid var(--blue);
     display: flex;
     justify-content: space-between;
     align-items: center;
 }
 .comm-title {
     color: var(--blue);
     font-family: "Rubik Scribble", system-ui;
     font-size: 1.8rem;
     letter-spacing: 1px;
 }
 .signal-bars { display: flex; gap: 4px; align-items: flex-end; height: 20px; }
 .bar {
     width: 6px;
     background: var(--blue);
     height: var(--h);
     animation: signalPulse 1s infinite alternate;
 }
 .bar:nth-child(2) { animation-delay: 0.1s; }
 .bar:nth-child(3) { animation-delay: 0.2s; }
 .bar:nth-child(4) { animation-delay: 0.3s; }
 .bar:nth-child(5) { animation-delay: 0.4s; }
 @keyframes signalPulse { from { opacity: 0.3; } to { opacity: 1; } }
 /* --- BODY --- */
 .comm-body {
     display: flex;
     flex-wrap: wrap; 
 }
 /* --- LEFT SIDE: UPLINK --- */
 .direct-uplink {
     flex: 1;
     min-width: 300px;
     padding: 40px;
     border-right: 1px solid #333;
     display: flex;
     flex-direction: column;
     justify-content: center;
     position: relative; /* CRITICAL for overlay positioning */
 }
 .direct-uplink h3, .network-nodes h3 {
     color: #888;
     font-family: 'Fira Code', monospace;
     margin-bottom: 10px;
     font-size: 1.2rem;
 }
 .status-text { color: #555; margin-bottom: 30px; font-family: 'Fira Code', monospace; font-size: 0.9rem; }
 .email-terminal {
     background: #000;
     padding: 15px;
     border-radius: 5px;
     border: 1px solid #333;
     color: var(--green);
     font-family: 'Fira Code', monospace;
     margin-bottom: 30px;
     word-break: break-all;
 }
 .prompt { color: var(--blue); margin-right: 10px; }
 /* Buttons */
 .action-buttons { display: flex; flex-direction: column; gap: 15px; }
 .cmd-btn {
     padding: 15px;
     text-align: center;
     font-family: 'Fira Code', monospace;
     font-weight: bold;
     text-decoration: none;
     border-radius: 5px;
     cursor: pointer;
     transition: 0.3s;
     border: none;
     font-size: 1rem;
     display: block;
     width: 100%;
 }
 .cmd-btn.primary {
     background: var(--blue);
     color: black;
     box-shadow: 0 0 15px rgba(0, 166, 255, 0.3);
 }
 .cmd-btn.primary:hover { background: white; box-shadow: 0 0 25px white; }
 .cmd-btn.secondary {
     background: transparent;
     border: 1px solid var(--blue);
     color: var(--blue);
 }
 .cmd-btn.secondary:hover { background: rgba(0, 166, 255, 0.1); }
 
 .pulse-animation {
     animation: buttonPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
 }
 
 @keyframes buttonPulse {
     0% { transform: scale(1); }
     50% { transform: scale(1.05); }
     100% { transform: scale(1); }
 }
 /* --- RIGHT SIDE: NODES --- */
 .network-nodes {
     flex: 1;
     min-width: 300px;
     padding: 40px;
     background: #161616;
 }
 .node-grid { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
 .node-card {
     display: flex;
     align-items: center;
     background: #222;
     padding: 15px;
     border-radius: 8px;
     text-decoration: none;
     transition: 0.3s;
     border-left: 3px solid transparent;
 }
 .node-card:hover {
     background: #2a2a2a;
     transform: translateX(10px);
     border-left: 3px solid var(--blue);
 }
 .node-icon {
     width: 30px;
     height: 30px;
     margin-right: 15px;
     border-radius: 5px;
     background-color: var(--blue);
     display: flex;
     align-items: center;
     justify-content: center;
     overflow: hidden;
     flex-shrink: 0;
 }
 
 .node-icon img { width: 100%; height: 100%; object-fit: cover; }
 .node-info { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
 .node-name { color: white; font-weight: bold; font-family: sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .node-status { color: #666; font-size: 0.8rem; font-family: 'Fira Code', monospace; }
 .node-card:hover .node-status { color: var(--green); }
 .node-arrow { color: #444; font-weight: bold; margin-left: 10px;}
 .node-card:hover .node-arrow { color: var(--blue); }
 /* --- FOOTER --- */
 .comm-footer {
     background: #0f0f0f;
     padding: 10px;
     text-align: center;
     border-top: 1px solid #333;
     color: #7f7f7f;
     font-family: 'Fira Code', monospace;
     font-size: 0.8rem;
 }
 .comm-footer span{ color: var(--green); }
 /* --- FIXED LOADING OVERLAY --- */
 .loading-overlay {
     position: absolute;
     top: 0; 
     left: 0; 
     width: 100%; 
     height: 100%;
     background: rgba(16, 20, 22, 0.98); /* Slightly darker for visibility */
     display: none; /* JS toggles this to Flex */
     flex-direction: column;
     justify-content: center;
     align-items: center;
     z-index: 100; /* High Z-index to force it on top */
     backdrop-filter: blur(8px);
     padding: 20px;
     text-align: center;
 }
 .loader-title {
     color: var(--blue);
     font-family: 'Fira Code', monospace;
     margin-bottom: 20px;
     font-size: 1.2rem;
     animation: blink 1s infinite;
 }
 .progress-container {
     width: 80%;
     max-width: 300px;
     height: 6px;
     background: #333;
     border-radius: 3px;
     overflow: hidden;
     margin-bottom: 15px;
     border: 1px solid #444; /* Added border to make container visible */
 }
 .progress-bar {
     width: 0%;
     height: 100%;
     background: var(--blue);
     box-shadow: 0 0 15px var(--blue);
     transition: width 0.1s linear;
 }
 .log-output {
     font-family: 'Fira Code', monospace;
     color: var(--green);
     font-size: 0.9rem;
     height: 20px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     max-width: 90%;
 }
 /* Fail-safe Close Button */
 .close-overlay {
     position: absolute;
     top: 10px;
     right: 15px;
     color: #555;
     cursor: pointer;
     font-size: 1.5rem;
     transition: 0.3s;
 }
 .close-overlay:hover { color: white; }
 @keyframes blink { 50% { opacity: 0; } }
 /* --- RESPONSIVE ADJUSTMENTS --- */
 @media screen and (max-width: 900px) {
     .comm-body { flex-direction: column; }
     .direct-uplink { border-right: none; border-bottom: 1px solid #333; width: 100%; }
     .network-nodes { width: 100%; }
 }
 @media screen and (max-width: 600px) {
     #contact { padding: 10px; }
     .comm-header { padding: 15px; }
     .comm-title { font-size: 1.4rem; }
     .direct-uplink, .network-nodes { padding: 25px 20px; }
     .node-grid { gap: 10px; }
     .status-text { font-size: 0.85rem; }
     .signal-bars { transform: scale(0.8); transform-origin: right bottom; }
 }
 
 @media screen and (max-width: 350px) {
     .comm-title { font-size: 1.1rem; }
     .comm-header { flex-direction: column; align-items: flex-start; gap: 10px; }
     .signal-bars { align-self: flex-end; transform: scale(1); margin-top: -30px; }
     .node-name { font-size: 0.9rem; }
 }