/* Pickleball Masterclass - CSS Styles */

/* Safe area support for modern devices */
:root {
    --safe-area-inset-top: env(safe-area-inset-top, 0);
    --safe-area-inset-right: env(safe-area-inset-right, 0);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0);
    --safe-area-inset-left: env(safe-area-inset-left, 0);
}

/* Font and Scroll Behavior */
html { 
    max-width: 100%;
    position: relative;
    overflow-x: clip; /* Prevent horizontal scroll */
    height: 100%;
}

body { 
    font-family: 'Inter', sans-serif; 
    scroll-behavior: smooth;
    padding-top: var(--safe-area-inset-top);
    padding-right: var(--safe-area-inset-right);
    padding-bottom: var(--safe-area-inset-bottom);
    padding-left: var(--safe-area-inset-left);
    max-width: 100%;
    position: relative;
    /* No overflow property on body to allow sticky positioning */
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure footer stays at bottom */
footer {
    margin-top: auto;
}

/* Prevent horizontal overflow on all major containers */
* {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Ensure all Tailwind container elements don't cause horizontal scroll */
.container {
    max-width: 100%;
    overflow-x: clip;
}

main {
    max-width: 100%;
    overflow-x: clip;
}

.anchor-padding { 
    scroll-margin-top: 100px; 
} /* Để bù cho sticky header */

/* ==================== New Navigation Styles ==================== */

/* Header Navigation Links */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link span:first-child {
    font-size: 1.25rem; /* Icon size */
}

.nav-link span:last-child {
    font-size: 0.9rem; /* Text size */
}

.nav-link:hover {
    color: #059669;
    background-color: #f0fdf4;
}

.nav-link.active {
    color: white;
    background-color: #10b981;
    font-weight: 600;
}

.nav-link.active:hover {
    background-color: #059669;
}

/* Mobile Navigation Links */
.mobile-nav-link {
    display: flex;
    align-items: center;
}

/* Mobile Menu Container */
#mobile-menu {
    max-height: calc(100vh - 72px); /* Full height minus header */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Page Navigation Buttons (Prev/Next) */
.page-nav-button {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    text-decoration: none;
}

.page-nav-button:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.page-nav-button.prev {
    justify-content: flex-start;
}

.page-nav-button.next {
    justify-content: flex-end;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: #6b7280;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #059669;
}

/* Back to top button animation */
#back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video responsive styling */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Clickable video container hover effect */
.video-container.cursor-pointer {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container.cursor-pointer:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Image optimization and loading states */
.media-image {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    background: transparent;
    object-fit: contain;
    max-height: 400px;
    width: auto;
    margin: 0 auto;
    display: block;
}

.media-image.loaded {
    opacity: 1;
}

.media-image:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Ensure images in slideshow fill properly */
.slideshow-slide .media-image {
    max-height: none;
    width: 100%;
    height: 100%;
}

/* Media caption styling */
.media-caption {
    font-style: italic;
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Remove overlay behavior for per-slide captions. Captions are rendered in a separate
   caption box (.slideshow-caption) below the media to avoid covering video controls. */
.slideshow-slide .media-caption {
    position: static;
    color: inherit;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

/* Caption shown below the media area and above the dots */
.slideshow-caption {
    font-style: italic;
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.4;
    margin-top: 4px; /* 4px spacing from media */
    padding: 2px 8px 0;
}

/* Loading placeholder animation */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.media-image[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Performance optimizations */
img {
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Preload hints */
.hero-section img,
.intro img {
    content-visibility: auto;
    contain-intrinsic-size: 800px 400px;
}

/* Interactive Tooltips */
.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 2px dotted #dc2626;
    transition: all 0.2s ease;
}

.tooltip:hover {
    color: #dc2626;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 420px;
    min-width: 280px;
    white-space: normal;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1f2937;
}

/* Different tooltip themes */
.tooltip-technique .tooltip-content {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.tooltip-technique .tooltip-content::after {
    border-top-color: #1e40af;
}

.tooltip-rule .tooltip-content {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.tooltip-rule .tooltip-content::after {
    border-top-color: #dc2626;
}

.tooltip-strategy .tooltip-content {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

.tooltip-strategy .tooltip-content::after {
    border-top-color: #7c3aed;
}

/* Mobile tooltip support */
.tooltip.active .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .tooltip-content {
        max-width: calc(100vw - 32px); /* Ensure tooltip fits within viewport */
        min-width: 240px;
        font-size: 13px;
        padding: 10px 12px;
        left: 50%;
        right: auto;
    }
    
    .tooltip-content::after {
        border-width: 6px;
    }
}

@media (max-width: 320px) {
    .tooltip-content {
        min-width: calc(100vw - 40px); /* Very small screens */
        max-width: calc(100vw - 32px);
    }
}

/* Header expansion */
#main-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background-color: white !important;
    width: 100%;
    max-width: 100vw;
}

/* Header should span full width when TOC exists */
@media (min-width: 1024px) {
    body.has-toc #main-header {
        margin-left: -280px;
        width: calc(100% + 280px);
        transition: none !important;
    }
}

/* Breadcrumb Styles */
.breadcrumb {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb-item:last-child {
    color: #1e40af;
    font-weight: 600;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #d1d5db;
}

.breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #1e40af;
}

/* Slideshow Styles */
.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: auto;
    border-radius: 8px;
    overflow: visible; /* allow caption/dots to sit outside media box */
    background: transparent; /* media wrapper has the visible background */
    z-index: 5;
    isolation: isolate;
    text-align: center; /* center inline elements like .slideshow-dots */
}

/* Wrapper that actually holds the media and keeps the aspect ratio */
.slideshow-media {
    position: relative;
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.slideshow-slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slideIn 0.5s ease-in-out;
    overflow: hidden; /* Ensure content doesn't overflow slides */
}

.slideshow-slide.active {
    display: block;
}

.slideshow-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    background: transparent;
}

.slideshow-slide .video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0; /* Override the previous padding-bottom */
}

.slideshow-slide .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.slideshow-nav {
    position: absolute; /* positioned relative to .slideshow-media */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease, opacity 0.3s ease;
    z-index: 50;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.slideshow-nav.hidden {
    opacity: 0;
    pointer-events: none;
}

.slideshow-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.slideshow-prev {
    left: 16px;
}

.slideshow-next {
    right: 16px;
}

.slideshow-counter {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
    transition: opacity 0.3s ease;
}

.slideshow-counter.hidden {
    opacity: 0;
    pointer-events: none;
}

.slideshow-dots {
    position: relative; /* in normal flow, below caption */
    display: inline-flex !important; /* size to content and allow centering */
    gap: 10px;
    z-index: 20; /* ensure above page content */
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important; /* Ensure visibility */
    justify-content: center;
    align-items: center;
    padding: 4px 6px;
    background: white; /* solid background for visibility */
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #cbd5e1;
    margin-top: 4px; /* space between caption and dots */
    flex-wrap: wrap; /* allow dots to wrap onto multiple lines */
    /* no max-width so container fits its content */
}

/* Remove hidden state for dots - they're always visible now */
.slideshow-dots.hidden {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.slideshow-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px; /* small outer spacing so wrap lines have breathing room */
}

.slideshow-dot:hover {
    border-color: #3b82f6;
    background: #3b82f6;
    transform: scale(1.3);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.slideshow-dot.active {
    background: #3b82f6;
    border-color: #2563eb;
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.slideshow-counter.hidden {
    opacity: 0;
    pointer-events: none;
}

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .slideshow-media {
        /* Slightly taller aspect ratio for mobile */
        aspect-ratio: 4 / 3;
    }
    
    .slideshow-nav {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .slideshow-prev {
        left: 8px;
    }
    
    .slideshow-next {
        right: 8px;
    }
    
    .slideshow-counter {
        font-size: 12px;
        padding: 3px 6px;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .slideshow-caption {
        font-size: 0.75rem;
        padding: 2px 8px 0;
    }
    
    /* Mobile dots styling */
    .slideshow-dots {
        gap: 8px;
        padding: 6px 10px;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .slideshow-dot {
        width: 8px !important;
        height: 8px !important;
        border-width: 1.5px;
    }
    
    .slideshow-dot:hover {
        transform: scale(1.2); /* Slightly less scale on mobile */
    }
    
    .slideshow-dot.active {
        transform: scale(1.15); /* Slightly less scale on mobile */
    }
}

/* Mobile responsiveness for main layout */
@media (max-width: 768px) {
    /* Enhanced mobile typography */
    h1 {
        font-size: clamp(2rem, 8vw, 4rem) !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: clamp(1.25rem, 5vw, 2rem) !important;
        line-height: 1.4 !important;
    }
    
    /* Improved touch targets */
    a, button {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px !important;
    }
    
    /* Better spacing for mobile */
    .grid {
        gap: 1rem !important;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.5rem !important;
    }
}

/* TikTok link styling */
.tiktok-link {
    background: linear-gradient(45deg, #ff0050, #00f2ea);
    background-size: 200% 200%;
    animation: tiktokGradient 3s ease infinite;
}

@keyframes tiktokGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced video container for mobile */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 62.5%; /* Slightly taller for mobile */
    }
}

/* Video fallback styles */
.video-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 12px;
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

.video-fallback:hover {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.video-fallback .fallback-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.video-fallback .fallback-text {
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.video-fallback .fallback-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.video-fallback .fallback-link:hover {
    background: #2563eb;
}

/* Special styling for TikTok external links */
.tiktok-external-link {
    background: linear-gradient(45deg, #ff0050, #00f2ea);
    background-size: 200% 200%;
    animation: tiktokGradient 3s ease infinite;
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 0, 80, 0.3);
}

.tiktok-external-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 0, 80, 0.4);
}

/* Image Preview Modal Styles */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.image-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.image-preview-content {
    position: relative;
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.image-preview-modal.active .image-preview-content {
    transform: scale(1);
}

#preview-media-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Consistent sizing for both image and video */
.image-preview-img,
#preview-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

#preview-video {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
}

#preview-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px 8px 0 0;
}

.image-preview-info {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.image-preview-title {
    font-size: 1rem !important;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.image-preview-caption {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    font-style: italic;
}

/* Preview modal dots (similar to slideshow dots) */
.preview-dots {
    display: none; /* Hidden by default on desktop/tablet */
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #cbd5e1;
    margin: 12px auto 0;
    flex-wrap: wrap;
    z-index: 100;
}

.preview-dots.hidden {
    display: none !important;
}

.preview-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
}

.preview-dot:hover {
    border-color: #3b82f6;
    background: #3b82f6;
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.preview-dot.active {
    background: #3b82f6;
    border-color: #2563eb;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Show dots only on mobile phones (buttons hidden) */
@media (max-width: 639px) {
    .preview-dots {
        display: inline-flex !important;
    }
}

.image-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-preview-close:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.image-preview-close svg {
    color: #374151;
}

/* Default: Hide navigation buttons */
.image-preview-nav {
    display: none;
}

/* Desktop & Tablet: Show buttons outside modal content */
@media (min-width: 640px) {
    /* Reduce modal width to make room for buttons */
    .image-preview-content {
        max-width: calc(100vw - 200px); /* Leave 100px on each side for buttons */
    }
    
    .image-preview-nav {
        display: block;
        position: fixed;
        top: 50%;
        left: 0;
        right: 0;
        transform: translateY(-50%);
        pointer-events: none;
        z-index: 10;
        width: 100%;
        max-width: none;
    }
    
    .image-preview-nav-btn {
        position: absolute;
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        pointer-events: auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .image-preview-nav-btn:hover {
        background: white;
        transform: scale(1.1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }
    
    .image-preview-prev {
        left: 16px;
    }
    
    .image-preview-next {
        right: 16px;
    }
    
    .image-preview-nav-btn svg {
        color: #374151;
        width: 28px;
        height: 28px;
    }
}

/* Large desktop: Even more space for buttons */
@media (min-width: 1024px) {
    .image-preview-content {
        max-width: calc(100vw - 280px); /* 140px on each side */
    }
    
    .image-preview-prev {
        left: 16px;
    }
    
    .image-preview-next {
        right: 16px;
    }
}

/* Mobile: Hide navigation buttons explicitly */
@media (max-width: 639px) {
    .image-preview-nav {
        display: none !important;
    }
}

/* Mobile responsive for image preview - Additional adjustments */
@media (max-width: 639px) {
    .image-preview-container {
        padding: 10px;
        flex-direction: column;
    }
    
    .image-preview-content {
        max-width: 95vw;
        max-height: 85vh; /* Leave space for dots */
        border-radius: 8px;
        display: flex;
        flex-direction: column;
    }
    
    #preview-media-container {
        max-height: 50vh;
        min-height: 300px;
    }
    
    .image-preview-img,
    #preview-image,
    #preview-video {
        max-height: 50vh;
        max-width: 100%;
    }
    
    .image-preview-info {
        padding: 16px 20px;
    }
    
    .image-preview-title {
        font-size: 0.9rem !important;
    }
    
    .image-preview-caption {
        font-size: 0.8rem;
    }
    
    .image-preview-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #preview-media-container {
        max-height: 45vh;
        min-height: 250px;
    }
    
    .image-preview-img,
    #preview-image,
    #preview-video {
        max-height: 45vh;
        max-width: 100%;
    }
    
    .image-preview-info {
        padding: 12px 16px;
    }
    
    .image-preview-nav-btn {
        min-width: 80px;
        font-size: 13px;
    }
}

/* Loading animation for preview images */
.image-preview-img[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth zoom effect for images with preview */
.media-image.cursor-pointer:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Add subtle hint that images are clickable */
.media-image.cursor-pointer {
    position: relative;
}

.media-image.cursor-pointer::after {
    content: '🔍';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.media-image.cursor-pointer:hover::after {
    opacity: 1;
}

/* Mobile Responsive Styles for Navigation */
@media (max-width: 640px) {
    /* Reduce spacing between sections on mobile */
    section.mb-8,
    section.mb-12,
    .mb-8,
    .mb-12 {
        margin-bottom: 1rem !important; /* 16px instead of 32px/48px */
    }
    
    /* Page navigation buttons - stack on mobile */
    .page-nav-button {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
        min-height: 44px; /* Touch-friendly */
    }

    /* Breadcrumb - smaller on mobile */
    .breadcrumb {
        padding: 0 !important;
    }
    
    .breadcrumb-container {
        padding: 0.75rem 1rem;
    }

    .breadcrumb-container ol {
        font-size: 0.75rem;
    }

    /* Navigation links in header */
    .nav-link {
        min-height: 44px; /* Touch-friendly */
        display: flex;
        align-items: center;
    }
    
    /* Header logo link - remove padding on mobile */
    #main-header a[href="../index.html"] {
        padding: 0 !important;
    }
    
    /* Reduce card padding on mobile to increase content area */
    /* Main section containers: p-6 md:p-8 -> p-4 on mobile */
    .bg-white.p-6 {
        padding: 1rem !important; /* 16px instead of 24px */
    }
    
    /* Strategy cards: p-4 -> p-3 on mobile */
    .p-4.bg-white,
    .p-4.bg-blue-50,
    .p-4.bg-amber-50,
    .p-4.bg-red-50,
    .p-4.bg-purple-50,
    .p-4.bg-green-50,
    .p-4.bg-gray-50,
    .p-4.bg-teal-50,
    .p-4.bg-yellow-50,
    .p-4.bg-orange-50,
    .p-4.bg-pink-50,
    .p-4.bg-indigo-50,
    .p-4.bg-rose-50 {
        padding: 0.75rem !important; /* 12px instead of 16px */
    }
    
    /* Tactic items: p-3 -> p-2 on mobile */
    .p-3.bg-blue-50,
    .p-3.bg-amber-50,
    .p-3.bg-red-50,
    .p-3.bg-purple-50,
    .p-3.bg-green-50,
    .p-3.bg-gray-50,
    .p-3.bg-teal-50,
    .p-3.bg-yellow-50,
    .p-3.bg-orange-50,
    .p-3.bg-pink-50,
    .p-3.bg-indigo-50,
    .p-3.bg-rose-50,
    .p-3.bg-white {
        padding: 0.5rem !important; /* 8px instead of 12px */
    }
}

@media (max-width: 768px) {
    /* Adjust page navigation spacing */
    .page-nav-button {
        flex: 1;
        justify-content: center;
    }
}