/* Premium Modal Lightbox CSS */
.ig-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ig-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.ig-modal-container {
    background: #fff;
    width: 100%;
    max-width: 1000px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.ig-modal-overlay.active .ig-modal-container {
    transform: scale(1);
}

/* Header */
.ig-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    position: relative;
}

.ig-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 40px;
}

.ig-modal-close {
    background: #4f46e5;
    border: none;
    padding-top: 15px;
    padding-right: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    width: 40px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    line-height: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.ig-modal-close:hover {
    background: #4338ca;
    color: #fff;
    transform: translateY(-52%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Body */
.ig-modal-body {
    flex: 1;
    overflow: auto;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 300px;
}

.ig-modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
}

/* Footer */
.ig-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ig-modal-description {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

.ig-modal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
}

.ig-modal-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ig-modal-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.ig-modal-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.ig-modal-counter {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Loading Spinner */
.ig-modal-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .ig-modal-overlay {
        padding: 0;
    }
    .ig-modal-container {
        max-height: 100vh;
        border-radius: 0;
    }
    .ig-modal-image {
        max-height: 60vh;
    }
}
