/* Demo Video Player - Shared component for subpages */
/* Matches the homepage video player styling exactly */

.dp-section {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 10px 40px rgba(26, 35, 50, 0.15);
    margin-bottom: 1.5rem;
}

.dp-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.dp-tab {
    flex: 1 1 auto;
    padding: 0.7rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    border-bottom: none;
    overflow: hidden;
    white-space: nowrap;
}

.dp-tab:hover {
    background: linear-gradient(135deg, #d4b583, #c9a66b);
    color: #1a2332;
    transform: translateY(-2px);
}

.dp-tab.active {
    background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
    color: #1a2332;
    border-color: #c9a66b;
    border-bottom: none;
}

.dp-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #c9a66b;
}

.dp-video-wrap {
    display: block;
    margin: 0 auto;
}

.dp-container {
    position: relative;
    width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    background: #000;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.dp-container video {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.dp-thumb-grid {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    gap: 14px;
    padding: 5% 15%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    align-content: center;
    z-index: 5;
    box-sizing: border-box;
}

.dp-thumb-grid.active { display: grid; }

.dp-thumb-grid.active .dp-thumb-item {
    animation: dpThumbFadeIn 0.4s ease forwards;
}

@keyframes dpThumbFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.dp-thumb-grid.active ~ .dp-click-overlay,
.dp-thumb-grid.active ~ .dp-play-btn { display: none; }

.dp-thumb-item {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.dp-thumb-item:hover {
    border-color: #c9a66b;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dp-thumb-item:hover .dp-thumb-label {
    background: #c9a66b;
    color: #1a2332;
}

.dp-thumb-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #000;
    display: block;
}

.dp-thumb-label {
    padding: 5px 8px;
    background: #1a2332;
    color: white;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s ease, color 0.2s ease;
}

.dp-close-btn {
    position: absolute;
    top: 3%; right: 3%;
    width: auto; height: auto;
    background: none;
    border: none;
    color: white;
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    cursor: pointer;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.dp-close-btn:hover { color: #c9a66b; transform: scale(1.15); }
.dp-close-btn.visible { display: flex; }

.dp-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90px; height: 90px;
    background: rgba(201, 166, 107, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dp-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #c9a66b;
    box-shadow: 0 6px 20px rgba(201, 166, 107, 0.5);
}

.dp-play-btn::after {
    content: '';
    width: 0; height: 0;
    border-left: 27px solid #1a2332;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    margin-left: 6px;
}

.dp-play-btn.hidden, .dp-click-overlay.hidden { display: none; }

.dp-click-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    cursor: pointer;
    z-index: 5;
}

/* Mobile category buttons */
.dp-mobile-cats { display: none; }

/* Responsive: Tablet */
@media (max-width: 768px) {
    .dp-section { padding: 1.5rem; }
    .dp-tabs { gap: 2px; }
    .dp-tab { padding: 0.6rem 1rem; font-size: 0.85rem; }
    .dp-play-btn { width: 50px; height: 50px; }
    .dp-play-btn::after { border-left: 15px solid #1a2332; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .dp-section { padding: 1rem; }
    .dp-tabs { display: none; }

    .dp-thumb-grid {
        gap: 4px;
        padding: 2% 3%;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.2) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    .dp-thumb-item { border-width: 1px; border-radius: 4px; min-width: 0; }
    .dp-thumb-item img { object-fit: cover; border-radius: 3px 3px 0 0; }
    .dp-thumb-label { font-size: 0.5rem; padding: 1px 3px; border-radius: 0 0 3px 3px; }

    .dp-close-btn {
        width: 28px; height: 28px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.6);
        text-shadow: none;
        font-size: 1rem;
        top: 4%; right: 4%;
    }

    .dp-video-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-width: 900px;
        margin: 0 auto;
    }

    .dp-container {
        width: 100%;
        min-width: 0;
        border-radius: 12px;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }

    .dp-container video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #000;
    }

    .dp-mobile-cats {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        width: 100%;
        position: relative;
        z-index: 10;
    }

    .dp-mobile-cat {
        padding: 0.55rem 0.3rem;
        background: linear-gradient(135deg, #1a2332, #2c3e50);
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 0.75rem;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        text-align: center;
        line-height: 1.2;
    }

    .dp-mobile-cat:hover {
        background: linear-gradient(135deg, #d4b583, #c9a66b);
        color: #1a2332;
    }

    .dp-mobile-cat.active {
        background: linear-gradient(135deg, #c9a66b, #d4b583);
        color: #1a2332;
        box-shadow: 0 2px 8px rgba(201, 166, 107, 0.4);
    }
}
