/* Image Gallery Widget - Minimal Conflict-Free Styles */

/* Widget Container */
.igw-widget {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* Main Gallery View */
.igw-main-view {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.igw-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.igw-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}

/* Image Counter */
.igw-counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

/* Gallery Buttons - Enhanced for conflict resolution */
.igw-buttons {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 99999 !important;
}

.igw-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.5px !important;
    pointer-events: auto !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.igw-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: translateY(-2px) !important;
}

.igw-btn:active {
    transform: translateY(0) !important;
}

.igw-btn svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
    pointer-events: none !important;
}

/* Navigation Arrows - Enhanced for conflict resolution */
.igw-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.igw-nav:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.igw-nav:active {
    transform: translateY(-50%) scale(0.95) !important;
}

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

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

.igw-nav svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
    pointer-events: none !important;
}

/* Categories Modal */
.igw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.igw-modal.igw-active {
    display: block;
}

.igw-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.igw-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    background: white;
    border-radius: 12px;
    margin: 5% auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.igw-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.igw-modal-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.igw-modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.igw-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
}

.igw-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Category Tabs */
.igw-tabs {
    display: flex;
    padding: 0 30px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.igw-tab {
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 15px 25px;
    margin-right: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
}

.igw-tab:hover,
.igw-tab.igw-active {
    background: #4a7c59;
    color: white;
    transform: translateY(-2px);
}

/* Category Content */
.igw-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.igw-images {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.igw-images.igw-active {
    display: grid;
}

.igw-image-item {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.igw-image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.igw-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.igw-image-item:hover img {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .igw-main-view {
        height: 50vh;
        min-height: 300px;
    }
    
    .igw-buttons {
        top: 10px;
        left: 10px;
    }
    
    .igw-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .igw-counter {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .igw-nav {
        width: 40px;
        height: 40px;
    }
    
    .igw-nav-prev {
        left: 10px;
    }
    
    .igw-nav-next {
        right: 10px;
    }
    
    .igw-modal-content {
        width: 95%;
        height: 90%;
        margin: 2.5% auto;
    }
    
    .igw-modal-header {
        padding: 20px 20px 15px;
    }
    
    .igw-modal-header h3 {
        font-size: 20px;
    }
    
    .igw-tabs {
        padding: 0 20px;
    }
    
    .igw-tab {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .igw-content {
        padding: 20px;
    }
    
    .igw-images {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .igw-image-item {
        height: 50vh;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .igw-main-view {
        height: 40vh;
        min-height: 250px;
    }
    
    .igw-image-item {
        height: 40vh;
        min-height: 250px;
    }
}
