/* Gallery Page Styles for UNMI Bogor Website */

/* Main Content */
.main-content {
    padding-top: 10px;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Gallery Section */
.gallery-section {
    padding: 2rem 0;
}

/* Page Header */
.page-header {
    margin-bottom: 3rem;
}

.page-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.page-subtitle {
    color: #6c757d;
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 0;
}

/* Gallery Filter */
.gallery-filter {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
}

.gallery-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px 15px 0 0;
}

.filter-label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: block;
}

.filter-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 0 0.5rem;
    justify-content: start;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: all 0.4s ease;
    cursor: pointer;
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.gallery-overlay i {
    color: white;
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1.2);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.3rem;
}

.btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
    background: #f8f9fa;
}

.modal-body img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 70vh;
    width: auto;
    margin: 0 auto;
    display: block;
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.gallery-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Fancybox Custom Styling */
.fancybox__container {
    --fancybox-bg: rgba(0, 0, 0, 0.95);
}

.fancybox__toolbar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 15px;
}

.fancybox__button {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.fancybox__caption {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.fancybox__nav {
    --fancybox-nav-width: 60px;
    --fancybox-nav-height: 60px;
}

.fancybox__nav .fancybox__button {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.fancybox__nav .fancybox__button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 5px;
    }
    
    .gallery-section {
        padding: 1rem 0;
    }
    
    .page-header {
        margin-bottom: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .page-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .page-subtitle {
        font-size: 1rem;
        text-align: center;
    }
    
    .gallery-filter {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .filter-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .filter-select {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.25rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body img {
        max-height: 60vh;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding-top: 2px;
    }
    
    .gallery-filter {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .filter-label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .filter-select {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.25rem;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 0.5rem;
    }
    
    .modal-body img {
        max-height: 50vh;
    }
}

/* Hover Effects Enhancement */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Image Loading Effect */
.gallery-item img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gallery-item img[src] {
    animation: none;
    background: none;
}

/* Accessibility */
.gallery-item:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.gallery-item:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gallery-overlay,
    .modal,
    .btn-close {
        display: none !important;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gallery-item:hover {
        transform: none;
    }
}

/* ===============================
   PAGINATION STYLES
   =============================== */

.pagination-wrapper {
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination {
    margin-bottom: 1rem;
}

.pagination .page-link {
    color: #667eea;
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin: 0 3px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pagination .page-link:hover {
    color: white;
    background-color: #667eea;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination .page-item.active .page-link {
    color: white;
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination-info small {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin: 0 2px;
    }
    
    .pagination-wrapper {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        margin: 0 1px;
    }
    
    .pagination-info small {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
