/* AI Gallery CSS - assets/ai-gallery.css */

/* Container và Header */
.ai-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ai-gallery-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.ai-gallery-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(45deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-gallery-tagline {
    font-size: 1.2em;
    color: #7f8c8d;
    font-style: italic;
    margin: 0;
    opacity: 0.9;
}

/* Bộ lọc danh mục */
.ai-gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.ai-filter-btn {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.ai-filter-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ai-filter-btn:hover:before {
    left: 100%;
}

.ai-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

.ai-filter-btn.active {
    background: linear-gradient(45deg, #00b894, #00a085);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.4);
}

/* Grid Layout */
.ai-gallery-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.ai-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.ai-gallery-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.ai-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.ai-gallery-grid[data-columns="5"] {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Gallery Items */
.ai-gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ai-gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.ai-gallery-item-inner {
    position: relative;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
}

.ai-gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ai-gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay */
.ai-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.9), rgba(155, 89, 182, 0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-gallery-item:hover .ai-gallery-overlay {
    opacity: 1;
}

.ai-gallery-overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.ai-gallery-overlay-content h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.ai-gallery-zoom-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-gallery-zoom-btn:hover {
    background: white;
    color: #3498db;
    transform: scale(1.1);
}

/* Icon Zoom */
.ai-icon-zoom:before {
    content: "🔍";
    font-size: 18px;
}

/* Footer */
.ai-gallery-footer {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    margin-top: 20px;
}

.ai-gallery-footer p {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
}

.ai-gallery-footer strong {
    color: #e74c3c;
    font-weight: 700;
}

/* Lightbox */
.ai-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.ai-lightbox-content {
    position: relative;
    margin: 50px auto;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 100px);
}

.ai-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.ai-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-lightbox-close:hover {
    color: #e74c3c;
    background: rgba(0,0,0,0.8);
}

.ai-lightbox-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.ai-lightbox-prev,
.ai-lightbox-next {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: all;
}

.ai-lightbox-prev:hover,
.ai-lightbox-next:hover {
    background: rgba(52, 152, 219, 0.8);
    transform: scale(1.1);
}

.ai-lightbox-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
}

.ai-lightbox-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

/* Loading Animation */
.ai-gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.ai-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Animation */
.ai-gallery-item.fade-out {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.ai-gallery-item.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-gallery-container {
        padding: 15px;
    }
    
    .ai-gallery-title {
        font-size: 2em;
    }
    
    .ai-gallery-tagline {
        font-size: 1em;
    }
    
    .ai-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 15px;
    }
    
    .ai-gallery-filters {
        padding: 10px;
    }
    
    .ai-filter-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .ai-lightbox-content {
        margin: 20px auto;
        max-width: 95%;
        height: calc(100% - 40px);
    }
    
    .ai-lightbox-close {
        top: -30px;
        font-size: 25px;
        width: 40px;
        height: 40px;
    }
    
    .ai-lightbox-controls {
        padding: 0 10px;
    }
    
    .ai-lightbox-prev,
    .ai-lightbox-next {
        padding: 10px 15px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ai-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 10px;
    }
    
    .ai-gallery-title {
        font-size: 1.8em;
    }
    
    .ai-gallery-footer p {
        font-size: 0.9em;
    }
}