* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* CUSTOM SCROLLBAR - EFEKT MGŁY (FOG EFFECT) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 8, 8, 0.4);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 106, 0, 0.25);
    border-radius: 4px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.9);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    color: #ffffff;
    background: url("assets/background.jpg") center center / cover fixed no-repeat;
    background-color: #080808;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.page-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.85);
    z-index: 0;
    pointer-events: none;
}

/* GLASSMORPHISM CLASS */
.glassmorphism {
    background: rgba(18, 18, 18, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* HEADER */
.site-header {
    position: relative;
    z-index: 20;
    width: calc(100% - 20px);
    max-width: 1200px;
    margin: 15px auto 0;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ff6a00 !important;
    border-radius: 8px;
    transform: translateZ(0);
}

/* LOGO W HEADERZE */
.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex-shrink: 0;
}

.brand-logo img {
    height: 55px;
    max-height: 55px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.brand-logo:hover {
    transform: scale(1.04);
    opacity: 0.9;
}

.main-navigation {
    display: flex;
    gap: 20px;
}

.main-navigation a {
    color: #d0d0d0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.2s ease;
    touch-action: manipulation;
}

.main-navigation a:hover,
.main-navigation a.active {
    color: #ff6a00;
}

/* MAIN CONTAINER */
.media-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px 80px;
}

/* NAGŁÓWEK SUBSTRONY */
.media-heading {
    margin-bottom: 25px;
    text-align: center;
}

.media-title span {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -1px;
    color: #ff6a00;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 106, 0, 0.3);
    word-break: break-word;
}

.media-introduction {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(0.88rem, 2.5vw, 1rem);
    line-height: 1.5;
    padding: 0 10px;
}

/* TOOLBAR & SEARCH */
.media-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding: 12px 15px;
    border-radius: 8px;
}

.media-search input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 4px;
    outline: none;
    width: 220px;
    transition: border-color 0.2s;
}

.media-search input:focus {
    border-color: #ff6a00;
}

.filter-button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 15, 15, 0.8);
    color: #ffffff;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.filter-button:hover,
.filter-button.active {
    background: #ff6a00;
    border-color: #ff6a00;
    color: #000000;
    font-weight: 900;
}

.media-sort select {
    background: #111111;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 9px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

/* SIATKA KAFELKÓW / MEDIA GRID */
#mediaGrid, 
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

/* KOMPAKTOWY KAFELEK MEDIA */
.media-card {
    display: flex;
    flex-direction: column;
    background: #141414;
    border: 1px solid #222;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    cursor: pointer;
    position: relative;
    transform: translateZ(0);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
}

.media-card:hover,
.media-card:active {
    border-color: #ff6a00;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8), 0 0 15px rgba(255, 106, 0, 0.2);
}

.media-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #000;
}

.media-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.media-card:hover .media-card-image img {
    transform: scale(1.05);
}

.media-type {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    background: #ff6a00;
    color: #000000;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 1px;
    z-index: 2;
}

.badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff0055;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 4px 8px;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.8);
    animation: pulseBadge 1.5s infinite;
    z-index: 2;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.media-card-content {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.media-card h2 {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.media-card h3 {
    color: #ff6a00;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.media-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    font-size: 0.8rem;
    color: #aaa;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

/* RATING & STARS */
.rating-box {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.stars {
    color: #ff6a00;
    font-size: 1.1rem;
    display: inline-flex;
    gap: 2px;
    user-select: none;
}

.star-clickable {
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.2s ease, color 0.2s ease;
}

.rating-number {
    font-size: 0.85rem;
    font-weight: 900;
    color: #ffffff;
}

.rating-info, .views-info {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* MODAL */
.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 12px;
    box-sizing: border-box;
}

.modal.active,
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content,
.modal-container {
    background: #18181c;
    color: #fff;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    max-height: 90dvh;
    border: 1px solid #ff6a00;
    border-radius: 12px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    touch-action: manipulation;
}

.modal-body {
    padding: 20px;
}

.modal-media-container {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

.modal-main-display {
    position: relative;
    width: 100%;
    height: 45vh;
    min-height: 220px;
    max-height: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #080808;
    overflow: hidden;
}

.modal-main-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    touch-action: manipulation;
}

.video-responsive {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-responsive iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    touch-action: manipulation;
}

.modal-nav-arrow.prev { left: 10px; }
.modal-nav-arrow.next { right: 10px; }

.modal-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    background: #111114;
    border-top: 1px solid #222;
}

.gallery-thumb {
    width: 60px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    background: #222;
    touch-action: manipulation;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb.active {
    opacity: 1;
    border-color: #ff6a00;
}

.modal-info-section {
    padding: 15px;
}

.share-btn {
    background: transparent;
    border: 1px solid #ff6a00;
    color: #ff6a00;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-subtitle {
    color: #ff6a00;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 15px;
}

.modal-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 20px;
    white-space: pre-line;
}

/* KOMENTARZE */
.comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.comments-section h3 {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #ff6a00;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-input, .comment-textarea {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.85rem;
}

.comment-input:focus, .comment-textarea:focus {
    outline: none;
    border-color: #ff6a00;
}

.comment-submit-btn {
    align-self: flex-start;
    background: #ff6a00;
    color: #000000;
    border: none;
    padding: 10px 20px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #ff6a00;
    padding: 10px 12px;
}

.comment-author {
    font-weight: 800;
    font-size: 0.82rem;
    color: #ff6a00;
}

.comment-date {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 6px;
}

.comment-text {
    margin-top: 4px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* TRYB PEŁNOEKRANOWY (LIGHTBOX) */
.fullscreen-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.fullscreen-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    z-index: 100001;
    touch-action: manipulation;
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    background: #111;
    color: #fff;
    border: 1px solid #ff6a00;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

/* ANIMACJA WEJŚCIA */
@keyframes fadeInUpwards {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-entry {
    opacity: 0;
    animation: fadeInUpwards 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* MEDIA QUERIES (RESPONSYWNOŚĆ MOBILNA) */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 12px;
        padding: 10px 12px;
        margin: 10px auto 0;
        width: calc(100% - 16px);
    }

    .brand-logo img {
        height: 42px;
        max-height: 42px;
    }

    .main-navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 14px;
    }

    .main-navigation a {
        font-size: 0.78rem;
        letter-spacing: 1px;
    }

    .media-container {
        padding: 20px 10px 60px;
    }

    .media-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .media-search input {
        width: 100%;
    }

    #mediaGrid, 
    .media-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .media-card-image {
        height: 180px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-main-display {
        height: 35vh;
        min-height: 180px;
    }
}
