/* Gallery Page Styles */

/* Hero Section */
.gallery-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.gallery-hero::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="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.6;
}

.gallery-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-hero .hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gallery-hero .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #e21a22;
}

.gallery-hero .separator {
    color: rgba(255, 255, 255, 0.5);
}

.gallery-hero .hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.gallery-hero .hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(226, 26, 34, 0.1);
    color: #e21a22;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

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

/* Gallery Grids */
.gallery-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

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

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

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

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

/* Gallery Items */
.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.featured-item {
    min-height: 400px;
}

.gallery-placeholder {
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    text-align: center;
    padding: 2rem;
}

.placeholder-icon {
    margin-bottom: 1rem;
    color: #adb5bd;
}

.gallery-placeholder p {
    font-size: 1.1rem;
    margin: 0;
}

.gallery-placeholder small {
    font-size: 0.9rem;
    color: #868e96;
}

/* Alternating Section Backgrounds */
.featured-gallery {
    background: #fff;
    padding: 80px 0;
}

.events-gallery {
    padding: 80px 0;
    color: white;

    background-image: url(/wp-content/themes/transglobal/images/dark-pattern.webp);
        background-repeat: repeat;
        background-position: center center;
        background-size: cover;
        background-color: #062E39;
}

.events-gallery .section-header h2 {
    color: white;
}

.events-gallery .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

.community-gallery {
    background: #fff;
    padding: 80px 0;
}

.partnerships-gallery {
    background: #1a1a1a;
    padding: 80px 0;
    color: white;
}

.partnerships-gallery .section-header h2 {
    color: white;
}

.partnerships-gallery .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

.innovation-gallery {
    background: #fff;
    padding: 80px 0;
}

.gallery-cta {
    background: linear-gradient(135deg, #e21a22 0%, #c41419 100%);
    padding: 80px 0;
    color: white;
    text-align: center;
}

/* CTA Section */
.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #e21a22;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.btn-primary:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: white;
    color: #e21a22;
    border-color: white;
    transform: translateY(-2px);
}

/* LinkedIn iframe styles */
.gallery-item iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 80px 0 60px;
    }
    
    .gallery-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .gallery-hero .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .gallery-hero .breadcrumb {
        flex-direction: column;
        gap: 0.5rem;
    }
     
    .section-header h2 {
        font-size: 2rem;
    }
    
    .featured-grid,
    .events-grid,
    .community-grid,
    .partnerships-grid,
    .innovation-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-placeholder {
        height: 250px;
        padding: 1.5rem;
    }
    
    .featured-item {
        min-height: 300px;
    }
    
    .featured-gallery,
    .events-gallery,
    .community-gallery,
    .partnerships-gallery,
    .innovation-gallery,
    .gallery-cta {
        padding: 60px 0;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .running-item {
        width: 250px;
        height: 160px;
        margin-right: 1.5rem;
    }
    
    .running-track {
        gap: 0; /* Keep gap at 0 */
        /* Animation duration will be set dynamically by JavaScript */
    }
    
    .all-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem 2rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .modal-prev,
    .modal-next {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .modal-nav {
        left: 10px;
        right: 10px;
    }
    
    .all-images-modal .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

@media (max-width: 480px) {
    .gallery-hero .hero-title {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .gallery-placeholder {
        height: 200px;
        padding: 1rem;
    }
    
    .gallery-placeholder p {
        font-size: 1rem;
    }
    
    .featured-item {
        min-height: 250px;
    }
    
    .running-item {
        width: 200px;
        height: 130px;
        margin-right: 1rem;
    }
    
    .running-track {
        /* Animation duration will be set dynamically by JavaScript */
        gap: 0;
    }
    
    .all-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .modal-image-container {
        height: 160px;
    }
    
    .view-all-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-prev,
    .modal-next {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .modal-nav {
        left: 5px;
        right: 5px;
    }
}

/* Animation for gallery items */
.gallery-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }

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

/* Dark section specific styles */
.events-gallery .gallery-item,
.partnerships-gallery .gallery-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.events-gallery .section-badge,
.partnerships-gallery .section-badge {
    background: rgba(226, 26, 34, 0.2);
    color: #ff4757;
}

/* Container */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* Section Backgrounds */
.featured-gallery {
    background: #fff;
    padding: 80px 0;
}

.events-gallery .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

.community-gallery {
    background: #fff;
    padding: 80px 0;
}

.hampers-gallery {
    background: #fff;
    padding: 80px 0;
    color: black;
}

.hampers-gallery .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

.ppe-gallery {
    padding: 80px 0;
    color: white;
    background-image: url(/wp-content/themes/transglobal/images/dark-pattern.webp);
        background-repeat: repeat;
        background-position: center center;
        background-size: cover;
        background-color: #062E39;
}

.ppe-gallery .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

/* Running Gallery Container */
.running-gallery-container {
    margin: 4rem 0;
    overflow: hidden;
    position: relative;
}

.running-row {
    display: flex;
    width: 100%;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    mask: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
}

.running-row:last-child {
    margin-bottom: 0;
}

.running-track {
    display: flex;
    gap: 0;
    /* Animation duration will be set dynamically by JavaScript */
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    width: max-content; /* Ensure proper width calculation */
}

/* Animation Directions - Continuous chain effect */
.running-left-to-right .running-track {
    animation-name: slideLeftToRight;
}

.running-right-to-left .running-track {
    animation-name: slideRightToLeft;
}

/* Running Animations - Continuous chain with no gaps */
@keyframes slideLeftToRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(50%);
    }
}

@keyframes slideRightToLeft {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Running Items */
.running-item {
    flex: 0 0 auto;
    width: 300px;
    height: 200px;
    position: relative;
    margin-right: 2rem; /* Consistent spacing */
}

.running-item:last-child {
    margin-right: 0; /* Remove margin from last item */
}

.running-image-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.running-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.running-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Removed overlay and file name display */
.running-overlay {
    display: none; /* Hide overlay completely */
}

.running-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    color: #6c757d;
    text-align: center;
}

/* Pause animation on hover */
.running-row:hover .running-track {
    animation-play-state: paused;
}

/* View All Button */
.middle-center {
    text-align: center;
    margin-top: 3rem;
}

.view-all-btn {
    background: #e21a22;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-btn:hover {
    background: #c41519;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(226, 26, 34, 0.3);
}

.btn-highlighted {
    background: #1e90ff !important;
}

.btn-highlighted:hover {
    background: #1c7ed6 !important;
    box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3) !important;
}

/* All Images Modal - Improved Layout */
.all-images-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    backdrop-filter: blur(5px);
}

.all-images-modal .modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 1400px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 2rem 3rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.modal-close {
    color: #666;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
}

.modal-close:hover {
    color: #e21a22;
    background: rgba(226, 26, 34, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 3rem;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    background: #fafafa;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.all-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.modal-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    background: white;
}

.modal-gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.modal-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.modal-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-gallery-content {
    text-align: center;
}

/* Remove file name display */
.modal-gallery-content h3 {
    display: none; /* Hide file names */
}

.gallery-zoom {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-zoom:hover {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Image Zoom Modal - Improved */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.image-modal .modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal .modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    color: white;
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e21a22;
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10002;
}

.modal-prev,
.modal-next {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: all;
    display: none;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(226, 26, 34, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(226, 26, 34, 0.4);
}

