/* Gallery Premium Styles - Pinterest/Instagram/Behance Inspired */

/* Gallery Wrapper */
.gallery-wrapper {
    min-height: 100vh;
    padding: 0;
    margin: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Filter Navigation */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 0;
}

.filter-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.5s;
}

.filter-tab:hover::before {
    left: 100%;
}

.filter-tab:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    transform: translateY(-1px);
}

.filter-tab.active {
    background: var(--primary);
    color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

/* Gallery Grid - Masonry Style */
.gallery-grid {
    columns: 4;
    column-gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: inline-block;
    width: 100%;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-item-category {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Loading Animation */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }
.loading-dots div:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.empty-state p {
    font-size: 16px;
    opacity: 0.7;
}

/* Gallery Modal Styles - Instagram Inspired */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 0;
}

.gallery-modal.show {
    display: flex !important;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-container {
    display: flex;
    max-width: 95vw;
    max-height: 95vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

.modal-image-section {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 70vh;
    max-width: 70%;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 400px;
    width: 100%;
}

/* Profile Section */
.modal-profile {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    border: 2px solid #e1e5e9;
}

.profile-avatar img {
    width: 100%;
    height: 100%;    
    object-fit: cover;
}

.profile-info h5 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.profile-role {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Content Info Section */
.modal-content-info {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.content-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.content-description {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.content-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-category {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.content-date {
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        columns: 3;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        columns: 2;
        column-gap: 15px;
        padding: 15px;
    }
    
    .gallery-item {
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .gallery-item-overlay {
        padding: 15px;
    }
    
    .filter-nav {
        padding: 30px 15px;
        gap: 6px;
    }
    
    .filter-tab {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Mobile Modal Styles */
    .modal-container {
        flex-direction: column;
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-image-section {
        flex: none;
        max-width: 100%;
        min-height: 50vh;
    }
    
    .modal-info-section {
        flex: none;
        min-width: auto;
        max-width: 100%;
    }    
    .modal-content-info {
        max-height: 30vh;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        columns: 1;
        padding: 10px;
    }
    
    .filter-nav {
        flex-wrap: wrap;
        padding: 20px 10px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 12px;    }
    
    .gallery-item {
        margin-bottom: 12px;
        border-radius: 10px;
    }
}


.modal-image-section {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 70vh;
 
}

.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 400px;
    width: 100%;
    max-height: 30vh;
    overflow-y: auto;
}