@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700;800&display=swap');

:root {
    --bg-color: #0b0f19;
    --bg-dark: #0f1219;
    --card-bg: #151a27;
    --r6-orange: #ff5500;
    --r6-blue: #00d4ff;
    --r6-grey: #2d3039;
    --text-white: #ffffff;
    --text-gray: #8f9bb3;
    --win-green: #00ff00;
}

body {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-white);
    overflow-x: hidden;
    /* Háttérkép + Textúra */
    background-image: 
        linear-gradient(45deg, rgba(11, 15, 25, 0.9), rgba(11, 15, 25, 0.95)),
        url('https://images.wallpapersden.com/image/download/tom-clancy-s-rainbow-six-siege-4k-gaming_bGdma22UmZqaraWkpJRmbmdlrWZlbWU.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* --- GLITCH ANIMÁCIÓK DEFINÍCIÓJA --- */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 50% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(2px, -1px); }
    20% { clip-path: inset(30% 0 20% 0); transform: translate(-2px, 1px); }
    40% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 1px); }
    60% { clip-path: inset(20% 0 50% 0); transform: translate(-1px, -2px); }
    80% { clip-path: inset(50% 0 30% 0); transform: translate(1px, 2px); }
    100% { clip-path: inset(0% 0 80% 0); transform: translate(-2px, -1px); }
}

/* Glitch osztály - Ezt tedd a szövegre */
.glitch-effect {
    position: relative;
    display: inline-block;
    color: var(--text-white);
    font-weight: 800; /* Legyen vastag a jobb hatásért */
}

/* "Szellem" rétegek létrehozása */
.glitch-effect::before,
.glitch-effect::after {
    content: attr(data-text); /* Kiolvassa a HTML-ből a szöveget */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color); /* Háttérszín takarás */
}

/* Kék réteg */
.glitch-effect::before {
    left: 2px;
    text-shadow: -1px 0 var(--r6-blue);
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

/* Narancs réteg */
.glitch-effect::after {
    left: -2px;
    text-shadow: -1px 0 var(--r6-orange);
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

/* --- LAYOUT ALAPOK --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 80vh;
    overflow: visible;
}

h1 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 85, 0, 0.5);
}

.highlight { color: var(--r6-orange); }

/* --- NAVBAR & HEADER STÍLUSOK --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(11, 15, 25, 0.95);
    border-bottom: 2px solid var(--r6-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 5px 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.nav-item:hover {
    color: var(--r6-blue);
    border-color: var(--r6-blue);
    background: rgba(0, 212, 255, 0.1);
    letter-spacing: 1px;
}

/* Badge stílus */
.user-controls {
    display: flex;
    align-items: center;
    margin-left: 20px;
    border-left: 1px solid #333;
    padding-left: 20px;
    gap: 10px;
}

.user-badge {
    background: #222;
    padding: 8px 15px;
    border-radius: 2px;
    border-left: 3px solid var(--r6-orange);
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    transition: 0.3s;
    cursor: pointer;
}

.user-badge:hover {
    background: #333;
    box-shadow: 0 0 10px rgba(255, 85, 0, 0.3);
}

.logout-btn {
    font-size: 0.8rem;
    border: 1px solid #444;
    padding: 5px 10px;
}

.logout-btn:hover {
    border-color: #ff5555;
    color: #ff5555;
}

/* Hamburger ikon */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* --- HERO SECTION --- */
.hero-content {
    position: relative;
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 5%;
    z-index: 10;
    color: white;
}

.video-background-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; overflow: hidden; z-index: -100;
}
.video-foreground {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none;
}
.video-overlay-shield {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(11, 15, 25, 0.6); z-index: 1;
}
@media (min-aspect-ratio: 16/9) { .video-foreground { height: 300%; top: -100%; } }
@media (max-aspect-ratio: 16/9) { .video-foreground { width: 300%; left: -100%; } }

/* --- R6 UI ELEMENTS --- */
.r6-btn {
    background: var(--r6-orange);
    color: white;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s ease;
}

/* Gomb hover: Kicsi glitch effekt hozzáadva */
.r6-btn:hover {
    background: white;
    color: var(--r6-orange);
    transform: translateX(5px);
    box-shadow: 3px 3px 0px var(--r6-blue);
    /* Opcionális: ha a gomb is remegjen, vedd ki a kommentet */
    /* animation: glitch-anim-1 0.3s infinite; */
}

.r6-panel {
    background: rgba(30, 32, 40, 0.95);
    margin-bottom: 30px;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
    border-left: 4px solid var(--r6-grey);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.r6-panel:hover {
    border-left-color: var(--r6-blue);
    background: rgba(40, 44, 55, 0.98);
}

/* --- DASHBOARD GRID --- */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
}

.event-card {
    padding: 0 !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 2px solid var(--r6-blue);
}

.event-status {
    position: absolute; top: 10px; right: 10px;
    background: #0f0; color: black; font-weight: bold;
    padding: 2px 8px; font-size: 0.8rem;
    box-shadow: 0 0 10px #0f0;
}

/* --- FORMS & INPUTS --- */
input, select, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--r6-orange);
}

/* --- BRACKET & MATCH ELEMENTS --- */
.team-tile {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}
.team-tile:hover { background: rgba(255,255,255,0.08); }
.team-tile.selected { background: var(--r6-orange); color: black; border-color: white; font-weight: bold; }

.winner-border { border: 2px solid var(--win-green) !important; color: var(--win-green); }

/* --- TACTICAL FORM BUTTON --- */
.btn-tactical {
    width: 100%;
    position: relative;
    padding: 15px 30px;
    background: linear-gradient(90deg, var(--r6-orange) 0%, #cc4400 100%);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    cursor: pointer;
    /* R6 stílusú vágott sarkok */
    clip-path: polygon(
        20px 0, 
        100% 0, 
        100% calc(100% - 20px), 
        calc(100% - 20px) 100%, 
        0 100%, 
        0 20px
    );
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    margin-top: 20px;
}

/* Hover effekt: Kivilágosodik és neon fényt kap */
.btn-tactical:hover {
    background: white;
    color: var(--r6-orange);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 0 20px rgba(255, 85, 0, 0.6),
        0 0 40px rgba(255, 85, 0, 0.3);
}

/* Klikk effekt */
.btn-tactical:active {
    transform: scale(0.98);
}

/* --- FOOTER --- */
.footer {
    margin-top: 50px;
    padding: 2rem;
    background: #080a10;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-gray);
    font-size: 0.8rem;
}

.footer-links a { color: var(--text-gray); margin-left: 15px; text-decoration: none; }
.footer-links a:hover { color: var(--r6-orange); }

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    
    .navbar { padding: 1rem; }
    .hamburger { display: flex; }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #0f1219;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-bottom: 2px solid var(--r6-blue);
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
        transition: 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

    .user-controls {
        flex-direction: column;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        align-items: center;
    }

    .user-badge {
        background: transparent !important;
        border: none !important;
        padding: 15px 0 !important;
        font-size: 1.1rem !important;
        color: var(--text-white) !important;
        display: block;
        width: 100%;
        text-align: center;
        box-shadow: none !important;
    }
    
    .user-badge:hover {
        color: var(--r6-orange) !important;
        background: transparent !important;
    }

    .nav-item { width: 100%; text-align: center; padding: 15px 0; border-bottom: 1px solid #333; }
    
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .tournament-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 3rem; }
    
    .bracket-container {
        flex-direction: column;
        min-width: 0;
    }
    .bracket-column { width: 100%; margin-bottom: 30px; }
    .connector-line, .connector-bridge, .bracket-connectors { display: none; }
}