/* ===== INSTAGRAM-STYLE IMAGE VIEWER ===== */
.kilo-gallery-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 100000 !important;
    display: none !important;
    cursor: default !important;
    overflow: hidden !important;
}

.kilo-gallery-modal.kilo-active {
    display: block !important;
}

.kilo-modal-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
}

/* ===== HEADER BAR (TOP) ===== */
.kilo-modal-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    z-index: 100002 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.kilo-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.kilo-profile-pic {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #D4A041 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 14px !important;
}

.kilo-username {
    color: white !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin: 0 !important;
}

.kilo-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.kilo-action-btn {
    background: none !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.kilo-action-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.kilo-action-btn i {
    font-size: 20px !important;
}

.kilo-close-btn {
    font-size: 24px !important;
    padding: 4px !important;
}

/* ===== MAIN CONTENT ===== */
.kilo-modal-main {
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100001 !important;
}

.kilo-image-wrapper {
    position: relative !important;
    max-width: 70vw !important;
    max-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.kilo-modal-image {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5) !important;
    transition: transform 0.3s ease !important;
}

.kilo-modal-loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 50px !important;
    height: 50px !important;
    display: none !important;
}

.kilo-loading-spinner {
    width: 100% !important;
    height: 100% !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 3px solid #D4A041 !important;
    border-radius: 50% !important;
    animation: kilo-spin 1s linear infinite !important;
}

@keyframes kilo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== NAVIGATION ARROWS ===== */
.kilo-nav-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    transition: all 0.3s ease !important;
    z-index: 100002 !important;
}

.kilo-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.kilo-nav-prev {
    left: 20px !important;
}

.kilo-nav-next {
    right: 20px !important;
}

/* ===== BOTTOM BAR ===== */
.kilo-modal-footer {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    z-index: 100002 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.kilo-footer-left {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.kilo-footer-actions {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.kilo-footer-right {
    color: white !important;
    font-size: 14px !important;
    opacity: 0.8 !important;
}

.kilo-counter {
    font-weight: 600 !important;
    color: #D4A041 !important;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .kilo-modal-header {
        height: 50px !important;
        padding: 0 15px !important;
    }

    .kilo-modal-footer {
        height: 50px !important;
        padding: 0 15px !important;
    }

    .kilo-modal-main {
        top: 50px !important;
        bottom: 50px !important;
    }

    .kilo-image-wrapper {
        max-width: 90vw !important;
    }

    .kilo-nav-arrow {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    .kilo-nav-prev {
        left: 10px !important;
    }

    .kilo-nav-next {
        right: 10px !important;
    }

    .kilo-profile-pic {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    .kilo-username {
        font-size: 13px !important;
    }

    .kilo-action-btn i {
        font-size: 18px !important;
    }

    .kilo-footer-actions .kilo-action-btn {
        padding: 6px !important;
    }

    .kilo-footer-actions .kilo-action-btn i {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .kilo-modal-header {
        height: 45px !important;
        padding: 0 10px !important;
    }

    .kilo-modal-footer {
        height: 45px !important;
        padding: 0 10px !important;
    }

    .kilo-modal-main {
        top: 45px !important;
        bottom: 45px !important;
    }

    .kilo-nav-arrow {
        display: none !important; /* Hide arrows on very small screens, use swipe */
    }

    .kilo-image-wrapper {
        max-width: 95vw !important;
    }

    .kilo-header-left {
        gap: 8px !important;
    }

    .kilo-profile-pic {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }

    .kilo-username {
        font-size: 12px !important;
    }

    .kilo-header-right {
        gap: 12px !important;
    }

    .kilo-action-btn {
        padding: 4px !important;
    }

    .kilo-action-btn i {
        font-size: 16px !important;
    }

    .kilo-footer-left {
        gap: 12px !important;
    }

    .kilo-footer-actions {
        gap: 10px !important;
    }

    .kilo-footer-actions .kilo-action-btn {
        padding: 4px !important;
    }

    .kilo-footer-actions .kilo-action-btn i {
        font-size: 14px !important;
    }
}

/* ===== ACCESSIBILITY ===== */
.kilo-action-btn:focus,
.kilo-nav-arrow:focus,
.kilo-close-btn:focus {
    outline: 2px solid #D4A041 !important;
    outline-offset: 2px !important;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .kilo-gallery-modal {
        background: #000 !important;
    }

    .kilo-modal-header,
    .kilo-modal-footer {
        background: #000 !important;
        border-color: #fff !important;
    }

    .kilo-username,
    .kilo-counter {
        color: #fff !important;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .kilo-modal-image,
    .kilo-action-btn,
    .kilo-nav-arrow,
    .kilo-loading-spinner {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== PHOTO GRID OVERLAY ===== */
.kilo-photo-overlay-new {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(212, 160, 65, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: all 0.4s ease !important;
    cursor: pointer !important;
    border-radius: 8px !important;
}

.kilo-photo-item:hover .kilo-photo-overlay-new {
    opacity: 1 !important;
    background: rgba(212, 160, 65, 0.5) !important;
}

.kilo-photo-overlay-new i {
    color: white !important;
    font-size: 32px !important;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8)) !important;
    animation: kilo-pulse-glow 2s infinite !important;
}

@keyframes kilo-pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 15px rgba(212, 160, 65, 0.6));
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .kilo-modal-container {
        max-width: 95vw !important;
        max-height: 95vh !important;
    }

    .kilo-modal-close {
        top: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }

    .kilo-modal-nav {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    .kilo-modal-prev {
        left: 20px !important;
    }

    .kilo-modal-next {
        right: 20px !important;
    }

    .kilo-modal-image-container {
        max-height: 70vh !important;
        border-width: 3px !important;
        border-radius: 12px !important;
    }

    .kilo-modal-info {
        margin-top: 25px !important;
        padding: 18px 25px !important;
        border-radius: 25px !important;
    }

    .kilo-modal-counter {
        font-size: 18px !important;
    }

    .kilo-modal-title {
        font-size: 16px !important;
        max-width: 400px !important;
    }
}

@media (max-width: 480px) {
    .kilo-modal-nav {
        display: none !important; /* Hide navigation on small screens */
    }

    .kilo-modal-container {
        max-width: 98vw !important;
        max-height: 98vh !important;
    }

    .kilo-modal-close {
        top: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }

    .kilo-modal-image-container {
        max-height: 65vh !important;
        border-width: 2px !important;
        border-radius: 10px !important;
    }

    .kilo-modal-info {
        margin-top: 20px !important;
        padding: 15px 20px !important;
        border-radius: 20px !important;
    }

    .kilo-modal-counter {
        font-size: 16px !important;
    }

    .kilo-modal-title {
        font-size: 14px !important;
        max-width: 300px !important;
    }
}

/* ===== KEYBOARD FOCUS ===== */
.kilo-modal-close:focus,
.kilo-modal-nav:focus {
    outline: 2px solid #D4A041 !important;
    outline-offset: 2px !important;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .kilo-gallery-modal {
        background: #000 !important;
    }

    .kilo-modal-info {
        background: #000 !important;
        border: 2px solid #fff !important;
    }

    .kilo-modal-counter {
        color: #fff !important;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .kilo-modal-image,
    .kilo-photo-overlay-new,
    .kilo-modal-close,
    .kilo-modal-nav,
    .kilo-loading-spinner {
        transition: none !important;
        animation: none !important;
    }
}