:root {
  --theme-cyber-cyan: #29f2ff;
  --theme-cyber-cyan-glow: rgba(41, 242, 255, 0.6);
  --theme-dark-bg: #00050a;
  --theme-container-bg: rgba(3, 18, 28, 0.6);
  --theme-text-light: #e0faff;
  --theme-text-dark: #00050a;
  --success-green: #00ff9d;
  --error-red: #ff2a6d;
  --theme-cyber-pink: #7000ff;
  --theme-cyber-pink-glow: rgba(112, 0, 255, 0.6);
  --cyber-blue: #0051ff;
}

/* Global Reset to fix layout cutting off */
* {
    box-sizing: border-box;
}

body {
  font-family: 'Rajdhani', 'Consolas', monospace;
  height: 100vh;
  margin: 0;
  background-color: var(--theme-dark-bg);
  color: var(--theme-text-light);
  overflow-x: hidden; /* Prevents horizontal scroll/sticking */
  width: 100%;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 50% 0%, #0e2a40 0%, #020c12 60%, #000000 100%);
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        to bottom,
        rgba(41, 242, 255, 0),
        rgba(41, 242, 255, 0) 50%,
        rgba(0, 40, 60, 0.1) 50%,
        rgba(0, 40, 60, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.3;
}

.language { display: none; }
.language.active { display: inline; }

h1, h2, h3, .hud-label {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.glitch-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 0 15px var(--theme-cyber-cyan));
}

.glitch {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--theme-text-light);
    position: relative;
    text-shadow: 2px 2px var(--theme-cyber-pink), -2px -2px var(--theme-cyber-cyan);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(80% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(20% 0 60% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(60% 0 20% 0); transform: translate(1px, 2px); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(-1px, -2px); }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(3, 10, 20, 0.7);
    border-bottom: 2px solid var(--theme-cyber-cyan);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 20px rgba(41, 242, 255, 0.1);
    position: relative;
    z-index: 100;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    width: 100%;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cyber-link {
    color: var(--theme-cyber-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px var(--theme-cyber-cyan);
}

.cyber-link:hover {
    border: 1px solid var(--theme-cyber-cyan);
    background: rgba(41, 242, 255, 0.1);
    box-shadow: 0 0 15px var(--theme-cyber-cyan-glow);
    letter-spacing: 2px;
}

.cyber-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    perspective: 1000px;
}

.hud-panel {
    background: var(--theme-container-bg);
    border: 1px solid var(--theme-cyber-cyan);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    position: relative;
    clip-path: polygon(
        0 0, 100% 0, 
        100% 85%, 95% 100%, 
        0 100%, 0 15%
    );
    box-shadow: 0 0 40px rgba(0, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.hud-panel::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--theme-cyber-cyan), transparent, var(--theme-cyber-pink));
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 95% 100%, 0 100%, 0 15%);
    opacity: 0.5;
}

.panel-corners {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.section-title {
    color: var(--theme-text-light);
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--theme-cyber-pink);
    display: inline-block;
    padding-bottom: 5px;
    transform: translateZ(20px);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-family: 'Consolas', monospace;
    color: var(--theme-cyber-cyan);
    border-bottom: 1px dashed rgba(41, 242, 255, 0.3);
    padding-bottom: 10px;
    transform: translateZ(10px);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: var(--success-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success-green);
    animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.contact-grid {
    display: grid;
    gap: 30px;
    transform: translateZ(30px);
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hud-label {
    color: rgba(224, 250, 255, 0.6);
    font-size: 0.9rem;
}

.cyber-button {
    position: relative;
    display: inline-block;
    padding: 15px 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    overflow: hidden;
    transition: 0.3s;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
}

.cyber-button.primary {
    border: 2px solid var(--theme-cyber-cyan);
    color: var(--theme-cyber-cyan);
    box-shadow: 0 0 10px var(--theme-cyber-cyan-glow);
}

.cyber-button.secondary {
    border: 2px solid var(--theme-cyber-pink);
    color: var(--theme-cyber-pink);
    box-shadow: 0 0 10px var(--theme-cyber-pink-glow);
}

.cyber-button:hover {
    background: rgba(41, 242, 255, 0.05);
    letter-spacing: 2px;
}

.cyber-button.primary:hover {
    box-shadow: 0 0 20px var(--theme-cyber-cyan);
}

.cyber-button.secondary:hover {
    box-shadow: 0 0 20px var(--theme-cyber-pink);
}

.btn-glitch {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(41, 242, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.cyber-button:hover .btn-glitch {
    transform: translateX(0);
}

.full-width {
    width: 100%;
    box-sizing: border-box;
}

.modal-container {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 5, 10, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.modal-container.active { 
    display: flex !important;
}

.modal-content.cyber-card {
    background: rgba(5, 20, 30, 0.85);
    border: 1px solid var(--theme-cyber-cyan);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 0 50px rgba(41, 242, 255, 0.15);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.modal-header h2 {
    color: var(--theme-cyber-cyan);
    margin-top: 0;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--theme-cyber-cyan);
    padding-bottom: 15px;
    transform: translateZ(15px);
}

.modal-instruction {
    color: var(--error-red);
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    margin-bottom: 20px;
    animation: flash-red 2s infinite;
}

@keyframes flash-red { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.input-wrapper {
    position: relative;
    margin-bottom: 10px;
    transform: translateZ(10px);
}

.modal-content textarea {
    width: 100%;
    background: rgba(0, 5, 10, 0.6);
    border: 1px solid #1a3a4d;
    color: var(--theme-text-light);
    padding: 15px;
    font-family: 'Consolas', monospace;
    font-size: 1rem;
    resize: vertical;
    box-sizing: border-box;
}

.modal-content textarea:focus {
    outline: none;
    border-color: var(--theme-cyber-cyan);
    box-shadow: 0 0 15px rgba(41, 242, 255, 0.2);
}

.corner-decor {
    position: absolute;
    width: 10px; height: 10px;
    border: 2px solid var(--theme-cyber-cyan);
    transition: all 0.3s;
}
.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.bottom-left { bottom: 2px; left: -2px; border-right: none; border-top: none; }
.bottom-right { bottom: 2px; right: -2px; border-left: none; border-top: none; }

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
    transform: translateZ(20px);
}
.modal-close:hover { color: var(--theme-cyber-cyan); text-shadow: 0 0 10px var(--theme-cyber-cyan); }

#chat-widget-btn {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 60px; height: 60px;
    background: rgba(5, 20, 30, 0.9);
    border: 2px solid var(--theme-cyber-pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 20px var(--theme-cyber-pink-glow);
}

.chat-icon { font-size: 30px; }

.pulse-ring {
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border: 2px solid var(--theme-cyber-pink);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

#chat-window {
    position: fixed;
    bottom: 100px; right: 30px;
    width: 350px; height: 500px;
    background: rgba(8, 20, 35, 0.95);
    border: 1px solid var(--theme-cyber-pink);
    display: none;
    flex-direction: column;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.chat-header {
    background: var(--theme-cyber-pink);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    color: #fff;
}

.chat-input-area {
    padding: 15px;
    background: rgba(0, 5, 10, 0.6);
    border-top: 1px solid var(--theme-cyber-pink);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--theme-cyber-cyan);
    color: var(--theme-text-light);
    padding: 10px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    resize: none;
    height: 40px;
    border-radius: 4px;
    transition: 0.3s;
}

#chat-input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--theme-cyber-cyan-glow);
}

#chat-send-btn {
    background: var(--theme-cyber-pink);
    border: 1px solid var(--theme-cyber-pink);
    color: #fff;
    width: 60px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send-btn:hover {
    background: transparent;
    color: var(--theme-cyber-pink);
    box-shadow: 0 0 10px var(--theme-cyber-pink-glow);
}

.system-msg {
    color: var(--theme-cyber-cyan);
    font-size: 0.8rem;
    text-align: center;
    margin: 10px 0;
    font-family: 'Consolas', monospace;
}

.system-msg.error { color: var(--error-red); }

#language-switcher {
    position: fixed;
    bottom: 20px; left: 20px;
    display: flex;
    gap: 5px;
}

#language-switcher button {
    background: rgba(0, 10, 20, 0.5);
    border: 1px solid var(--theme-cyber-cyan);
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: 0.3s;
}

#language-switcher button:hover {
    background: var(--theme-cyber-cyan);
    color: #000;
}

.clock-wrapper {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    color: var(--theme-cyber-cyan);
    text-shadow: 0 0 5px var(--theme-cyber-cyan);
}

.clock-label { font-size: 0.8rem; opacity: 0.7; }
.clock { font-size: 1.2rem; font-weight: bold; }

@media (max-width: 768px) {
    header {
        padding: 15px 10px; /* Reduced padding */
        flex-direction: column;
        gap: 15px;
    }

    .glitch { font-size: 2rem; }
    
    .hud-panel {
        padding: 20px;
        width: 100%;
        margin-top: 20px;
    }
    
    .status-bar { flex-direction: column; gap: 5px; align-items: flex-start; }
    
    #chat-window {
        width: 90%; right: 5%; bottom: 100px;
        height: 60vh;
    }
    
    #language-switcher {
        display: none;
    }
    
    .clock-wrapper {
        bottom: 5px;
        font-size: 0.8rem;
    }
}