/* =====================================================
   FYROS GAMES STUDIO - ADVANCED FEATURES STYLES
   ===================================================== */

/* ========== AI TERMINAL ========== */
.ai-terminal {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #1a1a1a;
    max-width: 700px;
    margin: 30px auto;
    font-family: 'Share Tech Mono', monospace;
    position: relative;
    overflow: hidden;
}

.ai-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffb400, transparent);
    animation: terminalGlow 3s ease-in-out infinite;
}

@keyframes terminalGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ai-terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 180, 0, 0.05);
    border-bottom: 1px solid #1a1a1a;
    font-size: 0.6rem;
    color: #555;
    letter-spacing: 2px;
}

.ai-terminal-header .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ff88;
    animation: statusPulse 2s infinite;
}

.ai-terminal-output {
    height: 180px;
    overflow-y: auto;
    padding: 15px;
    font-size: 0.7rem;
    line-height: 1.8;
    color: #666;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.ai-terminal-output::-webkit-scrollbar {
    width: 4px;
}

.ai-terminal-output::-webkit-scrollbar-track {
    background: transparent;
}

.ai-terminal-output::-webkit-scrollbar-thumb {
    background: #333;
}

.ai-terminal-output .line-system { color: #ffb400; }
.ai-terminal-output .line-error { color: #ff4400; }
.ai-terminal-output .line-success { color: #00ff88; }
.ai-terminal-output .line-info { color: #4488ff; }
.ai-terminal-output .line-lore { color: #cc44ff; }

.ai-terminal-input {
    display: flex;
    align-items: center;
    border-top: 1px solid #1a1a1a;
    padding: 10px 15px;
    gap: 8px;
}

.ai-terminal-input .prompt {
    color: #ffb400;
    font-size: 0.7rem;
    white-space: nowrap;
}

.ai-terminal-input input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    caret-color: #ffb400;
}

.ai-terminal-input input::placeholder {
    color: #333;
}

/* ========== OPERATIVE PROFILE / VANGUARD ID ========== */
.operative-profile-section {
    margin-top: 30px;
}

.vanguard-id-card {
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(8, 8, 10, 0.95), rgba(20, 18, 10, 0.95));
    border: 1px solid #333;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.vanguard-id-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffb400, #ff6600, #ffb400);
}

.vanguard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #1a1a1a;
    background: rgba(255, 180, 0, 0.03);
}

.vanguard-header .id-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: #ffb400;
}

.vanguard-header .id-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: #555;
    letter-spacing: 1px;
}

.vanguard-body {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.vanguard-avatar {
    width: 100px;
    height: 100px;
    border: 2px solid #333;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.3s;
}

.vanguard-avatar:hover {
    border-color: #ffb400;
}

.vanguard-avatar canvas {
    width: 100%;
    height: 100%;
}

.vanguard-avatar .avatar-edit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 180, 0, 0.9);
    color: #000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    text-align: center;
    padding: 3px;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s;
}

.vanguard-avatar:hover .avatar-edit {
    opacity: 1;
}

.vanguard-info {
    flex: 1;
    min-width: 0;
}

.vanguard-callsign {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.vanguard-rank {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #ffb400;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.vanguard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vanguard-stat {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.vanguard-stat .val {
    color: #00ff88;
}

.vanguard-loadout {
    padding: 15px 20px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.loadout-slot {
    flex: 1;
    min-width: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #222;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Share Tech Mono', monospace;
}

.loadout-slot:hover {
    border-color: #ffb400;
    background: rgba(255, 180, 0, 0.05);
}

.loadout-slot .slot-label {
    font-size: 0.5rem;
    color: #555;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.loadout-slot .slot-item {
    font-size: 0.6rem;
    color: #ffb400;
}

.vanguard-footer {
    padding: 10px 20px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vanguard-footer .clearance {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    color: #333;
    letter-spacing: 1px;
}

.vanguard-customize-btn {
    background: none;
    border: 1px solid #333;
    color: #666;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    padding: 5px 12px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.vanguard-customize-btn:hover {
    border-color: #ffb400;
    color: #ffb400;
}

.profile-login-prompt {
    text-align: center;
    padding: 40px 20px;
}

.profile-login-prompt p {
    color: #555;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    margin-bottom: 15px;
}

.profile-login-prompt button {
    background: none;
    border: 1px solid #ffb400;
    color: #ffb400;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    padding: 10px 25px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-login-prompt button:hover {
    background: #ffb400;
    color: #000;
}

/* ========== SERVER DASHBOARD ========== */
.server-dashboard {
    background: rgba(8, 8, 10, 0.9);
    border: 1px solid #1a1a1a;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.server-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff88, transparent);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #1a1a1a;
    background: rgba(0, 255, 136, 0.02);
}

.dashboard-header .title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #00ff88;
}

.dashboard-header .live-dot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    color: #00ff88;
    letter-spacing: 1px;
}

.dashboard-header .live-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    animation: statusPulse 1.5s infinite;
}

.dashboard-body {
    padding: 20px;
}

.server-network-map {
    position: relative;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(0, 255, 136, 0.03) 0%, transparent 70%);
    margin-bottom: 15px;
    overflow: hidden;
}

.server-network-map canvas {
    width: 100%;
    height: 100%;
}

.server-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.server-stat {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #111;
    padding: 12px;
    text-align: center;
    transition: border-color 0.3s;
}

.server-stat:hover {
    border-color: #00ff88;
}

.server-stat .stat-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    color: #555;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.server-stat .stat-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: #00ff88;
}

.server-stat .stat-val.warning { color: #ffb400; }
.server-stat .stat-val.danger { color: #ff4400; }

.threat-level {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #111;
    display: flex;
    align-items: center;
    gap: 15px;
}

.threat-level .threat-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: #666;
    letter-spacing: 1px;
    white-space: nowrap;
}

.threat-bar {
    flex: 1;
    height: 8px;
    background: #111;
    position: relative;
    overflow: hidden;
}

.threat-bar-fill {
    height: 100%;
    transition: width 1s ease, background 1s ease;
}

.threat-bar-fill.low { width: 25%; background: #00ff88; }
.threat-bar-fill.moderate { width: 50%; background: #ffb400; }
.threat-bar-fill.high { width: 75%; background: #ff6600; }
.threat-bar-fill.critical { width: 100%; background: #ff4400; animation: threatPulse 1s infinite; }

@keyframes threatPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.threat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    min-width: 70px;
    text-align: right;
}

/* ========== LANGUAGE TOGGLE ========== */
.lang-toggle {
    position: fixed;
    top: 20px;
    right: 250px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(12, 12, 15, 0.95);
    border: 1px solid #1a1a1a;
    overflow: hidden;
}

.lang-btn {
    background: none;
    border: none;
    color: #555;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.lang-btn.active {
    color: #ffb400;
    background: rgba(255, 180, 0, 0.1);
}

.lang-btn:hover:not(.active) {
    color: #888;
}

.lang-divider {
    width: 1px;
    height: 20px;
    background: #333;
}

/* Glitch transition for language swap */
.lang-glitch-active {
    animation: langGlitch 0.4s ease;
}

@keyframes langGlitch {
    0% { filter: none; opacity: 1; }
    20% { filter: hue-rotate(90deg) blur(2px); opacity: 0.7; transform: translateX(2px); }
    40% { filter: hue-rotate(-90deg) blur(1px); opacity: 0.8; transform: translateX(-2px); }
    60% { filter: hue-rotate(45deg) blur(2px); opacity: 0.6; transform: skewX(1deg); }
    80% { filter: hue-rotate(-45deg) blur(1px); opacity: 0.9; transform: skewX(-1deg); }
    100% { filter: none; opacity: 1; transform: none; }
}

/* ========== AMBIENT AUDIO TOGGLE ========== */
.audio-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: rgba(12, 12, 15, 0.95);
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.audio-toggle:hover {
    border-color: #ffb400;
}

.audio-toggle svg {
    width: 18px;
    height: 18px;
    color: #555;
    transition: color 0.3s;
}

.audio-toggle.active {
    border-color: #ffb400;
}

.audio-toggle.active svg {
    color: #ffb400;
}

.audio-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 14px;
}

.audio-bar {
    width: 2px;
    background: currentColor;
    transition: height 0.3s;
}

.audio-toggle.active .audio-bar {
    animation: audioBarBounce 0.8s ease infinite;
}

.audio-toggle.active .audio-bar:nth-child(1) { animation-delay: 0s; }
.audio-toggle.active .audio-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-toggle.active .audio-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-toggle.active .audio-bar:nth-child(4) { animation-delay: 0.15s; }

@keyframes audioBarBounce {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}

/* ========== WEBGL 3D HERO ========== */
#hero3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

#hero3d-container canvas {
    width: 100%;
    height: 100%;
}

/* ========== CINEMATIC VIDEO HEADERS ========== */
.section-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.section-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.15) saturate(0.5) contrast(1.2);
    opacity: 0.6;
}

.section-video-bg .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(2, 2, 2, 0.8) 0%, rgba(2, 2, 2, 0.4) 30%, rgba(2, 2, 2, 0.4) 70%, rgba(2, 2, 2, 0.9) 100%);
}

/* Canvas-based cinematic effect fallback */
.cinematic-canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

.section-box {
    position: relative;
}

.section-box > *:not(.cinematic-canvas-bg):not(.box-corner) {
    position: relative;
    z-index: 1;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    .lang-toggle {
        right: auto;
        left: 10px;
        top: auto;
        bottom: 80px;
    }

    .audio-toggle {
        bottom: 80px;
        right: 15px;
    }

    .ai-terminal {
        margin: 20px 10px;
    }

    .ai-terminal-output {
        height: 140px;
    }

    .vanguard-body {
        flex-direction: column;
        align-items: center;
    }

    .vanguard-stats {
        grid-template-columns: 1fr;
    }

    .server-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .server-network-map {
        height: 140px;
    }
}
