/* AKGallery Styles - Desktop Optimized */

.akgallery-wrapper {
    position: relative;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.akgallery-container {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
}

.akgallery-track {
    width: 100%;
    overflow: hidden;
}

.akgallery-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.akgallery-slide {
    flex: 0 0 auto;
    padding: 0 6px;
    box-sizing: border-box;
}

.akgallery-slide-inner {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
    height: 100%;
}

.akgallery-slide-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.akgallery-slide img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.akgallery-slide-inner:hover img {
    transform: scale(1.05);
}

.akgallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 25px 15px 15px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

/* Navigation Arrows - Desktop */
.akgallery-arrow {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid #e0e0e0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.akgallery-arrow:hover {
    background: #ffb400;
    color: white;
    border-color: #ffb400;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 180, 0, 0.3);
}

.akgallery-arrow:active {
    transform: scale(0.95);
}

.akgallery-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.5);
}

.akgallery-arrow:disabled:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
    border-color: #e0e0e0;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dots Navigation - Now outside wrapper */
.akgallery-dots {
    text-align: center;
    margin: 20px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    clear: both;
}

.akgallery-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.akgallery-dot:hover {
    border-color: #999;
    background: #f0f0f0;
    transform: scale(1.2);
}

.akgallery-dot.active {
    background: #333;
    border-color: #333;
}

/* Modal Styles with Enhanced Z-index Management */
.akgallery-modal {
    position: fixed;
    z-index: 2147483647 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    isolation: isolate;
}

.akgallery-modal.active {
    opacity: 1;
    visibility: visible;
    z-index: 2147483647 !important;
}

.akgallery-modal-content {
    position: relative;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2147483647;
}

.akgallery-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.akgallery-modal-caption {
    color: white;
    font-size: 18px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    max-width: 80%;
    line-height: 1.5;
    backdrop-filter: blur(10px);
}

.akgallery-modal-close {
    position: absolute;
    bottom: 20px;
    right: 30px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2147483647;
    transition: all 0.3s ease;
    line-height: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.akgallery-modal-close:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

.akgallery-modal-prev,
.akgallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2147483647;
    transition: all 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.akgallery-modal-prev:hover,
.akgallery-modal-next:hover {
    background: rgba(255, 180, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.akgallery-modal-prev {
    left: 30px;
}

.akgallery-modal-next {
    right: 30px;
}

/* Prevent body scroll when modal is open */
body.akgallery-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Desktop Responsive Design */
@media (min-width: 1200px) {
    .akgallery-wrapper {
        gap: 20px;
    }
    
    .akgallery-arrow {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
    
    .akgallery-slide img {
        height: 250px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .akgallery-slide img {
        height: 220px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .akgallery-wrapper {
        gap: 12px;
    }
    
    .akgallery-arrow {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .akgallery-slide img {
        height: 200px;
    }
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .akgallery-wrapper {
        gap: 10px;
    }
    
    .akgallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .akgallery-slide img {
        height: 180px;
    }
    
    .akgallery-modal-prev,
    .akgallery-modal-next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .akgallery-modal-close {
        width: 50px;
        height: 50px;
        font-size: 30px;
        top: 15px;
        right: 20px;
    }
    
    .akgallery-modal-content {
        max-width: 95%;
    }
    
    .akgallery-caption {
        font-size: 13px;
        padding: 20px 12px 12px;
    }
}

/* Mobile phones - stack arrows below gallery */
@media (max-width: 480px) {
    .akgallery-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .akgallery-container {
        order: 1;
        width: 100%;
    }
    
    /* Create navigation row below gallery */
    .akgallery-nav-mobile {
        order: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }
    
    .akgallery-arrow {
        background: rgba(255, 180, 0, 0.1);
        border: 2px solid #ffb400;
        color: #ffb400;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .akgallery-arrow:hover {
        background: #ffb400;
        color: white;
    }
    
    .akgallery-slide img {
        height: 200px;
    }
    
    .akgallery-caption {
        font-size: 12px;
        padding: 15px 10px 8px;
    }
    
    .akgallery-modal-prev {
        left: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .akgallery-modal-next {
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .akgallery-modal-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 10px;
        right: 15px;
    }
    
    .akgallery-modal-caption {
        font-size: 14px;
        padding: 12px 18px;
        max-width: 90%;
    }
    
    /* Larger dots for better touch interaction */
    .akgallery-dot {
        width: 14px;
        height: 14px;
        margin: 0 6px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .akgallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .akgallery-slide img {
        height: 140px;
    }
    
    .akgallery-wrapper {
        margin: 15px 0;
    }
    
    .akgallery-modal-prev,
    .akgallery-modal-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .akgallery-slide img {
        height: 120px;
    }
    
    .akgallery-modal-image {
        max-height: 60vh;
    }
}

/* Loading Animation */
.akgallery-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffb400;
    border-radius: 50%;
    animation: akgallery-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes akgallery-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.akgallery-arrow:focus,
.akgallery-dot:focus,
.akgallery-modal-close:focus,
.akgallery-modal-prev:focus,
.akgallery-modal-next:focus {
    outline: 2px solid #ffb400;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* {
    box-sizing: border-box;
}

.akgallery-wrapper * {
    box-sizing: border-box;
}