/* Enhanced Layout for CyberCon.live
   Comprehensive layout fixes addressing all issues */

/* ===============================
   Global Layout Fixes & Z-index Hierarchy
   =============================== */
:root {
    --z-preloader: 2000;
    --z-header: 1000;
    --z-security-alert: 900;
    --z-hud: 800;
    --z-menu-mobile: 700;
    --z-content: 10;
    --z-network: 5;
    --z-background: 1;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* ===============================
   Header Styles (Missing in original CSS)
   =============================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-header);
    background-color: rgba(10, 25, 47, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header.scrolled {
    height: 70px;
    background-color: rgba(8, 20, 38, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo-img {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 50%;
    border: 2px solid var(--electric-blue);
    background-color: rgba(10, 25, 47, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(41, 182, 246, 0.5);
}

.header-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Navigation */
nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: all 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--electric-blue);
    transition: width 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--electric-blue);
}

nav ul li a:hover::after, nav ul li a.active::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--electric-blue);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===============================
   Hero Section (Missing in original CSS)
   =============================== */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 5% 80px;
    overflow: hidden;
    background-color: rgba(10, 25, 47, 0.9);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(41, 182, 246, 0.1), transparent 70%);
    z-index: 0;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: var(--z-content);
    padding: 40px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(41, 182, 246, 0.1);
    background-color: rgba(10, 25, 47, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--text-color);
    text-shadow: 0 0 20px rgba(41, 182, 246, 0.5);
}

.hero-content h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--electric-blue);
}

.hero-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    color: var(--text-color);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: var(--electric-blue);
    color: var(--dark-blue);
    border: 2px solid var(--electric-blue);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--electric-blue);
    box-shadow: 0 5px 20px rgba(41, 182, 246, 0.5);
}

.btn {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

.btn:hover {
    background-color: rgba(230, 241, 255, 0.1);
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    box-shadow: 0 5px 20px rgba(41, 182, 246, 0.3);
}

/* ===============================
   Animation Elements Styling (Missing in original CSS)
   =============================== */

/* Hexagon Grid */
.hexagon-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

.hexagon {
    position: absolute;
    width: 100px;
    height: 115.47px; /* Hexagon height: width * 1.1547 */
    background-color: transparent;
    border: 1px solid rgba(41, 182, 246, 0.1);
    box-shadow: inset 0 0 10px rgba(41, 182, 246, 0.05);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: all 3s ease;
}

.hexagon:hover {
    background-color: rgba(41, 182, 246, 0.05);
    border-color: rgba(41, 182, 246, 0.2);
}

/* Floating Data Nodes */
.floating-data-nodes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

.data-node {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--electric-blue);
    box-shadow: 0 0 5px var(--electric-blue);
    opacity: 0.5;
    pointer-events: none;
}

/* Security Scan */
.security-scan {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(41, 182, 246, 0.1), 
        rgba(41, 182, 246, 0.5), 
        rgba(41, 182, 246, 0.1), 
        transparent);
    animation: scanAnimation 8s linear infinite;
}

@keyframes scanAnimation {
    0% {
        top: -2px;
    }
    100% {
        top: 100%;
    }
}

/* HUD Elements */
.hud-element {
    position: fixed;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(41, 182, 246, 0.3);
    z-index: var(--z-hud);
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(41, 182, 246, 0.1);
}

.hud-top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-radius: 0 0 100px 0;
}

.hud-top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 0 0 100px;
}

.hud-bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-radius: 0 100px 0 0;
}

.hud-bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-radius: 100px 0 0 0;
}

.hud-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 25, 47, 0.7);
    border: 1px solid rgba(41, 182, 246, 0.3);
    border-radius: 5px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: var(--z-hud);
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    animation: blink 2s infinite;
}

/* Security Alert */
.security-alert {
    position: fixed;
    top: 80px;
    right: -400px;
    width: 350px;
    background-color: rgba(8, 20, 38, 0.9);
    border-left: 5px solid var(--warning-red);
    border-radius: 5px 0 0 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: var(--z-security-alert);
    transition: right 0.5s ease;
}

.security-alert.show {
    right: 0;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background-color: rgba(255, 56, 96, 0.1);
}

.alert-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--warning-red);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--dark-blue);
}

.alert-title {
    font-weight: bold;
    color: var(--warning-red);
}

.alert-message {
    padding: 15px;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Canvas Elements */
.digital-rain, #network-visualization {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-network);
    pointer-events: none;
}

/* Main Content Spacing */
main {
    position: relative;
    z-index: var(--z-content);
    margin-top: 0; /* Fix spacing for absolute/fixed header */
}

/* ===============================
   Event & Episode Cards Layout Fixes
   =============================== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.event-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-description {
    flex: 1;
}

.event-footer {
    margin-top: auto;
}

.episode-card {
    display: flex;
    align-items: stretch;
}

.episode-play {
    min-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.episode-content {
    flex: 1;
    padding: 20px;
}

/* ===============================
   Terminal Prompt Animation Improvements
   =============================== */
/* Override the typing animation to make it slower */
@keyframes typing {
    0% {
        width: 0;
    }
    20% { /* Slow initial typing */
        width: 25%;
    }
    40% {
        width: 50%;
    }
    60% {
        width: 75%;
    }
    100% {
        width: 100%;
    }
}

/* Make sure cursor blinks at appropriate rate */
@keyframes blink {
    0%, 80% {
        opacity: 1;
    }
    40% {
        opacity: 0;
    }
}

/* Ensure the terminal container stays visible long enough */
.terminal-container {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards, stayVisible 15s linear forwards;
    animation-delay: 1.5s, 1.5s;
}

@keyframes stayVisible {
    0%, 100% {
        opacity: 1;
    }
}

/* Override prompt text animation timing */
.prompt-text {
    animation-duration: 6s !important; /* Force slower typing */
    animation-delay: 3s !important;
}

/* Override terminal response timing */
.terminal-response {
    animation-delay: 10s !important; /* Show response after typing completes */
}

/* ===============================
   Responsive Layout Enhancement
   =============================== */
@media (max-width: 1200px) {
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .hud-element {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content h2 {
        font-size: 1.3rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .hud-element {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 30px 20px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 80%;
        margin: 0 auto;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .episode-card {
        flex-direction: column;
    }
    
    .episode-play {
        min-width: 100%;
        height: 80px;
        padding: 20px 0;
    }
    
    /* Mobile Navigation */
    header {
        padding: 0 20px;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 80px;
        right: 0;
        flex-direction: column;
        background-color: rgba(8, 20, 38, 0.95);
        padding: 20px;
        width: 200px;
        border-radius: 0 0 0 8px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
        z-index: var(--z-menu-mobile);
        backdrop-filter: blur(10px);
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 10px 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hud-element {
        width: 80px;
        height: 80px;
    }
    
    .security-alert {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content h2 {
        font-size: 1rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .hud-element {
        width: 60px;
        height: 60px;
    }
    
    .security-alert {
        width: 280px;
        top: 70px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .newsletter-button {
        border-radius: 4px;
        width: 100%;
        padding: 12px;
    }
}
