/* Gallery Components Styling */

/* Common Gallery Styles */
.gallery-header,
.gallery-header-homepage {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header .section-label,
.gallery-header-homepage .section-label {
    display: inline-block;
    background: linear-gradient(135deg, #2E5C8A 0%, #4A90C2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.gallery-header .section-title,
.gallery-header-homepage .section-title {
    font-size: 2.5rem;
    color: #2E5C8A;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

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

/* Course Detail Gallery */
.course-gallery-section {
    margin: 60px 0;
    padding: 60px 0;
    background: #f8f9fa;
}

.course-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

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

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(46, 92, 138, 0.8) 0%, rgba(74, 144, 194, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.gallery-overlay i {
    font-size: 2rem;
    color: white;
    animation: pulse 2s infinite;
}

/* About Page Gallery */
.about-gallery-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.about-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.about-gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: white;
}

.about-gallery-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

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

.about-gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.9);
}

.about-gallery-item .gallery-overlay {
    background: linear-gradient(45deg, rgba(46, 92, 138, 0.9) 0%, rgba(74, 144, 194, 0.9) 100%);
}

.about-gallery-item .overlay-content {
    text-align: center;
    color: white;
}

.about-gallery-item .overlay-content i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.about-gallery-item .overlay-content span {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Homepage Gallery Slider */
.homepage-gallery-section {
    padding: 80px 0;
    background: white;
    position: relative;
    overflow: hidden;
}

.homepage-gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, transparent 50%, #f8f9fa 100%);
    opacity: 0.5;
    z-index: 1;
}

.homepage-gallery-section .container {
    position: relative;
    z-index: 2;
}

.homepage-gallery-slider {
    position: relative;
    margin-top: 50px;
}

.gallery-slider-wrapper {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.gallery-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.gallery-slide {
    flex: 0 0 33.333%;
    padding: 0 15px;
}

.homepage-gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 300px;
}

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

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

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

.gallery-overlay-homepage {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(46, 92, 138, 0.85) 0%, rgba(74, 144, 194, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.gallery-overlay-homepage .overlay-content {
    text-align: center;
    color: white;
}

.gallery-overlay-homepage .overlay-content i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
    animation: bounceIn 0.5s ease;
}

.gallery-overlay-homepage .overlay-content span {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(46, 92, 138, 0.9);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.2rem;
}

.gallery-nav:hover {
    background: #2E5C8A;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(46, 92, 138, 0.3);
}

.gallery-nav.prev {
    left: -25px;
}

.gallery-nav.next {
    right: -25px;
}

/* Lightbox Styles */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .about-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .course-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .gallery-slide {
        flex: 0 0 50%;
    }
    
    .gallery-nav {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .gallery-header .section-title,
    .gallery-header-homepage .section-title {
        font-size: 2rem;
    }
    
    .gallery-header .section-subtitle,
    .gallery-header-homepage .section-subtitle {
        font-size: 1rem;
    }
    
    .course-gallery-section,
    .about-gallery-section,
    .homepage-gallery-section {
        padding: 50px 0;
    }
    
    .course-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 30px;
    }
    
    .about-gallery-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 30px;
    }
    
    .gallery-slide {
        flex: 0 0 100%;
    }
    
    .homepage-gallery-item {
        height: 250px;
    }
    
    .gallery-item img,
    .about-gallery-item img {
        height: 220px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #ddd;
        font-size: 1rem;
    }
    
    .gallery-nav.prev {
        left: -20px;
    }
    
    .gallery-nav.next {
        right: -20px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-header,
    .gallery-header-homepage {
        margin-bottom: 30px;
    }
    
    .gallery-header .section-title,
    .gallery-header-homepage .section-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .gallery-header .section-label,
    .gallery-header-homepage .section-label {
        font-size: 0.8rem;
        padding: 6px 15px;
    }
    
    .homepage-gallery-item {
        height: 200px;
    }
    
    .gallery-item img,
    .about-gallery-item img {
        height: 180px;
    }
    
    .gallery-overlay i,
    .gallery-overlay-homepage .overlay-content i {
        font-size: 1.5rem;
    }
    
    .about-gallery-item .overlay-content i {
        font-size: 2rem;
    }
    
    .gallery-overlay-homepage .overlay-content span,
    .about-gallery-item .overlay-content span {
        font-size: 0.9rem;
    }
    
    /* Hide navigation on very small screens */
    .gallery-nav {
        display: none;
    }
}

/* Loading Animation */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #2E5C8A;
}

.gallery-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.gallery-item:focus,
.about-gallery-item:focus,
.homepage-gallery-item:focus {
    outline: 3px solid #4A90C2;
    outline-offset: 2px;
}

.gallery-nav:focus,
.lightbox-nav:focus,
.lightbox-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .gallery-overlay,
    .gallery-overlay-homepage,
    .gallery-nav,
    .lightbox-nav,
    .lightbox-close {
        display: none !important;
    }
    
    .gallery-item img,
    .about-gallery-item img,
    .homepage-gallery-item img {
        filter: none !important;
        transform: none !important;
    }
}