/* Slide 3 - Brands */
.slide-brands {
    background: #000000;
    position: relative;
    overflow: hidden;
}

/* Brand Logos Layer - sits between video and black screen */
.brand-logos-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2rem;
    padding: 1.5rem;
    width: 85%;
    max-width: 1100px;
    max-height: 90vh;
    pointer-events: none;
}

.brand-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    overflow: hidden;
}

.brand-logo-item img {
    max-width: 100%;
    max-height: 160px;
    min-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .brand-logos-container {
        gap: 2rem;
        width: 90%;
        max-width: 900px;
    }

    .brand-logo-item img {
        max-height: 180px;
        min-width: 120px;
    }
}

/* Responsive - Mobile: 2 columns, 6 rows layout (12 logos) */
@media (max-width: 768px) {
    .brand-logos-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 1.5rem;
        width: 85%;
        max-width: 450px;
    }

    .brand-logo-item img {
        max-height: 150px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .brand-logos-container {
        gap: 1rem;
        width: 90%;
        max-width: 400px;
    }

    .brand-logo-item img {
        max-height: 130px;
        min-width: 90px;
    }

    .brand-logo-item {
        padding: 0.5rem;
    }
}

.slide-brands .grid-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(10, 1fr);
    z-index: 2;
    gap: 0;
}

.slide-brands .grid-box {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slide-brands .grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 1;
    transition: opacity 1.5s ease-in;
    pointer-events: none;
    will-change: opacity;
}

.slide-brands .grid-box:hover .grid-overlay,
.slide-brands .grid-box.hover-active .grid-overlay {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

/* Initial active state - shows one box on first load */
.slide-brands .grid-box.initial-active .grid-overlay {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

/* Fade out initial active state when user interacts - higher specificity */
.slide-brands .grid-box.initial-active.fade-out .grid-overlay {
    opacity: 1 !important;
    transition: opacity 1.5s ease-in;
}

/* Mobile: Show only 16 boxes */
@media (max-width: 768px) {
    .slide-brands .grid-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
    
    /* Hide all boxes after the 16th one */
    .slide-brands .grid-box:nth-child(n+17) {
        display: none;
    }
}

/* Slide 3 - Text Content */
.slide-brands-text {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.8rem;
    pointer-events: none;
    font-family: 'Courier', monospace;
    padding: 2rem 0 2rem 2rem;
}

.brands-text-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
    width: 100%;
}

.text-char {
    display: inline-block;
    color: rgba(173, 216, 230, 0.95);
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: 'Courier', monospace;
    text-align: center;
    min-width: 1.2em;
}

/* Responsive text sizing */
@media (max-width: 1024px) {
    .text-char {
        font-size: 1rem;
    }
    .slide-brands-text {
        right: 0;
        padding: 1.5rem 0 1.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .text-char {
        font-size: 0.85rem;
    }
    .brands-text-line {
        gap: 0.2rem;
    }
    .slide-brands-text {
        right: 0;
        padding: 1.5rem 0 1.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .text-char {
        font-size: 0.7rem;
    }
    .brands-text-line {
        gap: 0.15rem;
    }
    .slide-brands-text {
        right: 0;
        padding: 1rem 0 1rem 1rem;
    }
}

/* Slide 3 - YouTube Icon */
.youtube-icon-link {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 15;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: auto;
}

.youtube-icon-link:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.youtube-icon {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

/* Responsive YouTube icon */
@media (max-width: 768px) {
    .youtube-icon-link {
        top: 15px;
        right: 15px;
    }

    .youtube-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .youtube-icon-link {
        top: 10px;
        right: 10px;
    }

    .youtube-icon {
        width: 20px;
        height: 20px;
    }
}

/* Slide 3 - Inline YouTube Icon (after text) */
.youtube-icon-link-inline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.3em;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: auto;
    line-height: 1;
}

.youtube-icon-link-inline:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.youtube-icon-inline {
    width: 10px;
    height: 10px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
}

/* Responsive inline YouTube icon */
@media (max-width: 1024px) {
    .youtube-icon-inline {
        width: 9px;
        height: 9px;
    }
}

@media (max-width: 768px) {
    .youtube-icon-inline {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .youtube-icon-inline {
        width: 7px;
        height: 7px;
    }
}
