/* Galeri Page Styles - Updated to match public theme */
:root {
    --primary-color: #dc3545;
    --secondary-color: #ffc107;
    --dark-color: #495057;
    --light-color: #ffffff;
}

/* Image Viewer Modal */
#imageViewerModal .modal-content {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.98) 0%, rgba(0, 0, 0, 0.95) 50%, rgba(220, 53, 69, 0.98) 100%) !important;
    border: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#imageViewerModal .modal-dialog {
    max-width: 95%;
    margin: 0 auto;
}

#imageViewerModal .modal-header {
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 1rem 1rem 0 0;
}

#imageViewerModal .modal-title {
    color: #ffc107;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#imageViewerModal #modalImage {
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
    border-radius: 1rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 193, 7, 0.2);
}

#imageViewerModal .btn-close-white {
    filter: invert(1);
    opacity: 0.9;
    background: rgba(220, 53, 69, 0.3);
    border-radius: 50%;
    padding: 0.75rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#imageViewerModal .btn-close-white:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.6);
    transform: rotate(90deg);
}

/* Mobile optimizations for modal */
@media (max-width: 768px) {
    #imageViewerModal .modal-dialog {
        max-width: 100%;
        margin: 0;
        height: 100vh;
        display: flex;
        align-items: center;
    }
    
    #imageViewerModal .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    #imageViewerModal #modalImage {
        max-height: 90vh;
        width: 100%;
        object-fit: contain;
    }
    
    #imageViewerModal .modal-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
    }
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #dc3545 0%, #000000 50%, #ffc107 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="particles" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="0.5" fill="white" opacity="0.1"/><circle cx="18" cy="18" r="0.3" fill="white" opacity="0.1"/><circle cx="10" cy="15" r="0.4" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23particles)"/></svg>');
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

/* Filter Tabs */
.filter-tabs {
    margin-bottom: 2rem;
}

.filter-tabs .nav-pills .nav-link {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    color: var(--dark-color);
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
}

.filter-tabs .nav-pills .nav-link:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-tabs .nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #e74c3c 100%);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.gallery-item {
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out;
}

.gallery-item.hidden {
    display: none;
}

.gallery-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    height: 100%;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 53, 69, 0.15);
    border-color: var(--primary-color);
}

.image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 100%; /* Forces 1:1 aspect ratio */
    height: 0;
}

@media (max-width: 768px) {
    .image-container {
        width: 100%;
        padding-bottom: 100%;
    }
}

@media (max-width: 576px) {
    .image-container {
        width: 100%;
        padding-bottom: 100%;
    }
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

@media (max-width: 768px) {
    .gallery-image {
        height: 100%;
    }
}

@media (max-width: 576px) {
    .gallery-image {
        height: 100%;
    }
}

.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.image-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.gallery-card:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    margin-bottom: 0.5rem;
}

.image-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.image-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.image-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-badge, .date-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.overlay-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 0.5rem;
}

.action-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid rgba(255, 193, 7, 0.8);
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn i {
    font-size: 1.5rem;
}

.action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.5);
}

.view-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--dark-color);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.5);
}

.download-btn:hover {
    background: #28a745;
    border-color: #28a745;
    color: white;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.5);
}

/* Modal Styling */
.modal-xl {
    max-width: 90vw;
}

#imageViewerModal .modal-content {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
}

#modalImage {
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.empty-icon {
    margin-bottom: 2rem;
}

.empty-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-text {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 0;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .filter-tabs .nav-pills .nav-link {
        margin: 0.25rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .image-overlay {
        padding: 1rem 1rem 1.5rem 1rem;
        justify-content: flex-end;
    }
    
    .image-title {
        font-size: 1.1rem;
    }
    
    .overlay-actions {
        gap: 0.75rem;
        justify-content: center;
        padding: 0.5rem 0;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .action-btn i {
        font-size: 1.25rem;
    }
    
    .page-header {
        padding: 3rem 0;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 2.5rem 0;
    }
    
    .filter-tabs .nav-pills {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-tabs .nav-pills .nav-link {
        margin: 0.25rem 0.125rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}
