/**
 * Tools CSS
 * Path: public_html/css/tools.css
 * Version: 3.9.2
 * 
 * Changelog v3.8.1:
 * - Removed old FAQ styles (now handled by dedicated faq.css)
 *
 * Changelog v3.8.0:
 * - Improved mobile content order using display:contents and order properties
 * - Mobile now shows: header â†’ media â†’ description â†’ FAQs â†’ reviews â†’ follow â†’ similar â†’ banner â†’ feedback
 * - Better UX: core content first, engagement widgets after
 * 
 * Changelog v3.7.0:
 * - Added .tool-logo-container for centering logo and verified badge
 * - Added .verified-badge pill styles (green gradient, shield icon, tooltip)
 * 
 * Changelog v3.6.3:
 * - Increased thumbnail container width (250px â†’ 320px)
 * - Larger badges (9px font) and play icons for readability
 * 
 * Changelog v3.6.2:
 * - Fixed thumbnail aspect ratio: 16:9 instead of stretching vertically
 * 
 * Changelog v3.6.1:
 * - Fixed thumbnail grid: fixed 250px width instead of flex expansion
 * - Thumbnails maintain proper 2-column layout for 3+ items
 * 
 * Changelog v3.6.0:
 * - Two-item layout: side-by-side equal panels with labels
 * - Direct interaction (no swapping) for 2-item galleries
 * - Responsive stacking on mobile for two-item layout
 * 
 * Changelog v3.5.4:
 * - Hide active thumbnail from sidebar (no duplicate display)
 * - Single-item layout: full-width centered main preview
 * 
 * Changelog v3.5.3:
 * - Hide active thumbnail from sidebar (no duplicate display)
 * 
 * Changelog v3.5.2:
 * - Adjusted badge styling for longer translated text (VIDEO, YOUTUBE, IMAGE)
 * 
 * Changelog v3.5.1:
 * - Hide empty thumbnail slots in media gallery
 * 
 * Changelog v3.5.0:
 * - Added unified Media Gallery component styles
 * - 400x225px main preview with 2x3 thumbnail grid
 * - Filter tabs, navigation arrows, type badges (MP4/YT/IMG)
 * - Responsive layout for mobile
 * 
 * Changelog v3.4.7:
 * - Added YouTube facade styles for lazy-loading videos
 * - Play button overlay with hover effects
 * - Smooth transition when video loads
 * 
 * Changelog v3.4.6:
 * - Fixed containers: Both screenshot and video use fixed 240px height
 * - Added .preview-media container for screenshot
 * - Added .preview-caption with fixed 32px height for both (visible text or reserved space)
 * - Both items now perfectly aligned
 * 
 * Changelog v3.4.3:
 * - Fixed pricing badges with !important to override base styles - now inline side by side
 * 
 * Changelog v3.4.1:
 * - Fixed pricing badges to be inline instead of full width
 * - Added placeholder styles for missing screenshot/video
 * 
 * Changelog v3.4.0:
 * - Major layout redesign: 2-column layout (removed right sidebar)
 * - Added preview section styles for screenshot/video at top
 * - Added similar tools card styles with logos and subtitles
 * - Added info section icons
 * - Updated responsive breakpoints for new layout
 * 
 * Changelog v3.3.0:
 * - Added sticky section navigation bar
 * - Desktop: centered horizontal nav that appears on scroll
 * - Mobile: horizontally scrollable compact nav
 * - Scroll spy highlights active section
 */

/* General Styling */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: #333;
    background: #F0F4F8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   STICKY SECTION NAVIGATION BAR
   ============================================ */
.section-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.section-nav.is-visible {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    pointer-events: all;
}

.section-nav-inner {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
}

.section-nav-item:hover {
    background: #f0f4f8;
    color: #333;
}

.section-nav-item.active {
    background: #e8f4fc;
    color: #1d6faa;
}

.section-nav-icon {
    font-size: 16px;
    line-height: 1;
}

/* Mobile: Horizontal scrollable nav */
@media screen and (max-width: 768px) {
    .section-nav-inner {
        justify-content: flex-start;
        gap: 4px;
        padding: 8px 12px;
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
    }
    
    .section-nav-inner::-webkit-scrollbar {
        display: none;
    }
    
    .section-nav-item {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 8px 12px;
        font-size: 11px;
        flex-shrink: 0;
    }

    .section-nav-icon {
        font-size: 18px;
    }

    .section-nav-label {
        font-size: 11px;
    }
    
    .section-nav::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, white);
        pointer-events: none;
    }
}

/* Full-width container styling for tool/category pages */
.ai-tools-full-width {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Container for detailed tool pages */
.ai-tools-full-width .container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    gap: 20px;
}

/* Tool Title Section (used in detailed tool pages) */
.tool-title-section {
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* ============================================
   TWO-COLUMN LAYOUT (NEW)
   ============================================ */
.flex-container.two-column {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

/* Left Column Container */
.left-column {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Main Content - Takes remaining space */
.flex-container.two-column .main-content {
    flex: 1;
    min-width: 0;
}

/* ============================================
   TOOL HEADER BOX
   ============================================ */
.tool-header {
    padding: 24px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.tool-header h1 {
    font-size: 1.6em;
    margin: 0 0 16px 0;
    color: #1a1a2e;
}

/* Logo Container - centers logo and verified badge */
.tool-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 14px;
}

.tool-header .tool-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
    cursor: help;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.verified-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.verified-badge-icon {
    width: 14px;
    height: 14px;
    fill: white;
    flex-shrink: 0;
}

.tool-header .tool-subtitle {
    color: #666;
    font-size: 0.92em;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

/* Website CTA Button */
.website-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.website-cta-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    text-decoration: none;
    color: white;
}

.website-cta-icon {
    font-size: 1.1em;
}

.website-cta-arrow {
    margin-left: auto;
    opacity: 0.8;
}

/* Coupon Button */
.tool-header .show-coupon-btn {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
}

/* ============================================
   INFO SECTIONS (Metadata)
   ============================================ */
.tool-info-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.info-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    transition: background 0.2s;
}

.info-section:hover {
    background: #f1f5f9;
}

.info-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #556477;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-section-icon {
    font-size: 1.4em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-section-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d6faa;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
}

.info-section-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.info-section-empty {
    color: #767676;
    font-size: 0.9em;
}

/* Tags as Chips */
.tags-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85em;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-chip:hover {
    border-color: #3498db;
    color: #1d6faa;
    background: #f0f9ff;
    text-decoration: none;
}

.tag-chip .item-emoji {
    font-size: 1em;
    min-width: auto;
}

/* NSFW tag chip (Issue #151) */
.tag-chip.nsfw-tag {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.tag-chip.nsfw-tag:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* Pricing badges in info section - inline, not full width */
#section-pricing .info-section-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.info-section .sidebar-pricing {
    display: inline-flex;
    margin: 0;
    width: auto;
}

/* Emoji styling */
.item-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    font-size: 1.1em;
}

/* ============================================
   FOLLOW TOOL CTA BOX
   ============================================ */
.follow-tool-cta {
    padding: 24px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.follow-tool-cta h2 {
    color: #1e293b;
    margin: 0 0 8px 0;
    font-size: 1.05em;
    text-align: left;
}

.follow-tool-cta > .cta-content > p {
    color: #64748b;
    font-size: 0.85em;
    text-align: left;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.follow-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.follow-form .form-group {
    position: relative;
}

.follow-form input[type="email"] {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9em;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}

.follow-form input[type="email"]:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-color: #3498db;
}

.follow-form input[type="email"]:user-invalid {
    border-color: #e74c3c;
}

@supports not selector(:user-invalid) {
    .follow-form input[type="email"]:invalid:not(:placeholder-shown) {
        border-color: #e74c3c;
    }
}

.follow-form button {
    padding: 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    min-height: 44px;
}

.follow-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.follow-form button:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.cta-notice {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    text-align: center;
    min-height: 20px;
}

.cta-notice.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cta-notice.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   SIMILAR TOOLS BOX (NEW - Moved from sidebar)
   ============================================ */
.similar-tools-box {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.similar-tools-box h3 {
    font-size: 1.1em;
    margin: 0 0 16px 0;
    color: #1a1a2e;
}

.similar-tools-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.similar-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.similar-tool-card:hover {
    background: #fff;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.similar-tool-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.similar-tool-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 0.85em;
}

.similar-tool-info {
    flex: 1;
    min-width: 0;
}

.similar-tool-name {
    font-weight: 600;
    font-size: 0.95em;
    color: #1e293b;
    margin-bottom: 4px;
}

.similar-tool-card:hover .similar-tool-name {
    color: #1d6faa;
}

.similar-tool-subtitle {
    font-size: 0.8em;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 0;
    padding-top: 0;
    min-width: 0;
}

.content-section,
.faq {
    padding: 28px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-section h2:first-child,
.faq h2:first-child {
    margin-top: 0;
}

/* ============================================
   PREVIEW SECTION (NEW - Screenshot + Video at top)
   ============================================ */
.preview-section {
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.preview-grid {
    display: flex;
    gap: 24px;
}

.preview-grid.has-both .preview-item {
    flex: 1;
}

.preview-grid.single-item {
    justify-content: center;
}

.preview-grid.single-item .preview-item {
    max-width: 600px;
}

.preview-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.preview-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Fixed height media container - same for both */
.preview-media {
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f0f0f;
}

.preview-section .screenshot-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1a1a2e;
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-section .screenshot-preview:hover {
    transform: scale(1.02);
}

/* Caption area - same height reserved for both */
.preview-caption {
    height: 32px;
    margin-top: 10px;
    font-size: 0.85em;
    color: #64748b;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-video {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f0f0f;
}

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

/* YouTube Facade - Lazy Load Pattern */
.yt-facade {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f0f0f;
    cursor: pointer;
}

.yt-facade-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yt-facade:hover .yt-facade-thumb {
    transform: scale(1.05);
}

/* Play button overlay */
.yt-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 14px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.yt-facade-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}

.yt-facade:hover .yt-facade-play {
    background: #f00;
    transform: translate(-50%, -50%) scale(1.1);
}

.yt-facade:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* When video is loaded, show iframe */
.yt-facade-loaded {
    cursor: default;
}

.yt-facade-loaded iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Placeholder styles for missing screenshot/video */
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 10px;
    color: #94a3b8;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.preview-placeholder-icon {
    font-size: 3em;
    margin-bottom: 12px;
    opacity: 0.6;
}

.preview-placeholder-text {
    font-size: 0.9em;
    font-weight: 500;
}

/* Responsive preview grid */
@media screen and (max-width: 768px) {
    .preview-grid {
        flex-direction: column;
    }
    
    .preview-media,
    .preview-video,
    .preview-placeholder,
    .yt-facade {
        height: 200px;
    }
}

/* ============================================
   CUSTOM VIDEO PLAYER (MP4)
   Matches YouTube facade dimensions and behavior
   ============================================ */

/* Custom Video Facade - Lazy Load Pattern */
.custom-video-facade {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f0f0f;
    cursor: pointer;
}

.custom-video-facade-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.custom-video-facade:hover .custom-video-facade-thumb {
    transform: scale(1.05);
}

/* Play button overlay - matches YouTube style */
.custom-video-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 14px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.custom-video-facade-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}

.custom-video-facade:hover .custom-video-facade-play {
    background: #e74c3c; /* Red-orange for custom videos to differentiate from YouTube */
    transform: translate(-50%, -50%) scale(1.1);
}

.custom-video-facade:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Buffering indicator on hover */
.custom-video-facade.is-buffering .custom-video-facade-play::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: bufferingPulse 1.5s infinite;
}

@keyframes bufferingPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* When video is loaded */
.custom-video-facade-loaded {
    cursor: default;
    background: #000;
}

.custom-video-facade-loaded .custom-video-player {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* The actual video element */
.custom-video-player {
    width: 100%;
    height: 240px;
    border-radius: 10px;
    background: #000;
}

/* Poster/thumbnail fallback for videos without custom thumbnail */
.custom-video-poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}

.custom-video-poster-fallback-icon {
    font-size: 4em;
    opacity: 0.6;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .custom-video-facade,
    .custom-video-player {
        height: 200px;
    }
}

/* ============================================
   MEDIA GALLERY (Unified Screenshot/Video)
   ============================================ */
.media-gallery-section {
    padding: 0 !important;
}

.media-gallery {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.media-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.media-gallery-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #556477;
    font-weight: 600;
}

.media-gallery-filters {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 6px;
}

.media-filter-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #556477;
    transition: all 0.15s;
    font-weight: 500;
    font-family: inherit;
}

.media-filter-btn:hover {
    color: #334155;
}

.media-filter-btn.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.media-filter-count {
    font-size: 11px;
    color: #64748b;
    margin-left: 1px;
}

.media-filter-btn.active .media-filter-count {
    color: #64748b;
}

/* Main content area */
.media-gallery-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Main preview - FIXED 400x225px */
.media-main-preview {
    width: 400px;
    min-width: 400px;
    height: 225px;
    background: #0f0f0f;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override facade dimensions in gallery context */
.media-main-preview .custom-video-facade,
.media-main-preview .yt-facade {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.media-main-preview .screenshot-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-main-preview .screenshot-preview:hover {
    transform: scale(1.02);
}

/* Single item layout - centered with subtle frame */
.media-gallery-content.single-item {
    justify-content: center;
}

.media-gallery:has(.media-gallery-content.single-item) .media-gallery-header,
.media-gallery:has(.media-gallery-content.single-item) .media-info-bar {
    justify-content: center;
}

.media-gallery-content.single-item .media-main-preview {
    width: auto;
    max-width: 600px;
    min-width: auto;
    height: auto;
    background: #f5f5f7;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.media-gallery-content.single-item .media-main-preview .screenshot-preview {
    border-radius: 6px;
}

/* Two-item layout - side by side, equal size */
.media-gallery-content.two-items {
    display: flex;
    gap: 16px;
}

.media-dual-panel {
    flex: 1;
    min-width: 0;
}

.media-dual-preview {
    width: 100%;
    height: 225px;
    background: #0f0f0f;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-dual-preview .custom-video-facade,
.media-dual-preview .yt-facade {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.media-dual-preview .screenshot-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-dual-preview .screenshot-preview:hover {
    transform: scale(1.02);
}

.media-dual-label {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* Thumbnail grid */
.media-thumbs-container {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
}

.media-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.media-thumb {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    transition: border-color 0.15s, transform 0.15s;
    background: #1a1a2e;
    aspect-ratio: 16/9;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumb:hover {
    border-color: #94a3b8;
    transform: scale(1.02);
}

.media-thumb.active {
    display: none;
}

/* Empty thumbnail slot - HIDDEN */
.media-thumb.empty {
    display: none;
}

/* Type badges */
.media-thumb-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 3px 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    z-index: 1;
    white-space: nowrap;
}

.badge-mp4 { background: #5a7ab5; color: white; }
.badge-youtube { background: #ff0000; color: white; }
.badge-img { background: #22c55e; color: white; }

/* Play icon on video thumbs */
.media-thumb-play {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.media-thumb-play::after {
    content: '';
    border-left: 6px solid white;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-left: 2px;
}

/* Info bar */
.media-info-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-info-label {
    font-size: 12px;
    color: #64748b;
}

.media-info-label strong {
    color: #334155;
    font-weight: 600;
}

.media-nav-arrows {
    display: flex;
    gap: 4px;
}

.media-nav-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: white;
    color: #64748b;
    font-size: 12px;
    transition: all 0.15s;
    font-family: inherit;
}

.media-nav-btn:hover {
    background: #5a7ab5;
    border-color: #5a7ab5;
    color: white;
}

/* No media placeholder */
.media-placeholder {
    width: 100%;
    height: 225px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.media-placeholder-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.media-placeholder-text {
    font-size: 14px;
}

/* Hidden items when filtering */
.media-thumb.filtered-out {
    display: none;
}

/* Media Gallery Responsive */
@media screen and (max-width: 720px) {
    .media-gallery-content {
        flex-direction: column;
    }

    .media-main-preview {
        width: 100%;
        min-width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .media-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }

    .media-thumbs-container {
        width: 100%;
        min-width: 100%;
    }

    .media-gallery-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* Two-item layout on mobile */
    .media-gallery-content.two-items {
        flex-direction: column;
        gap: 12px;
    }

    .media-dual-preview {
        height: auto;
        aspect-ratio: 16/9;
    }
}

/* ============================================
   VIDEO SECTION (Standalone - if not in preview)
   ============================================ */
.video-section {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-container {
    margin-top: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   FAQ SECTION - Moved to faq.css (v1.0.3+)
   ============================================ */

/* Tool description paragraph spacing */
.content-section p {
    margin-bottom: 1.2em !important;
}

.content-section p:last-child {
    margin-bottom: 0 !important;
}

/* ============================================
   INTERNAL TOOL SECTION
   ============================================ */
.internal-tool-section h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.tool-embed-container {
    background: white;
    border-radius: 6px;
    padding: 20px;
}

/* ============================================
   NEW TOOLS WIDGET CONTAINER
   ============================================ */
.new-tools-widget-container {
    width: 100%;
    margin: 40px 0 0 0;
    box-sizing: border-box;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   SHARED CARD LAYOUT
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.tool-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 15px;
}

.tool-card h2 {
    font-size: 1.5rem;
    margin: 0 0 10px;
}

.tool-card p {
    font-size: 1rem;
    color: #666;
    margin: 0 0 10px;
}

.tool-card img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
}

/* ============================================
   ACCESSIBILITY - HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    .follow-tool-cta,
    .similar-tools-box,
    .tool-header {
        border: 2px solid #000;
    }
    
    .follow-form input[type="email"] {
        border: 2px solid #000;
        background: #fff;
    }
    
    .follow-form button,
    .website-cta-btn {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #000;
    }
    
    .verified-badge {
        background: #000 !important;
        border: 2px solid #fff;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .section-nav {
        transition: none;
    }
    
    .follow-form button,
    .website-cta-btn,
    .similar-tool-card,
    .tag-chip,
    .info-section,
    .tool-card,
    .verified-badge {
        transition: none;
    }
    
    .follow-form button:hover,
    .website-cta-btn:hover,
    .tool-card:hover,
    .verified-badge:hover {
        transform: none;
    }
    
    .preview-section .screenshot-preview:hover {
        transform: none;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media screen and (max-width: 1200px) {
    .ai-tools-full-width .container {
        max-width: 1000px;
    }
    
    .left-column {
        flex: 0 0 300px;
    }
}

/* ============================================
   MOBILE LAYOUT - Reorder content for better UX
   Uses display:contents to unwrap columns and reorder children
   ============================================ */
@media screen and (max-width: 1024px) {
    .flex-container.two-column {
        flex-direction: column;
        align-items: stretch;
    }

    /* Unwrap columns so children become direct flex items */
    .flex-container.two-column .left-column,
    .flex-container.two-column .main-content {
        display: contents;
    }

    /* Mobile content order:
       1. Tool header (logo, name, website, claim CTA)
       2. Media gallery
       3. Description (What is...)
       4. Internal tool (if present)
       5. FAQs
       6. Pros & Cons
       7. Comparisons widget
       8. Reviews widget
       9. Follow CTA
       10. Similar tools
       11. Banner
       12. Feedback widget
    */
    .flex-container.two-column .tool-header { order: 1; width: 100%; }
    .flex-container.two-column #section-media { order: 2; width: 100%; }
    .flex-container.two-column #section-about { order: 3; width: 100%; }
    .flex-container.two-column #section-tool { order: 4; width: 100%; }
    .flex-container.two-column #section-faqs { order: 5; width: 100%; }
    .flex-container.two-column #section-pros-cons { order: 6; width: 100%; }
    .flex-container.two-column .popular-comparisons-widget { order: 7; width: 100%; }
    .flex-container.two-column .reviews-widget { order: 8; width: 100%; }
    .flex-container.two-column .follow-tool-cta { order: 9; width: 100%; }
    .flex-container.two-column .similar-tools-box { order: 10; width: 100%; }
    .flex-container.two-column .banner-zone--sidebar { order: 11; width: 100%; }
    .flex-container.two-column .banner-widget { order: 11; width: 100%; }
    .flex-container.two-column .feedback-widget { order: 12; width: 100%; }
}

@media screen and (max-width: 768px) {
    .ai-tools-full-width {
        padding: 10px;
    }
    
    .ai-tools-full-width .container {
        flex-direction: column;
        gap: 0;
    }

    .flex-container.two-column {
        gap: 20px;
    }

    .tool-header,
    .follow-tool-cta,
    .similar-tools-box,
    .content-section,
    .faq {
        padding: 20px;
        border-radius: 12px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .similar-tool-card {
        padding: 12px;
    }
    
    .similar-tool-logo {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   LEGACY SUPPORT - Old 3-column layout styles
   (Keep for backwards compatibility if needed)
   ============================================ */
.flex-container:not(.two-column) {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

.flex-container:not(.two-column) .sidebar {
    flex: 0 0 350px;
    background: transparent;
    border: none;
    padding: 20px;
    padding-top: 0;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: none;
    margin-top: 0;
}

.sidebar-box {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #ffffff;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

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

.sidebar-box h3 {
    color: black;
    margin-top: 0;
    font-size: 1.3em;
}

.sidebar-box ul {
    list-style: none;
    padding-left: 0;
}

.sidebar-box ul li {
    font-size: 1em;
    margin-bottom: 8px;
    color: #333;
}

.sidebar-box ul li a {
    text-decoration: none;
    color: #1d6faa;
}

.sidebar-box ul li a:hover {
    text-decoration: underline;
}