/* KZTEK Portfolio Popup Styles v3.0 */

/* ========================================
   Common Styles
   ======================================== */

.kztek-popup-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer !important;
}

.kztek-popup-link:hover {
    transform: scale(1.02);
}

.kztek-popup-link:hover .kztek-popup-overlay {
    opacity: 0.5;
}

.kztek-popup-link img {
    display: block;
    width: 100%;
    height: auto;
}

/* Gradient Overlay */
.kztek-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 30, 60, 0.6) 0%, rgba(0, 30, 60, 0.3) 50%, rgba(0, 30, 60, 0.6) 100%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Title styling - top left corner */
.kztek-popup-title {
    position: absolute;
    top: 20px;
    left: 20px;
    transform: none;
    color: white;
    padding: 0;
    text-align: left;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 80%;
    z-index: 2;
}

/* Hidden popup content */
.kztek-popup-content {
    display: none !important;
}

/* Notice */
.kztek-notice {
    background: #f0f0f1;
    padding: 15px;
    border-left: 4px solid #2271b1;
    margin: 10px 0;
}

/* ========================================
   Album Grid Styles
   ======================================== */

.kztek-album-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr;
}

.kztek-album-grid.columns-1 {
    grid-template-columns: 1fr;
}

.kztek-album-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.kztek-album-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.kztek-album-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.kztek-album-item {
    position: relative;
}

/* View More Item - centered title */
.kztek-viewmore-item .kztek-popup-title {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 18px;
    max-width: 90%;
    pointer-events: none;
}

.kztek-viewmore-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.kztek-viewmore-link:hover {
    transform: scale(1.02);
}

.kztek-viewmore-link:hover .kztek-popup-overlay {
    opacity: 0.5;
}

.kztek-viewmore-link img {
    display: block;
    width: 100%;
    height: auto;
}

.kztek-viewmore-item .kztek-popup-overlay {
    pointer-events: none;
}

/* ========================================
   Video Trigger Styles
   ======================================== */

.kztek-video-trigger {
    position: relative;
    width: 100%;
}

/* Play Button */
.kztek-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
}

.kztek-play-button svg {
    fill: #1a3a5c;
    margin-left: 5px;
}

.kztek-video-trigger .kztek-popup-link:hover .kztek-play-button {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video title at bottom */
.kztek-video-trigger .kztek-popup-title {
    top: auto;
    bottom: 20px;
    background: rgba(0, 30, 60, 0.8);
    border-radius: 4px;
    font-size: 16px;
    padding: 0 10px;
}

/* ========================================
   Gallery Grid (hidden for popup data)
   ======================================== */

.kztek-gallery-grid {
    display: none;
}

/* ========================================
   YouTube Wrapper
   ======================================== */

.kztek-youtube-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.kztek-youtube-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   Magnific Popup Gallery Overrides
   ======================================== */

.mfp-kztek-gallery .mfp-container {
    padding: 0 60px;
}

.mfp-kztek-gallery .mfp-img {
    max-height: 90vh;
    max-width: 90vw;
}

/* Arrows */
.mfp-kztek-gallery .mfp-arrow {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    opacity: 0.8;
}

.mfp-kztek-gallery .mfp-arrow:hover {
    opacity: 1;
}

.mfp-kztek-gallery .mfp-arrow:after,
.mfp-kztek-gallery .mfp-arrow:before {
    border: none;
    content: '';
    width: 20px;
    height: 20px;
    border-top: 4px solid #fff;
    border-right: 4px solid #fff;
    position: absolute;
    top: 50%;
    margin-top: -10px;
}

.mfp-kztek-gallery .mfp-arrow-left {
    left: 10px;
}

.mfp-kztek-gallery .mfp-arrow-left:after,
.mfp-kztek-gallery .mfp-arrow-left:before {
    transform: rotate(-135deg);
    left: 25px;
}

.mfp-kztek-gallery .mfp-arrow-right {
    right: 10px;
}

.mfp-kztek-gallery .mfp-arrow-right:after,
.mfp-kztek-gallery .mfp-arrow-right:before {
    transform: rotate(45deg);
    right: 25px;
}

.mfp-kztek-gallery .mfp-arrow-left .mfp-b,
.mfp-kztek-gallery .mfp-arrow-left .mfp-a,
.mfp-kztek-gallery .mfp-arrow-right .mfp-b,
.mfp-kztek-gallery .mfp-arrow-right .mfp-a {
    display: none;
}

/* Close button */
.mfp-kztek-gallery .mfp-close {
    color: #fff;
    font-size: 40px;
    width: 50px;
    height: 50px;
    top: 10px;
    right: 10px;
    opacity: 0.8;
}

/* Counter */
.mfp-kztek-gallery .mfp-counter {
    color: #fff;
    font-size: 16px;
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 4px;
}

/* Background */
.mfp-kztek-gallery.mfp-bg {
    background: rgba(0, 0, 0, 0.95);
}

/* ========================================
   Video Popup Overrides
   ======================================== */

.mfp-kztek-popup .mfp-content {
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
}

.mfp-kztek-popup .mfp-inline-holder .mfp-content,
.mfp-kztek-popup .mfp-ajax-holder .mfp-content {
    background: transparent;
    padding: 0;
}

.mfp-kztek-popup .mfp-close {
    color: #fff;
    font-size: 40px;
    top: -40px;
    right: 0;
}

.mfp-kztek-popup .kztek-youtube-wrapper {
    display: block !important;
}

/* ========================================
   Fade Animation
   ======================================== */

.mfp-fade.mfp-bg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mfp-fade.mfp-bg.mfp-ready {
    opacity: 0.95;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {

    .kztek-album-grid.columns-3,
    .kztek-album-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .kztek-popup-title {
        font-size: 14px;
        padding: 10px 15px;
    }

    .kztek-play-button {
        width: 60px;
        height: 60px;
    }

    .mfp-kztek-gallery .mfp-container {
        padding: 0 40px;
    }
}

@media (max-width: 480px) {

    .kztek-album-grid.columns-2,
    .kztek-album-grid.columns-3,
    .kztek-album-grid.columns-4 {
        grid-template-columns: 1fr;
    }

    .mfp-kztek-gallery .mfp-container {
        padding: 0 10px;
    }
}