/* Layout fixes for CyberCon.live website */

/* Fix potential layout glitches */

/* Global fixes */
* {
    box-sizing: border-box;
}

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

/* Preloader fixes */
.preloader {
    z-index: 2000; /* Ensure it stays on top */
}

.logo-container {
    margin-bottom: 40px; /* Add space between logo and tagline */
}

/* Terminal container positioning and sizing */
.terminal-container {
    width: 80%;
    max-width: 600px;
    bottom: 40px; /* Adjusted for better spacing */
    max-height: calc(35vh - 40px); /* Prevent overlapping */
    overflow-y: auto; /* Allow scrolling if terminal gets too long */
}

/* Fix node positioning issues */
.node {
    transform-origin: center;
}

.node-top {
    transform: translate(-50%, -50%);
}

.node-right {
    transform: translate(50%, -50%);
}

.node-bottom {
    transform: translate(-50%, 50%);
}

.node-left {
    transform: translate(-50%, -50%);
}

/* Fix animation stutter */
@keyframes packetAnimation {
    0% {
        opacity: 1;
        transform: translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: translate(calc(100vw - 10px), calc(100vh - 10px));
    }
}

/* Fix event card sizing and alignment */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 0 auto;
}

.event-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    page-break-inside: avoid;
}

.event-image {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    overflow: hidden;
}

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

.event-description {
    flex: 1;
}

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

/* Fix episode card layout issues */
.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;
}

.episode-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.episode-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Fix newsletter form alignment */
.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    min-width: 0; /* Fix for flex item overflow */
}

/* Media queries fixes for different screen sizes */
@media (max-width: 1200px) {
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero 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;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        background-color: rgba(10, 25, 47, 0.9);
        width: 100%;
        padding: 20px;
        z-index: 100;
    }
    
    nav ul.show {
        display: flex;
        flex-direction: column;
    }
    
    nav ul li {
        margin: 10px 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .terminal-container {
        width: 95%;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 20px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .terminal-container {
        bottom: 10px;
        max-height: 30vh;
    }
}