/* Enhanced Gallery Styles - Mobile-First Approach */

/* Category Buttons */
.gallery-categories {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

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

.category-btn:hover::before {
    left: 100%;
}

.category-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #ff6b35;
}

.category-btn:hover i {
    transform: scale(1.1);
}

.category-btn.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    border-color: #ff6b35;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.category-btn.active i {
    transform: scale(1.1);
}

/* Category Gallery Sections */
.category-gallery {
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 3rem;
}

.category-gallery.active {
    animation: slideIn 0.5s ease-out;
}

.category-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.category-header h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-header p {
    color: #6c757d;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.kilimanjaro-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Gallery Cards */
.gallery-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    background: #f8f9fa;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-card.large-card {
    grid-column: span 2;
    min-height: 350px;
}

.gallery-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.gallery-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-card .gallery-image,
.gallery-card .universal-slideshow-container {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Card Overlay */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    color: white;
    padding: 1.5rem;
    transform: translateY(60%);
    transition: all 0.4s ease;
}

.gallery-card:hover .card-overlay {
    transform: translateY(0);
}

.card-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.view-photos-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gallery-card:hover .view-photos-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Coming Soon Card */
.coming-soon {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border: 2px dashed #dadce0;
}

.coming-soon-content {
    text-align: center;
    color: #5f6368;
    padding: 2rem;
}

.coming-soon-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.coming-soon-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.coming-soon-content p {
    font-weight: 600;
    color: #ff6b35;
    margin-bottom: 0.5rem;
}

.coming-soon-content small {
    font-size: 0.8rem;
    opacity: 0.8;
}

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

.enhanced-image-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 400px;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modal-info {
    padding: 1.5rem;
    background: white;
    text-align: center;
}

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-counter {
    color: #ff6b35;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.modal-prev,
.modal-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255, 107, 53, 0.8);
    transform: scale(1.1);
}

.modal-thumbnails {
    display: flex;
    padding: 1rem;
    background: #f8f9fa;
    overflow-x: auto;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 #f8f9fa;
}

.modal-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.modal-thumbnail:hover,
.modal-thumbnail.active {
    opacity: 1;
    border-color: #ff6b35;
    transform: scale(1.05);
}

.modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .gallery-categories {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .category-btn {
        min-width: 100px;
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
    }
    
    .category-btn i {
        font-size: 1.2rem;
    }
    
    .category-header h3 {
        font-size: 1.5rem;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .gallery-card {
        min-height: 200px;
    }
    
    .gallery-card.large-card {
        grid-column: span 1;
        min-height: 300px;
    }
    
    .card-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
    }
    
    .view-photos-btn {
        opacity: 1;
        transform: translateY(0);
    }
    
    .enhanced-image-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-nav {
        display: none;
    }
    
    .modal-thumbnails {
        padding: 0.5rem;
    }
    
    .modal-thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .category-btn {
        min-width: 80px;
        padding: 0.6rem 0.8rem;
    }
    
    .category-header h3 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .gallery-card {
        min-height: 180px;
    }
    
    .card-info h4 {
        font-size: 1rem;
    }
    
    .card-info p {
        font-size: 0.8rem;
    }
}

/* Loading States */
.gallery-card.loading .universal-slideshow-container,
.gallery-card.loading .gallery-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* Error States */
.gallery-card.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.gallery-card.error::after {
    content: '⚠️ Failed to load image';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    text-align: center;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-card,
    .category-btn,
    .modal-image,
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus states for accessibility */
.category-btn:focus,
.gallery-card:focus,
.modal-close:focus,
.modal-prev:focus,
.modal-next:focus {
    outline: 3px solid #ff6b35;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .category-btn {
        border-width: 3px;
    }
    
    .card-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    }
}