/* ============================================
   OVERRIDE MAIN STYLE.CSS - Remove Auto Margins
   This MUST be at the top of the file
   ============================================ */

.section-title,
.section-subtitle {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* ============================================
   PROJECT DETAIL PAGE STYLES
   ============================================ */

/* Project Hero Section */
.project-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 80px;
    overflow: hidden;
}

.project-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    z-index: -1;
}

.project-hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/portfolio-hero-background.webp') center/cover;
    opacity: 0.1;
}

.project-hero-content {
    text-align: center;
    max-width: 800px;
}

.project-tag {
    display: inline-block;
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    color: #FFFFFF;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.project-title {
    font-size: 4rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 15px;
    line-height: 1.1;
}

.project-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.project-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.meta-item i {
    color: #00D4FF;
}

.project-hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Project Overview */
.project-overview {
    padding: 100px 0;
    background: #FFFFFF;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.overview-lead {
    font-size: 1.25rem;
    color: #1A1F3D;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.8;
}

.overview-content p {
    color: #4A5568;
    line-height: 1.8;
    margin-bottom: 20px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 77, 255, 0.1));
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-label {
    color: #4A5568;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   PROJECT OVERVIEW SECTION
   ============================================ */

.overview-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

/* Images */
.overview-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: block;
}


/* Videos - Match image styling */
.overview-image video {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: block;
    background: #000000;
    aspect-ratio: 16 / 9; /* Default video ratio */
}

/* Play Button Overlay for Videos */
.overview-image[data-video] {
    position: relative;
    cursor: pointer;
}

.overview-image[data-video]::before {
    content: '\f04b'; /* FontAwesome play icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 32px;
    pointer-events: none;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.4);
}

.overview-image[data-video]:hover::before {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 15px 50px rgba(123, 77, 255, 0.5);
}

/* Video thumbnail styling */
.overview-image[data-video] img,
.overview-image[data-video] video {
    position: relative;
    z-index: 1;
}

.overview-image img.natural-size,
img.natural-size {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Also ensure parent container doesn't constrain */
.overview-image:has(img.natural-size) {
    max-width: none !important;
    width: fit-content !important;
    margin: 0 auto !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .overview-image video {
        aspect-ratio: 16 / 9;
    }

    .overview-image[data-video]::before {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .overview-image video {
        aspect-ratio: 16 / 9;
    }

    .overview-image[data-video]::before {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* ============================================
   PROJECT ROLE SECTION - FLEXIBLE GRID
   ============================================ */

.project-role {
    padding: 100px 0;
    background: #F7FAFC;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.role-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 35px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

/* Full width modifier class - add this to cards that should span full row */
.role-card.full-width {
    grid-column: 1 / -1;
}

.role-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.role-icon i {
    font-size: 24px;
    color: #FFFFFF;
}

.role-card h3 {
    font-size: 1.25rem;
    color: #1A1F3D;
    margin-bottom: 20px;
}

.role-tasks {
    list-style: none;
    padding: 0;
    margin: 0;
}

.role-tasks li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: #4A5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

.role-tasks li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00D4FF;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .role-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
FLEXIBLE GALLERY GRID - 6 COLUMN BASE
============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 25px;
    margin-top: 50px;
    grid-auto-flow: dense;
    width: 100%;
}

/* Default: Portrait (2 columns, 1 row) */
.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #F7FAFC;
    aspect-ratio: 9 / 16;
    grid-column: span 2;
    grid-row: span 1;
    height: 100%;
    width: 100%;
    display: block;
}

/* Ensure images fill container */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Video overlay icon */
.gallery-item[data-video] {
    position: relative;
}

.gallery-item[data-video]::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 24px;
    pointer-events: none;
    z-index: 2;
    transition: transform 0.3s ease;
}

.gallery-item[data-video]:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
}

/* Gallery caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: #FFFFFF;
    padding: 20px 15px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

/* LARGE - Full container width */
.gallery-item.large {
    grid-column: 1 / 7 !important;
    grid-row: auto !important;
    aspect-ratio: 21 / 9;
}

/* LARGE-LANDSCAPE - 3 columns each */
.gallery-item.large-landscape {
    grid-column: span 3;
    aspect-ratio: 16 / 9;
}

/* WIDE - 4 columns */
.gallery-item.wide {
    grid-column: span 4;
    aspect-ratio: 21 / 9;
}

/* TALL - 2 columns, 2 rows */
.gallery-item.tall {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 9 / 20;
}

/* SQUARE - Fixed 2 columns, 1:1 aspect ratio */
.gallery-item.square {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
    min-height: 0;
}

/* Landscape (2 columns, 1 row) */
.gallery-item.landscape {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
}

/* Hover effects */
.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

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

/* ============================================
MOBILE RESPONSIVE - FIXED FOR iOS
============================================ */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    .gallery-item {
        grid-column: span 2;
    }

    .gallery-item.large,
    .gallery-item.large-landscape,
    .gallery-item.wide {
        grid-column: span 4;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
        margin-top: 30px;
    }

    .gallery-item {
        grid-column: span 1;
        grid-row: span 1;
        aspect-ratio: 9 / 16; /* Phone screenshot ratio */
        border-radius: 12px;
    }

    .gallery-item.large,
    .gallery-item.large-landscape,
    .gallery-item.wide,
    .gallery-item.tall {
        grid-column: span 2;
        aspect-ratio: 16 / 9;
    }

    .gallery-item.square {
        aspect-ratio: 1 / 1;
    }

    .gallery-caption {
        font-size: 0.8rem;
        padding: 12px 10px 10px;
    }

    .gallery-item[data-video]::after {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

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

    .gallery-item {
        grid-column: span 1;
        aspect-ratio: 9 / 16;
    }

    .gallery-item.large,
    .gallery-item.large-landscape,
    .gallery-item.wide {
        grid-column: span 1;
        aspect-ratio: 16 / 9;
    }
}

/* Technical Stack */
.project-stack {
    padding: 100px 0;
    background: #F7FAFC;
}

.stack-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.stack-category {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stack-category h3 {
    font-size: 1.1rem;
    color: #1A1F3D;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stack-category h3 i {
    color: #00D4FF;
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 77, 255, 0.1));
    color: #1A1F3D;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #E2E8F0;
}

/* Project Links */
.project-links {
    padding: 100px 0;
    background: #FFFFFF;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 50px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    padding: 25px;
    text-decoration: none;
    transition: all 0.3s;
}

.link-card:hover {
    border-color: #00D4FF;
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.15);
    transform: translateY(-3px);
}

.link-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-icon i {
    font-size: 20px;
    color: #FFFFFF;
}

.link-content {
    flex: 1;
}

.link-content h3 {
    font-size: 1rem;
    color: #1A1F3D;
    margin-bottom: 5px;
}

.link-content p {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
}

.link-arrow {
    color: #00D4FF;
    font-size: 1.2rem;
}

/* Project CTA */
.project-cta {
    padding: 100px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
}

.cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: #FFFFFF;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .project-title {
        font-size: 3rem;
    }
    
    .overview-grid,
    .role-grid,
    .stack-categories,
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .project-hero {
        padding: 100px 20px 60px;
    }
    
    .project-title {
        font-size: 2.5rem;
    }
    
    .project-subtitle {
        font-size: 1.2rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 15px;
    }
    
    .overview-stats {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .project-title {
        font-size: 2rem;
    }
    
    .project-hero-buttons {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   SECTION HEADERS - LEFT ALIGNED
   High specificity to override main style.css
   ============================================ */

/* Target each section type individually */
.project-overview .section-title,
.project-role .section-title,
.project-gallery .section-title,
.project-stack .section-title,
.project-links .section-title {
    text-align: left !important;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1A1F3D;
    margin-bottom: 15px;
    display: block !important;
}

.project-overview .section-subtitle,
.project-role .section-subtitle,
.project-gallery .section-subtitle,
.project-stack .section-subtitle,
.project-links .section-subtitle {
    text-align: left !important;
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
    margin-top: -10px;
    margin-bottom: 50px;
    display: block !important;
}

/* Ensure containers don't center content */
.project-overview .container,
.project-role .container,
.project-gallery .container,
.project-stack .container,
.project-links .container {
    text-align: left !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .project-overview .section-title,
    .project-role .section-title,
    .project-gallery .section-title,
    .project-stack .section-title,
    .project-links .section-title {
        font-size: 2rem !important;
    }

    .project-overview .section-subtitle,
    .project-role .section-subtitle,
    .project-gallery .section-subtitle,
    .project-stack .section-subtitle,
    .project-links .section-subtitle {
        font-size: 1rem !important;
    }
}

/* ============================================
   LIGHTBOX STYLES
   FIXED: Controls Don't Stack During Load
   ============================================ */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 31, 61, 0.95);
    backdrop-filter: blur(10px);
}

/* ============================================
   LIGHTBOX CONTENT (Media Only - No Controls)
   ============================================ */
.lightbox-content {
    position: relative;
    z-index: 10;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MEDIA CONTAINER (Images + Videos)
   ============================================ */
.lightbox-media-container {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

/* Image */
.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    display: block;
}

/* Video */
.lightbox-video {
    display: none;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Iframe (YouTube/Vimeo) */
.lightbox-iframe {
    display: none;
    max-width: 100%;
    max-height: 80vh;
    width: 80vw;
    height: 45vw;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LOADING SPINNER (Centered, High Z-Index)
   ============================================ */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 1000; /* Highest - above everything */
    pointer-events: none; /* Let clicks pass through */
}

.lightbox-spinner.show {
    display: flex;
}

.lightbox-spinner i {
    font-size: 48px;
    color: #FFFFFF;
    opacity: 0.9;
}

.lightbox-spinner .spinner-text {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
}

/* ============================================
   CONTROLS - POSITIONED RELATIVE TO LIGHTBOX (Not Content)
   This prevents them from centering during load
   ============================================ */

/* Close Button - Fixed to lightbox, not content */
.lightbox-close {
    position: fixed; /* Changed from absolute to fixed */
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10000; /* Above overlay, below nothing */
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Navigation Buttons - Fixed to viewport */
.lightbox-nav {
    position: fixed; /* Changed from absolute to fixed */
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10000; /* Above overlay */
}

.lightbox-nav:hover {
    background: linear-gradient(135deg, #00D4FF, #7B4DFF);
    transform: translateY(-50%) scale(1.1);
}

@media (hover: none) {
    .lightbox-nav:hover {
        transform: translateY(-50%);
    }
}

.lightbox-prev {
    left: 30px; /* Fixed position from viewport edge */
}

.lightbox-next {
    right: 30px; /* Fixed position from viewport edge */
}

/* Counter - Fixed to viewport */
.lightbox-counter {
    position: fixed; /* Changed from absolute to fixed */
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10000; /* Above overlay */
}

/* Caption - Fixed to viewport */
.lightbox-caption {
    position: fixed; /* Changed from absolute to fixed */
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    max-width: 80%;
    z-index: 10000; /* Above overlay */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-caption.show {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-image,
    .lightbox-video,
    .lightbox-iframe {
        max-height: 70vh;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.5);
    }

    .lightbox-counter {
        bottom: 20px;
    }

    .lightbox-caption {
        bottom: 70px;
        font-size: 0.9rem;
        max-width: 90%;
    }

    .lightbox-nav {
        display: none; /* Hide nav buttons on mobile, use swipe instead */
    }

    .lightbox-spinner i {
        font-size: 36px;
    }

    .lightbox-spinner .spinner-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .lightbox-caption {
        bottom: 60px;
        background: none;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .lightbox-iframe {
        width: 90vw;
        height: 50vw;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.lightbox-image[src=""] {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 77, 255, 0.1));
    min-height: 300px;
}

/* Animation for image transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-image {
    animation: fadeIn 0.3s ease;
}

/* Video fade in animation */
@keyframes videoIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-video[style*="display: block"],
.lightbox-iframe[style*="display: block"] {
    animation: videoIn 0.3s ease;
}
/* ============================================
iOS SPECIFIC FIXES
============================================ */
@supports (-webkit-touch-callout: none) {
    /* Fix gallery grid on iOS */
    .gallery-grid {
        -webkit-overflow-scrolling: touch;
    }

    /* Fix video modal on iOS */
    .video-modal {
        -webkit-overflow-scrolling: touch;
    }

    .video-modal-content iframe,
    .video-modal-content video {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
    }

    /* Prevent zoom on double-tap */
    .gallery-item {
        touch-action: manipulation;
    }

    /* Fix button tap highlight */
    .video-modal-close {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Force hardware acceleration for smooth animations */
.gallery-item,
.gallery-item img,
.video-modal-content {
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
}
