@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Mono:wght@400;700&display=swap');

@font-face {
    font-family: 'Dirtyline';
    src: url('fonts/Dirtyline 36daysoftype 2022.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Nohemi';
    src: url('fonts/Web-TT/Nohemi-Regular.woff2') format('woff2'),
        url('fonts/Web-TT/Nohemi-Regular.woff') format('woff'),
        url('fonts/Web-TT/Nohemi-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --accent: #ff003c;
    --accent-glow: rgba(255, 0, 60, 0.5);
    --bg-dark: #020202;
    --bg-glass: rgba(5, 5, 5, 0.75);
    --border-dim: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-glitch: var(--font-heading);
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

/* Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-heading);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --- HUD & ATMOSPHERE LAYERS --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.1;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 9999;
    pointer-events: none;
}

#bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border-dim) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-dim) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 0.5;
}

.main-container {
    display: flex;
    flex-direction: column;
    /* Eliminado el padding general y el max-width para ganar el ancho total de pantalla */
    width: 100%;
}

.top-container {
    padding: 30px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-dim);
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: normal;
    letter-spacing: -1px;
    margin: 0;
    text-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.3s ease;
    position: relative;
}

.header h1:hover {
    transform: skew(-5deg) scale(1.02);
}

/* Chromatic shift removed */

.top-nav {
    display: flex;
    gap: 40px;
    align-items: center;
}

.top-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 5px;
}

.top-nav a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    box-shadow: 0 0 5px var(--accent-glow);
    transition: width var(--bar-time, 0.2s) cubic-bezier(0.4, 0, 0.2, 1);
}

.top-nav a:hover::after {
    width: 100%;
}

/* Grilla al 100% del ancho de la pantalla y todo el alto posible */
.grid-container,
.hero-banner {
    display: flex;
    width: 100%;
    flex: 1;
    /* Sin `gap` para que cada uno sea exactamente el 50% de la pantalla sin divisiones transparentes extras en medio */
}

/* Cajas simétricas e imágenes */
.team-box {
    flex: 1;
    /* Ocupa 50% si hay 2 */
    width: 50%;
    min-height: 400px;
    /* Automáticamente se estirarán según flex: 1 del grid-container */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* Mantiene todo dentro de la caja */
    z-index: 1;
    /* Quitado background info de aquí para pasarlo al ::before */
}

.team-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.4s ease, filter 0.4s ease;
    z-index: -1;
}

.team-box:hover::before {
    transform: scale(1.06);
    filter: brightness(1.15) contrast(1.1);
}

/* Optimized Native Noise on hover (No external GIF) */
.team-box::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

.team-box:hover::after {
    opacity: 0.15;
}

/* Enlazadas las imágenes solicitadas */
.red-team,
.blue-team {
    border: none;
    background-color: transparent;
}

.red-team::before {
    background-image: url('images/redT.png');
}

.blue-team::before {
    background-image: url('images/blueT.png');
}

.cyberpunk-hero::before {
    background-image: url('images/cyberpunk.png');
}

.cyberpunk-hero:hover::before {
    transform: none;
    filter: none;
    /* Desactiva efectos de zoom y filtros para esta imagen */
}

.cyberpunk-hero:hover::after {
    opacity: 0;
    /* Desactiva el efecto de ruido en hover para esta imagen */
}

.cyberpunk-hero {
    cursor: default;
    /* Quita el puntero de mano para que no parezca clickeable */
}

/* Caja de descripción sin marco y sin fondo */
.description-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    padding: 50px;
    position: relative;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    will-change: transform, opacity;
}

.description-box::before {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.description-box p {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    word-wrap: break-word;
}

/* Carrusel blanco con letras negras, sin bordes */
.carousel-footer {
    background-color: #ffffff;
    /* Fondo blanco */
    border: none;
    /* Sin bordes */
    padding: 1px 0;
    width: 100%;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    display: flex;
    margin-bottom: 0px;
    /* Sin margen abajo para que quede cerca el final */
}

.carousel-track {
    display: flex;
    animation: scrollLinear 60s linear infinite;
}

.carousel-content {
    color: #000000;
    /* Letras negras */
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding-right: 15px;
}

@keyframes scrollLinear {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .top-nav {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header h1 {
        font-size: 2rem;
    }

    .grid-container {
        flex-direction: column;
    }

    .team-box {
        width: 100%;
        height: 250px;
    }

    .main-container {
        padding: 0px;
    }

    .top-container {
        padding: 20px 10px;
    }

    /* Modal responsiveness */
    #lang-modal h2 {
        font-size: 1.5rem;
        text-align: center;
        padding: 0 20px;
    }

    .lang-options {
        flex-direction: column;
        gap: 15px;
    }

    .lang-btn {
        padding: 10px 30px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .top-nav a {
        font-size: 1rem;
    }
}

/* ---------------------------------
   Writeups Page Styles
-----------------------------------*/

.writeups-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.writeups-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.writeups-header h1 {
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 3rem;
    letter-spacing: 6px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    color: var(--accent);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 1), 0 0 20px var(--accent-glow);
    position: relative;
    display: inline-block;
}

.writeups-header h1::before {
    content: "> ";
    opacity: 0.7;
}

.writeups-header h1::after {
    content: "_";
    animation: terminalBlink 1s step-end infinite;
    margin-left: 10px;
    color: var(--accent);
}

.writeups-header h1:hover {
    cursor: crosshair;
}

/* threatGlitch removed */

.member-bio {
    margin-bottom: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.member-bio.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.member-bio:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.member-bio::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.member-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.search-wrapper {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 18px 25px;
    border-radius: 4px;
    border: 1px solid var(--border-dim);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.search-wrapper input:focus {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px var(--accent-glow), inset 0 0 5px var(--accent-glow);
}

.search-wrapper::after {
    content: "_";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    animation: terminalBlink 1s step-end infinite;
}

.writeups-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
}

.writeup-item {
    background: rgba(4, 4, 4, 0.7);
    border: 1px solid var(--border-dim);
    margin-bottom: 20px;
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.writeup-item.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.writeup-item:hover {
    background: rgba(20, 20, 20, 0.8);
    border-color: var(--accent);
    transform: translateX(10px) scale(1.02);
    box-shadow: -10px 0 30px var(--accent-glow);
    z-index: 2;
}

.writeup-item::after {
    content: "NODE_STABLE";
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--border-dim);
    letter-spacing: 2px;
}

.writeup-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    text-decoration: none;
    color: var(--text-main);
}

.mission-details {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 0, 60, 0.03);
    border-left: 2px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease;
}

.reveal-active.mission-details {
    opacity: 1;
    transform: translateX(0);
}

color: inherit;
display: flex;
flex-direction: column;
padding: 24px;
height: 100%;
}

.writeup-title {
    font-family: 'Nohemi', monospace, sans-serif;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.writeup-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 2px;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.plat-hackthebox {
    background-color: rgba(158, 240, 26, 0.1);
    color: #9ef01a;
    border: 1px solid rgba(158, 240, 26, 0.3);
}

.plat-tryhackme {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff0000;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* ---------------------------------
   About Us Page Styles
-----------------------------------*/
.profiles-grid {
    display: flex;
    width: 100%;
    gap: 0;
    /* Sin margen entre imágenes para que queden pegadas (50/50) */
    margin-bottom: 20px;
    /* Margen con la descripción */
}

/* Reutilizando la lógica interactiva de .team-box (zoom de pseudo-elemento) 
   y asignándole altura predeterminada ya que el contenedor no está forzado a estirarse infinito */
.kyrox-profile,
.winter-profile {
    min-height: 750px;
    /* Mucho más altas como solicitaste */
    border: none;
    border-radius: 0;
    /* Sin bordes redondeados para el efecto de pantalla entera */
    background-color: transparent;
}

/* Las esquinas de la imagen cargada también sin redondear */
.kyrox-profile::before,
.winter-profile::before {
    border-radius: 0;
}

.kyrox-profile::before {
    background-image: url('images/kyrox.png');
}

.winter-profile::before {
    background-image: url('images/0xwinter.png');
}

.profile-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-column .team-box {
    width: 100%;
    /* Porque hereda width 50% de index, aquí el contenedor de columna es flex 1 */
}

.profile-name {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 20px;
    margin-bottom: 20px;
    /* Espaciado para que el nombre destaque bajo la foto */
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .profiles-grid {
        flex-direction: column;
    }
}

/* ---------------------------------
   Member Biographies (Individual Sections)
-----------------------------------*/
.member-bio {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #222;
    /* Divisor sutil */
}

.member-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    letter-spacing: 1px;
    background: linear-gradient(90deg, hsl(0, 0%, 99%), #fafafa);
    /* Toque verde terminal a blanco */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.member-bio p {
    font-family: 'Nohemi', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
}

/* ---------------------------------
   Terminal Scroll Indicator
-----------------------------------*/
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Nohemi', monospace;
    font-size: 0.8rem;
    color: #fafafa;
    /* Verde terminal clásico */
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0.8;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
}

.scroll-indicator span {
    animation: terminalBlink 1.2s step-end infinite;
}

@keyframes terminalBlink {
    50% {
        opacity: 0;
    }
}

/* ---------------------------------
   Writeup Markdown Content Styles
-----------------------------------*/
.writeup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: #d1d5db;
    font-size: 1.1rem;
    padding-bottom: 60px;
}

.writeup-content h1,
.writeup-content h2,
.writeup-content h3 {
    font-family: 'Nohemi', sans-serif;
    color: #ffffff;
    margin-top: 2.5em;
    margin-bottom: 1em;
    letter-spacing: 0.5px;
}

.writeup-content h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    color: #ff003c;
}

.writeup-content h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid #222;
    padding-bottom: 8px;
}

.writeup-content h3 {
    font-size: 1.4rem;
}

.writeup-content p {
    margin-bottom: 1.5em;
}

.writeup-content ul,
.writeup-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.writeup-content li {
    margin-bottom: 0.5em;
}

.writeup-content a {
    color: #00e676;
    text-decoration: none;
    transition: color 0.3s;
}

.writeup-content a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Images Styling */
.writeup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em auto;
    display: block;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s;
}

.writeup-content img:hover {
    transform: scale(1.02);
    border-color: #ff003c;
}

/* Code Blocks Styling */
.writeup-content pre {
    background-color: #0d1117;
    /* GitHub Dark dimension */
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5em;
    border: 1px solid #30363d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Simulate terminal top bar */
.writeup-content pre::before {
    content: "● ● ●";
    position: absolute;
    top: 5px;
    left: 15px;
    color: #555;
    font-size: 12px;
    letter-spacing: 3px;
}

.writeup-content pre>code {
    background: transparent;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #e6edf3;
    display: block;
    margin-top: 10px;
    /* Space for the terminal bullets */
}

/* Inline Code */
.writeup-content p code,
.writeup-content li code {
    background-color: #1a1a1a;
    color: #ff5555;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    border: 1px solid #333;
}

.writeup-content hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #444, transparent);
    margin: 3em 0;
}

.writeup-content strong {
    color: #ffffff;
    font-weight: 600;
}

/* ---------------------------------
   Language Selection Modal
-----------------------------------*/
#lang-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Nohemi', monospace, sans-serif;
    color: #ff003c;
    backdrop-filter: blur(8px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#lang-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#lang-modal h2 {
    font-size: 3rem;
    margin-bottom: 40px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 0, 60, 0.8);
    position: relative;
    animation: glitch 1.5s infinite;
}

.lang-options {
    display: flex;
    gap: 30px;
}

.lang-btn {
    background: transparent;
    border: 2px solid #333;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    letter-spacing: 2px;
}

.lang-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 60, 0.1);
    transition: all 0.4s ease;
    z-index: -1;
}

.lang-btn:hover::before {
    left: 0;
}

.lang-btn:hover {
    border-color: #ff003c;
    color: #ff003c;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.5);
    transform: scale(1.05);
}

/* =======================================================
   PREMIUM LANGUAGE SELECTOR (STYLING)
   ======================================================= */
#lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 61, 0.05);
    border: 1px solid rgba(255, 0, 61, 0.3);
    color: #ff003c;
    padding: 6px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 5px rgba(255, 0, 61, 0.1);
    position: relative;
    overflow: hidden;
    margin-left: auto;
}

#lang-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 100%;
    background: rgba(255, 0, 61, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease;
    z-index: -1;
}

#lang-toggle:hover {
    border-color: #ff003c;
    box-shadow: 0 0 15px rgba(255, 0, 61, 0.4);
    transform: translateY(-1px);
    color: #fff;
    text-shadow: 0 0 5px #ff003c;
}

#lang-toggle:hover::before {
    width: 100%;
}

#lang-toggle:active {
    transform: scale(0.95);
}

/* Glitch Effect Class */
.lang-glitch {
    animation: lang-sync 0.4s ease forwards;
}

@keyframes lang-sync {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: hue-rotate(0deg);
    }

    20% {
        transform: scale(1.05) skew(5deg);
        opacity: 0.8;
        filter: hue-rotate(90deg);
    }

    40% {
        transform: scale(0.95) skew(-5deg);
        opacity: 0.9;
        filter: hue-rotate(180deg);
    }

    60% {
        transform: scale(1.02);
        opacity: 0.7;
        filter: hue-rotate(270deg);
    }

    80% {
        transform: scale(0.98);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: hue-rotate(0deg);
    }
}

/* =======================================================
   CTF MISSION CARDS (DOSSIER STYLE)
   ======================================================= */
.ctf-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ctf-item {
    background: rgba(4, 4, 4, 0.7);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
    overflow: hidden;
}

.ctf-item.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.ctf-item:hover {
    background: rgba(20, 20, 20, 0.8);
    border-color: var(--accent);
    transform: translateX(10px) scale(1.02);
    box-shadow: -10px 0 30px var(--accent-glow);
    z-index: 2;
}

.ctf-link {
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    text-decoration: none;
    color: var(--text-main);
}

.ctf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.ctf-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
}

.mission-details-box {
    margin: 15px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    position: relative;
}

.mission-details-box::before {
    content: "MISSION_LOG //";
    display: block;
    font-size: 0.65rem;
    margin-bottom: 10px;
    opacity: 0.5;
    letter-spacing: 2px;
}

.ctf-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

/* Specialized Mobile Adjustments for Dossiers */
@media (max-width: 768px) {
    .ctf-link {
        padding: 20px;
    }

    .ctf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ctf-title {
        font-size: 1.3rem;
    }

    .ctf-footer {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* =======================================================
   AUTHENTICATION & PROFILE STYLES
   ======================================================= */
.nav-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 10px;
}

/* ── Nav Avatar ─────────────────────────────────────── */
.avatar-wrapper {
    position: relative;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 0, 60, 0.1);
    border: 1.5px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.15);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.nav-avatar:hover {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.4);
    transform: scale(1.08);
}

/* ── Account Side Panel ──────────────────────────────── */
.account-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 320px;
    height: 100vh;
    background: #0a0a0a;
    border-left: 1px solid var(--border-dim);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
}

.account-panel.open {
    right: 0;
}

.account-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 30px 24px 24px;
    border-bottom: 1px solid var(--border-dim);
    position: relative;
}

.account-panel-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.account-panel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 0, 60, 0.08);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.2);
}

.account-panel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-upload-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 0, 60, 0.5);
}

.avatar-upload-btn:hover {
    transform: scale(1.15);
    background: #fff;
    color: var(--accent);
}

.account-panel-username {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.account-panel-stats {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 4px;
}

.account-panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.account-panel-close:hover {
    color: #fff;
}

.account-panel-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.account-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dim);
    color: #ccc;
    padding: 14px 18px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 2px;
    width: 100%;
    text-align: left;
}

.account-action-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateX(4px);
}

.account-action-btn.danger {
    color: #ff6b6b;
    border-color: rgba(255, 0, 60, 0.2);
}

.account-action-btn.danger:hover {
    background: rgba(255, 0, 60, 0.08);
    border-color: var(--accent);
    color: #ff003c;
}

/* ─── Rank & Level Styles ─── */
.rank-progress-container {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-dim);
}

.rank-progress-bar {
    position: relative;
    box-shadow: 0 0 15px currentColor;
}

.rank-progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: rankShine 2s infinite;
}

@keyframes rankShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── Image Cropper Modal Styles ─── */
.cropper-card {
    animation: modalSlideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cropper.js Overrides for Cyberpunk UI */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-view-box {
    outline: 2px solid var(--accent);
    outline-color: var(--accent);
}

.cropper-line, .cropper-point {
    background-color: var(--accent);
}

#auth-btn {
    background: rgba(255, 0, 61, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 15px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#auth-btn:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    background: var(--accent);
    color: #fff;
}

.user-stats {
    display: none;
    /* Shown when logged in */
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.user-stats .pts {
    color: var(--accent);
    font-weight: bold;
}

/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.auth-modal {
    background: var(--bg-dark);
    border: 1px solid var(--accent);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 0, 60, 0.2);
}

.auth-modal h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-dim);
}

.auth-tab {
    padding: 10px 0;
    cursor: pointer;
    color: var(--text-dim);
    font-family: var(--font-mono);
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--accent);
    border-color: var(--accent);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dim);
    padding: 12px;
    color: #fff;
    font-family: var(--font-mono);
}

.auth-form input:focus {
    border-color: var(--accent);
    outline: none;
}

.auth-modal-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: bold;
    text-transform: uppercase;
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Flag Submission Styles */
.flag-submission {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    opacity: 0.8;
}

.flag-submission input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dim);
    padding: 10px 15px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.flag-submission input:focus {
    border-color: var(--accent);
    outline: none;
}

.flag-submit-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 20px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.flag-submit-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.solve-status {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    display: none;
}

.solve-status.success {
    color: #00ff00;
    display: block;
}

.solve-status.error {
    color: #ff003c;
    display: block;
}

.points-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border-color: var(--border-dim);
}

.ctf-item.solved {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

.ctf-item.solved .ctf-title::after {
    content: " [SOLVED]";
    color: #00ff00;
    font-size: 0.8rem;
}

/* Legal & Privacy Styles */
.legal-footer {
    position: fixed;
    bottom: 3%;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(4px);
    padding: 15px;
    margin-top: 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    opacity: 0.9;
}

/* Static modifier for non-index pages */
.legal-footer.static {
    position: relative;
    bottom: 0;
    margin-top: 60px;
    background-color: transparent;
    backdrop-filter: none;
    z-index: 1;
}

.legal-highlight {
    color: var(--accent);
}

.privacy-notice {
    background: rgba(255, 0, 60, 0.05);
    border: 1px dashed var(--accent);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

#delete-account-btn {
    background: rgba(255, 0, 60, 0.1);
    color: #ff003c;
    border: 1px solid #ff003c;
    padding: 10px;
    margin-top: 20px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    width: 100%;
    transition: all 0.3s ease;
}

#delete-account-btn:hover {
    background: #ff003c;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.5);
}