/* ==========================================================================
   SFM Gallery Page Styles
   Modern, interactive gallery with filtering
   ========================================================================== */

/* Gallery Page Specific Variables */
:root {
    --gallery-gradient: linear-gradient(135deg, rgba(11, 93, 42, 0.05), rgba(244, 196, 48, 0.02));
    --gallery-shadow: 0 8px 25px rgba(11, 93, 42, 0.1);
    --gallery-overlay: rgba(11, 93, 42, 0.85);
    --filter-active: #0b5d2a;
}

/* Gallery Hero Section */
.gallery-hero {
    padding-top: 8rem;
    padding-bottom: 4rem;
    background: var(--gallery-gradient);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="%230b5d2a" opacity="0.03"><path d="M0,0 Q50,20 100,0 L100,100 Q50,80 0,100 Z"/></svg>');
    background-size: cover;
    z-index: 0;
}

.gallery-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease-out;
}

.gallery-hero-text {
    max-width: 800px;
    margin-bottom: 3rem;
}

.gallery-hero-text .page-title {
    font-size: 3.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    background: var(--gradient-premium);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.gallery-hero-text .page-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.gallery-hero-text .hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

.gallery-hero-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.stat {
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--gallery-shadow);
    min-width: 150px;
    transition: transform var(--transition-medium);
}

.stat:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--dark-gray);
    font-weight: 600;
}

/* Gallery Filter Section */
.gallery-filter {
    position: sticky;
    top: 80px;
    z-index: 100;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(11, 93, 42, 0.2);
}

.filter-btn.active i {
    color: var(--white);
}

.filter-btn i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.filter-info {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--medium-gray);
}

.filter-info p {
    color: var(--dark-gray);
    font-size: 1.1rem;
    margin: 0;
}

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

.gallery-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
    transition: all var(--transition-medium);
    animation: fadeInUp 0.6s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.gallery-item.show {
    opacity: 1;
}

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

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

.gallery-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 93, 42, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-medium);
}

.gallery-item:hover .gallery-overlay {
    background: rgba(11, 93, 42, 0.7);
}

.view-btn {
    width: 50px;
    height: 50px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-round);
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .view-btn {
    opacity: 1;
    transform: scale(1);
}

.view-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: scale(1.1);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-title {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.gallery-category {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.gallery-description {
    color: var(--dark-gray);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--medium-gray);
}

#loadMore {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

#loadMore i {
    transition: transform var(--transition-medium);
}

#loadMore.loading i {
    animation: spin 1s linear infinite;
}

.gallery-count {
    margin-top: 1rem;
    color: var(--dark-gray);
    font-size: 1rem;
}

.gallery-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Before & After Section */
.before-after-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.comparison-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
    transition: transform var(--transition-medium);
}

.comparison-card:hover {
    transform: translateY(-5px);
}

.comparison-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--medium-gray);
    position: relative;
}

.before-image,
.after-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.before-image img,
.after-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.comparison-card:hover .before-image img,
.comparison-card:hover .after-image img {
    transform: scale(1.05);
}

.image-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.before-image .image-label {
    background: var(--ghana-red);
}

.after-image .image-label {
    background: var(--primary-color);
}

.comparison-info {
    padding: 2rem;
}

.comparison-title {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.comparison-description {
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.comparison-time {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

/* Gallery Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--gallery-shadow);
    transition: transform var(--transition-medium);
    border-top: 4px solid var(--secondary-color);
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-content {
    margin-bottom: 1.5rem;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--dark-gray);
    font-style: italic;
    position: relative;
    padding-left: 1.5rem;
}

.testimonial-text::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 0;
    font-size: 3rem;
    color: var(--secondary-color);
    opacity: 0.3;
    font-family: serif;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-round);
    overflow: hidden;
    flex-shrink: 0;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    flex-grow: 1;
}

.author-name {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}

.author-company {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin: 0;
}

/* Gallery CTA Section */
.cta-gallery {
    background: var(--gradient-premium);
    position: relative;
    overflow: hidden;
    color: var(--white);
    text-align: center;
}

.cta-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="white" opacity="0.05"/></svg>');
    background-size: 300px;
    opacity: 0.3;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.cta-title::after {
    display: none;
}

.cta-text {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

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

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.lightbox.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    width: 1000px;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    z-index: 10001;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-image-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

#lightbox-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.lightbox-info {
    padding: 2rem;
    background: var(--white);
    border-top: 1px solid var(--medium-gray);
}

#lightbox-title {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

#lightbox-description {
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

#lightbox-category {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

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

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-round);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(5px);
    pointer-events: all;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .before-after-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-hero-text .page-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding-top: 7rem;
    }
    
    .gallery-hero-text .page-title {
        font-size: 2.5rem;
    }
    
    .gallery-hero-text .page-subtitle {
        font-size: 1.3rem;
    }
    
    .gallery-hero-stats {
        gap: 1.5rem;
    }
    
    .stat {
        min-width: 120px;
        padding: 1rem 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .gallery-filter {
        position: static;
        top: auto;
    }
    
    .filter-buttons {
        gap: 0.8rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .before-after-grid {
        gap: 2rem;
    }
    
    .before-image,
    .after-image {
        height: 250px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cta-title {
        font-size: 2.2rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-large {
        width: 100%;
        max-width: 300px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .gallery-hero-text .page-title {
        font-size: 2rem;
    }
    
    .gallery-hero-text .page-subtitle {
        font-size: 1.1rem;
    }
    
    .gallery-hero-text .hero-description {
        font-size: 1rem;
    }
    
    .gallery-hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .stat {
        width: 100%;
        max-width: 200px;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-btn {
        white-space: nowrap;
    }
    
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    .gallery-image {
        height: 220px;
    }
    
    .before-image,
    .after-image {
        height: 200px;
    }
    
    .comparison-info {
        padding: 1.5rem;
    }
    
    .comparison-title {
        font-size: 1.4rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
    
    .cta-text {
        font-size: 1.1rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Staggered Animation for Gallery Items */
.gallery-item {
    animation-delay: calc(var(--item-index) * 0.1s);
}

/* Smooth Filter Transitions */
.gallery-container {
    transition: height var(--transition-medium);
}

/* Loading State */
.gallery-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* No Results State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.no-results i {
    font-size: 3rem;
    color: var(--medium-gray);
    margin-bottom: 1.5rem;
}

.no-results h3 {
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--dark-gray);
    opacity: 0.8;
}