@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --primary-color: #00d2ff;
    --primary-dark: #0099cc;
    --bg-dark: #0a0a0a;
    --bg-card: #161616;
    --bg-darker: #050505;
    --text-main: #ffffff;
    --text-muted: #ffffff; /* Biały tekst dla lepszego kontrastu */
    --border-color: #2a2a2a;
}

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

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* Prevent horizontal overflow */
main, section, nav, footer, header {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    background-color: rgba(0, 0, 0, 0.95);
    border-bottom: 2px solid var(--primary-color);
    backdrop-filter: blur(10px);
    padding: 15px 0; /* Zwiększony padding góra/dół */
    overflow-x: hidden;
}

.navbar .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.navbar-brand {
    display: inline-block;
    padding: 0;
    flex-shrink: 0;
    width: 140px;
    max-width: 140px;
    overflow: hidden;
}

.navbar-logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    transition: transform 0.3s;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border-color: var(--primary-color) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--text-main) !important;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.registration-link {
    border-radius: 4px !important;
    transition: all 0.3s !important;
    white-space: nowrap;
}

.registration-link:hover {
    background-color: var(--primary-color) !important;
    color: #000 !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    padding: 120px 20px;
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1542751371-adc38448a05e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    border-bottom: 3px solid var(--primary-color);
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section .container {
    max-width: 100%;
    padding: 0 20px;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 4px;
    margin-bottom: 15px;
    word-break: break-word;
}

.hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 40px;
}

/* ===== COUNTDOWN ===== */
.countdown-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 8px;
    display: inline-flex;
    gap: 20px;
    margin-bottom: 50px;
}

.countdown-item {
    text-align: center;
    min-width: 70px;
}

.countdown-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    line-height: 1;
    color: var(--primary-color);
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-main);
    margin-top: 5px;
}

/* ===== BUTTONS ===== */
.btn-primary-gaming {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    border-radius: 4px;
}

.btn-primary-gaming:hover {
    background: var(--primary-color);
    color: #000;
}

/* ===== SECTIONS ===== */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 50px;
    text-align: center;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 15px auto;
}

/* Override Bootstrap's text-muted for better readability on dark background */
.text-muted {
    color: var(--text-main) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Override Bootstrap's btn-outline-primary */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
}

.btn-outline-primary:hover, 
.btn-outline-primary:active, 
.btn-outline-primary:focus, 
.btn-outline-primary.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
    font-weight: 700;
}

.bg-darker {
    background-color: var(--bg-darker);
}

.bg-darker p, .bg-darker span, .bg-darker div {
    color: var(--text-main) !important; /* Wszystko na ciemniejszym tle jest białe */
}

/* ===== CARDS ===== */
.card-gaming {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    transition: border-color 0.3s;
}

.card-gaming:hover {
    border-color: var(--primary-color);
}

/* ===== ARTICLES ===== */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 30px; /* Zwiększony padding */
    flex-grow: 1;
}

.article-date {
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.article-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.article-detail-back {
    display: inline-block;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-decoration: none;
    font-weight: 600;
}

.article-detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.article-detail-meta {
    color: var(--primary-color);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
}

.article-detail-image {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 30px;
}

.article-gallery-preview {
    margin-bottom: 30px;
    text-align: center;
    cursor: pointer;
}

.article-gallery-preview-image {
    width: 100%;
    border-radius: 14px;
    max-height: 520px;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.article-gallery-preview-caption {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.article-detail-content p {
    margin-bottom: 20px;
    line-height: 1.85;
    font-size: 1rem;
}

.article-detail-remote img,
.article-detail-remote picture,
.article-detail-remote source {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

.article-detail-remote h1,
.article-detail-remote h2,
.article-detail-remote h3,
.article-detail-remote h4 {
    color: var(--text-color);
    margin-top: 24px;
}

.article-detail-remote p {
    color: var(--text-muted);
    line-height: 1.85;
}

.article-detail-remote a {
    color: var(--primary-color);
}

.article-detail-remote .gallery-item,
.article-detail-remote .blocks-gallery-item,
.article-detail-remote .wp-block-gallery__image,
.article-detail-remote figure {
    display: inline-block !important;
    width: calc(33.333% - 12px) !important;
    margin: 6px !important;
    vertical-align: top !important;
}

.article-detail-remote figure img,
.article-detail-remote .gallery-item img,
.article-detail-remote .blocks-gallery-item img,
.article-detail-remote .wp-block-gallery__image img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.article-detail-remote ul,
.article-detail-remote ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-detail-remote ul.gallery,
.article-detail-remote ul.blocks-gallery-grid,
.article-detail-remote ul.wp-block-gallery__gallery,
.article-detail-remote ol.gallery,
.article-detail-remote ol.blocks-gallery-grid,
.article-detail-remote ol.wp-block-gallery__gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 12px !important;
}

.article-detail-remote figcaption {
    margin-top: 10px;
    color: var(--text-muted);
}

.article-detail-remote .wp-block-gallery,
.article-detail-remote .gallery,
.article-detail-remote .blocks-gallery-grid,
.article-detail-remote .gallery-columns,
.article-detail-remote .wp-block-gallery__gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 12px !important;
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-detail-remote .gallery-item,
.article-detail-remote .blocks-gallery-item,
.article-detail-remote .wp-block-gallery__image,
.article-detail-remote figure {
    margin: 0 !important;
}

.article-detail-remote img {
    object-fit: cover;
}

.article-detail-remote figcaption {
    margin-top: 10px;
    color: var(--text-muted);
}

/* ===== ARTICLE GALLERY MODAL ===== */
.gallery-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2200;
    padding: 20px;
    overflow: hidden;
}

.gallery-modal-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    touch-action: pan-y;
}

.gallery-modal-image {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

.gallery-modal-caption {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
}

.gallery-modal-button {
    position: absolute;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-modal-button:hover {
    background: rgba(0, 0, 0, 0.75);
}

.gallery-modal-prev {
    left: -68px;
}

.gallery-modal-next {
    right: -68px;
}

.gallery-modal-close {
    top: -18px;
    right: -18px;
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
}

@media (max-width: 768px) {
    .gallery-modal-overlay {
        padding: 10px;
    }

    .gallery-modal-button {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .gallery-modal-prev {
        left: 12px;
    }

    .gallery-modal-next {
        right: 12px;
    }

    .gallery-modal-close {
        top: 12px;
        right: 12px;
    }

    .gallery-modal-caption {
        bottom: 10px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* ===== GALLERY ===== */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: rgba(255,255,255,0.03);
}

.gallery-item::after {
    content: '';
    display: block;
    padding-bottom: 66.66%;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* ===== BRACKET (DRABINKA) ===== */
.bracket-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    overflow-x: auto;
    padding: 40px 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 250px;
}

.bracket-round h4 {
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 20px 0;
    position: relative;
    transition: border-color 0.3s;
}

.bracket-match:hover {
    border-color: var(--primary-color);
}

.bracket-team {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team span {
    font-weight: 600;
    font-size: 0.95rem;
}

.bracket-team .score {
    color: var(--primary-color);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    min-width: 25px;
    text-align: center;
}

.bracket-team.winner span {
    color: var(--primary-color);
}

/* Connectors for bracket */
.bracket-round:not(:last-child) .bracket-match::after {
    content: '';
    position: absolute;
    right: -25px;
    top: 50%;
    width: 25px;
    height: 2px;
    background: var(--border-color);
}

/* ===== SPONSORS INFINITE SCROLL ===== */
.sponsors-container {
    overflow: hidden;
    padding: 40px 0;
    position: relative;
}

.sponsors-track:hover {
    animation-play-state: paused;
}

.sponsors-track {
    display: flex;
    width: max-content;
    animation: scroll 30s linear infinite;
}

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

.sponsor-item {
    flex: 0 0 auto;
    width: 220px;
    height: 110px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0 15px;
}

.sponsor-item img {
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(0) brightness(1);
    transition: all 0.3s;
}

.sponsor-item.sponsor-interline,
.sponsor-item.sponsor-padel-arena {
    width: 220px;
    height: 110px;
    padding: 8px;
}

.sponsor-item.sponsor-interline img {
    width: 100%;
    height: auto;
    max-height: 100%;
}

.sponsor-item.sponsor-padel-arena img {
    width: 80%;
    height: auto;
    max-height: 80%;
}

.sponsor-item.sponsor-zstio img {
    width: 70%;
    height: auto;
    max-height: 70%;
}

.sponsor-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 210, 255, 0.05);
}

.sponsor-item:hover img {
    filter: grayscale(0) brightness(1.2);
    transform: scale(1.05);
}

/* ===== FOOTER ===== */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-darker);
}

.social-links a {
    color: var(--text-main);
    font-size: 1.5rem;
    margin: 0 15px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }

    .navbar {
        padding: 10px 0;
    }

    .navbar-brand {
        width: 120px;
        max-width: 120px;
    }

    .navbar-logo {
        max-height: 42px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem !important;
    }

    .hero-section {
        padding: 60px 15px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .countdown-box {
        gap: 5px;
        padding: 12px;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px !important;
    }

    .countdown-item {
        min-width: 45px;
    }

    .countdown-value {
        font-size: 1.4rem;
    }

    .countdown-label {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
        margin-bottom: 30px;
    }

    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .row {
        margin-left: -7.5px !important;
        margin-right: -7.5px !important;
    }

    .col-lg-6, .col-md-6, .col-sm-12 {
        padding-left: 7.5px !important;
        padding-right: 7.5px !important;
    }

    .articles-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .article-card {
        height: auto;
    }

    .article-image {
        height: 150px;
    }

    .article-content {
        padding: 15px;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .card-gaming {
        padding: 20px;
    }

    .bracket-container {
        gap: 20px;
        padding: 20px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bracket-round {
        min-width: 180px;
    }

    .bracket-match {
        margin: 12px 0;
    }

    .bracket-team {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .btn-primary-gaming {
        padding: 12px 25px;
        font-size: 0.85rem;
    }

    footer {
        padding: 30px 0 15px;
    }

    .social-links a {
        font-size: 1.2rem;
        margin: 0 10px;
    }
}

/* Mobile Medium (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .navbar {
        padding: 12px 0;
    }

    .navbar-brand {
        width: 130px;
        max-width: 130px;
    }

    .navbar-logo {
        max-height: 45px;
    }

    .hero-section {
        padding: 80px 20px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .countdown-box {
        gap: 8px;
        padding: 15px;
    }

    .countdown-item {
        min-width: 55px;
    }

    .countdown-value {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 35px;
    }

    .articles-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .bracket-round {
        min-width: 200px;
    }
}

/* Tablet (601px - 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .navbar {
        padding: 12px 0;
    }

    .navbar-brand {
        width: 135px;
        max-width: 135px;
    }

    .navbar-logo {
        max-height: 48px;
    }

    .hero-section {
        padding: 100px 30px;
    }

    .hero-title {
        font-size: 2.8rem;
        letter-spacing: 3px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 30px;
    }

    .countdown-box {
        gap: 10px;
        padding: 20px;
    }

    .countdown-item {
        min-width: 60px;
    }

    .countdown-value {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .articles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .article-image {
        height: 180px;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .card-gaming {
        padding: 25px;
    }

    .bracket-container {
        gap: 30px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bracket-round {
        min-width: 220px;
    }
}

/* Small Desktop (769px - 992px) */
@media (min-width: 769px) and (max-width: 992px) {
    .navbar-brand {
        width: 145px;
        max-width: 145px;
    }

    .navbar-logo {
        max-height: 50px;
    }

    .hero-section {
        padding: 100px 40px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 45px;
    }

    .articles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .bracket-container {
        gap: 40px;
    }

    .bracket-round {
        min-width: 250px;
    }
}

/* Large Desktop (993px+) */
@media (min-width: 993px) {
    .articles-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape phones and small tablets */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .countdown-box {
        gap: 8px;
        padding: 10px;
    }

    .countdown-value {
        font-size: 1.4rem;
    }
}
