/* ===================================================================
   NAVBAR.CSS - Navigation Bar Styles for PromptFinder
   Extracted from base.html <style> tag (Phase 1 CSS Cleanup)
   Corrected extraction - November 15, 2025
   =================================================================== */

/* ========================================
   ACCESSIBILITY - SKIP TO MAIN CONTENT
   ======================================== */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--black);
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    z-index: var(--z-skip-link);
    font-weight: 600;
    transition: top var(--transition-base);
}

.skip-to-main:focus {
    top: 0;
    color: var(--white);
    text-decoration: none;
}

/* ========================================
   BOOTSTRAP CONTAINER OVERRIDE
   ======================================== */
@media (min-width: 1700px) {
    .container {
        max-width: 1600px !important;  /* Override Bootstrap's 1320px default for ultrawide displays */
    }
}

/* ========================================
   PEXELS-INSPIRED NAVIGATION STYLES
   ======================================== */

.pexels-navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    width: 100%;
}

.pexels-nav-container {
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: var(--navbar-height);
    gap: var(--space-6);
    padding: 0 var(--space-4);  /* Add horizontal padding to prevent overflow */
    box-sizing: border-box;  /* Include padding in width calculation */
}

/* === LOGO === */
.pexels-logo {
    text-decoration: none;
    color: var(--black);
    font-family: var(--font-logo);
    font-size: var(--font-size-logo);
    font-weight: 400;
    letter-spacing: var(--letter-spacing-logo);
    flex-shrink: 0;
    margin-right: var(--logo-spacing);  /* Logo spacing */
    transition: opacity var(--transition-base);
}

.pexels-logo:hover {
    opacity: 0.7;
    text-decoration: none;
    color: var(--black);
}

/* === SEARCH BAR WITH DROPDOWN === */
.pexels-search-container {
    flex: 1 1 auto;           /* Allow grow AND shrink */
    min-width: 0;             /* Critical: Allow shrinking below content size */
    position: relative;
}

.pexels-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: var(--radius-standard);  /* 12px standard border-radius */
    overflow: visible;
    border: 1px solid transparent;
    transition: all var(--transition-base);
    width: 100%;  /* Ensure wrapper respects container width */
    max-width: 100%;  /* Prevent overflow beyond container */
}

.pexels-search-wrapper:focus-within {
    background: var(--gray-100);
    border-color: #767676;  /* WCAG 2.1 Level AA compliant - 4.5:1 contrast ratio for text, strong focus indicator */
    box-shadow: unset;
}

.search-type-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    gap: var(--space-2);
    cursor: pointer;
    background: var(--white);  /* White background */
    border-radius: var(--radius-standard);  /* 12px border-radius */
    border: 4px solid var(--gray-100);
    min-width: 110px;
    height: var(--input-height);
    flex-shrink: 0;  /* Prevent shrinking at default size */
    user-select: none;
    transition: background var(--transition-base);
}

.search-type-dropdown:hover {
    background: var(--gray-200);  /* Slightly darker for better visual feedback */
}

.search-type-icon {
    font-size: 18px;
    color: var(--gray-600);
}

.search-type-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
}

.search-type-arrow {
    font-size: 12px;
    color: var(--arrow-color);  /* #cdcdcd */
    margin-left: auto;
}

.pexels-search-input {
    flex: 1;
    min-width: 0;  /* CRITICAL: Allow shrinking below content size */
    border: none;
    background: transparent;
    padding: 0 var(--space-4);
    height: var(--input-height);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}

.pexels-search-input::placeholder {
    color: var(--gray-400);
}

.pexels-search-icon {
    padding: 0 var(--space-4);
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
}

.pexels-search-icon-btn {
    border: none;
    background: transparent;
    padding: 0 var(--space-4);
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
    transition: color var(--transition-base);
    display: flex;
    align-items: center;
    flex-shrink: 0;  /* Prevent button from shrinking */
}

.pexels-search-icon-btn:hover {
    color: var(--gray-600);
}

.pexels-search-icon-btn:focus {
    outline: 2px solid var(--gray-800);
    outline-offset: 2px;
}

/* === NAVIGATION ITEMS === */
.pexels-nav-items {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
}

.pexels-nav-item {
    position: relative;
    padding: var(--space-2) var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 17px;  /* Updated from 15px */
    font-weight: 500;
    border-radius: 50px;  /* Round border-radius */
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    white-space: nowrap;
    background: transparent;
    border: none;
    font-family: var(--font-base);
}

.pexels-nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.pexels-nav-item:focus {
    outline: 2px solid var(--gray-800);
    outline-offset: 2px;
}

/* Active page indicator with animated underline */
.pexels-nav-item[aria-current="page"] {
    position: relative;
}

.pexels-nav-item[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: var(--space-4);
    right: var(--space-4);
    height: 2px;
    background: var(--gray-800);
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

.pexels-nav-item i {
    color: var(--arrow-color);  /* #cdcdcd for dropdown chevrons */
    margin-left: 5px;
}

/* === ICON BUTTONS === */
.pexels-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;  /* Perfect circle shape */
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    background: transparent;
    font-size: 20px;
    position: relative;
}

/* Three dots icon specific size */
.pexels-icon-btn.three-dots {
    font-size: 18px;
}

.pexels-icon-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* === PROFILE CIRCLE === */
.pexels-profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-800);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
}

.pexels-profile-btn:hover {
    transform: scale(1.05);
}

.pexels-profile-btn:active {
    transform: scale(0.95);  /* Touch feedback */
}

/* Focus styles for keyboard navigation (WCAG 2.4.7) */
.pexels-profile-btn:focus {
    outline: 2px solid var(--gray-800);
    outline-offset: 2px;
}

/* Avatar gradient color (only color-5 in use) */
.avatar-color-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

/* === UPLOAD BUTTON === */
.pexels-upload-btn {
    background: var(--black);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.pexels-upload-btn:hover {
    background: var(--gray-900);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* === DROPDOWN MENUS === */

/* Wrapper for button + dropdown positioning */
.pexels-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.pexels-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;  /* Position under the item by default */
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dropdown);
    min-width: 240px;
    padding: var(--space-2) 0;
    /* SEO-friendly visibility (allows crawling) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: var(--z-dropdown);
    /* NO animation on base class - only when .show or .hiding is applied */
}

/* Centered dropdown modifier (opt-in for specific dropdowns like Explore) */
.pexels-dropdown.dropdown-centered {
    left: 50%;
    transform: translateX(-50%);
}

/* Profile dropdown uses fixed positioning (works on both desktop and mobile) */
#profileDropdown {
    position: fixed !important;
    top: var(--navbar-height) !important;  /* Desktop navbar height */
    right: 10%;  /* 10% from right edge aligns well under profile icon */
    left: auto;
    transform: none !important;  /* Prevent any centering from being applied */
    max-height: calc(100vh - var(--navbar-height) - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* RTL (Right-to-Left) language support for desktop profile dropdown */
[dir="rtl"] #profileDropdown {
    right: auto;  /* Reset right positioning */
    left: 10%;  /* Mirror positioning for RTL languages */
}

/* Standard dropdown animations (no horizontal centering) */
@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Centered dropdown animations (with horizontal centering) */
@keyframes dropdownFadeCentered {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes dropdownFadeOutCentered {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

.pexels-dropdown,
.search-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* will-change removed - applied dynamically in JS only when opening */
}

.pexels-dropdown.show,
.search-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: dropdownFade 0.2s ease forwards;
}

/* Centered dropdown show animation */
.pexels-dropdown.dropdown-centered.show {
    animation: dropdownFadeCentered 0.2s ease forwards;
}

.pexels-dropdown.hiding,
.search-dropdown-menu.hiding {
    animation: dropdownFadeOut 0.2s ease forwards;
}

/* Centered dropdown hide animation */
.pexels-dropdown.dropdown-centered.hiding {
    animation: dropdownFadeOutCentered 0.2s ease forwards;
}

/* Respect motion sensitivity preferences (WCAG 2.1 Level AAA) */
@media (prefers-reduced-motion: reduce) {
    .pexels-dropdown,
    .search-dropdown-menu {
        transition: none !important;
        animation: none !important;
    }

    .pexels-dropdown.show,
    .search-dropdown-menu.show {
        animation: none !important;
    }

    .pexels-dropdown.hiding,
    .search-dropdown-menu.hiding {
        animation: none !important;
    }
}

/* Right-aligned dropdowns for profile */
.pexels-dropdown-right {
    left: auto;
    right: 0;
}

.pexels-dropdown-item {
    display: flex;
    align-items: flex-start;
    padding: var(--space-3) var(--space-5);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-base);
    gap: var(--space-3);
    cursor: pointer;
}

.pexels-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    text-decoration: none;
}

/* Focus styles for keyboard navigation (WCAG 2.4.7) */
.pexels-dropdown-item:focus {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.pexels-dropdown-icon {
    font-size: 18px;
    color: var(--gray-700);  /* Primary body text color */
    width: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.pexels-dropdown-content {
    flex: 1;
}

.pexels-dropdown-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);  /* Lighter shade */
    margin-bottom: 2px;
}

.pexels-dropdown-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.4;
}

.pexels-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-2) 0;
}

/* Search type dropdown (special styling) */
.search-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    min-width: 150px;
    margin-top: var(--space-1);
    /* SEO-friendly visibility (allows crawling) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: var(--z-dropdown);
}

.search-dropdown-item {
    display: flex;
    align-items: flex-start;  /* Changed from center for consistency */
    padding: var(--space-3) var(--space-5);  /* Changed from var(--space-4) to match standard dropdowns */
    gap: var(--space-3);
    cursor: pointer;
    transition: background var(--transition-base);
    width: 100%;  /* Button reset: full width */
    border: none;  /* Button reset: no border */
    background: transparent;  /* Button reset: no background */
    text-align: left;  /* Button reset: left align */
    font-family: inherit;  /* Button reset: inherit font */
}

.search-dropdown-item:hover {
    background: var(--gray-50);
}

.search-dropdown-item i {
    font-size: 18px;  /* Changed from 16px to match other dropdown icons */
    color: var(--gray-700);  /* Darker for better contrast */
    width: 20px;  /* Added for consistency */
    flex-shrink: 0;  /* Added to prevent icon squishing */
    margin-top: 2px;  /* Added for visual alignment */
}

.search-dropdown-item span {
    font-size: 15px;  /* Changed from 14px to match dropdown titles */
    color: var(--gray-600);  /* Secondary text color */
    font-weight: 600;  /* Changed from 500 for consistency */
}

/* Selected search dropdown item (secondary accent color for better text contrast) */
.search-dropdown-item[aria-selected="true"] i,
.search-dropdown-item.selected i {
    color: var(--accent-color-for-text-icons);  /* Darker green (#16ba31) - better text contrast than primary bright green */
}

.search-dropdown-item[aria-selected="true"] span,
.search-dropdown-item.selected span {
    color: var(--accent-color-for-text-icons);  /* Darker green (#16ba31) - better text contrast than primary bright green */
}

/* === MOBILE MENU === */
/* Mobile Icon Bar Container */
.pexels-mobile-icons {
    display: none;
    align-items: center;
    gap: 6px;  /* Reduced from var(--space-2) (8px) to minimize visual spacing */
    margin-left: auto;
}

/* Mobile Icon Buttons - WCAG 2.5.5 AAA Compliant (44×44px minimum) */
.pexels-mobile-icon-btn {
    width: 44px;  /* WCAG 2.5.5 AAA - Minimum 44×44px touch target */
    height: 44px;  /* Perfect WCAG AAA compliance for all mobile buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 20px;  /* Standard icon size */
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.pexels-mobile-icon-btn:hover {
    background: var(--gray-100);
}

.pexels-mobile-icon-btn:active {
    transform: scale(0.95);  /* Touch feedback */
    background: var(--gray-200);
}

.pexels-mobile-icon-btn:focus {
    outline: 2px solid var(--gray-800);  /* WCAG 2.4.7 - Focus visible */
    outline-offset: 2px;
}

/* Search and bell icons - Larger font size to reduce visual white space */
.pexels-mobile-icon-btn.mobile-search-btn,
.pexels-mobile-icon-btn.mobile-bell-btn {
    font-size: 22px;  /* Larger icon (vs 20px) reduces visual white space in transparent buttons */
}

/* Mobile Upload Button - Dark background with white icon */
.mobile-upload-btn {
    background: var(--black);
    color: var(--white);
}

.mobile-upload-btn:hover {
    background: var(--gray-900);
    color: var(--white);
}

.mobile-upload-btn:active {
    transform: scale(0.95);  /* Touch feedback */
    background: var(--gray-800);
}

/* 2-Line Hamburger Icon */
.hamburger {
    width: 18px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center center;
}

/* Hamburger → X Animation - Symmetrical X */
.pexels-mobile-toggle.active .hamburger-line:first-child {
    transform: translateY(6px) rotate(45deg);
}

.pexels-mobile-toggle.active .hamburger-line:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

/* Reduced Motion Support (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    .hamburger-line,
    .pexels-mobile-toggle::before {
        transition: none !important;
    }

    /* Simplified X animation without translateY for motion sensitivity */
    .pexels-mobile-toggle.active .hamburger-line:first-child {
        transform: rotate(45deg);
    }

    .pexels-mobile-toggle.active .hamburger-line:last-child {
        transform: rotate(-45deg);
    }
}

/* Circular Background Fade on Active */
.pexels-mobile-toggle::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: -1;
}

.pexels-mobile-toggle.active::before {
    opacity: 1;
    transform: scale(1);
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    /* SEO-friendly visibility */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height-mobile);
    background: var(--white);
    z-index: var(--z-modal);
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.mobile-search-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.mobile-search-overlay .pexels-search-wrapper {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--gray-100);
}

/* Search dropdown on mobile - keep text and arrow */
.mobile-search-overlay .search-type-dropdown {
    min-width: auto;
}

/* Mobile Hamburger Toggle Button */
.pexels-mobile-toggle {
    width: 44px;  /* WCAG 2.5.5 AAA - Minimum 44x44px touch target */
    height: 44px;  /* WCAG 2.5.5 AAA - Square shape for true circle */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--gray-700);
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;  /* Fully rounded circle */
    transition: background var(--transition-base);
    position: relative;
}

/* Default state: white background (hamburger icon) */
.pexels-mobile-toggle:not(.active) {
    background: var(--white);
}

/* Hover only applies when NOT active (not in X state) */
.pexels-mobile-toggle:not(.active):hover {
    background: var(--gray-100);
}

/* Active (pressed) only applies when NOT active (not in X state) */
.pexels-mobile-toggle:not(.active):active {
    transform: scale(0.95);  /* Touch feedback */
    background: var(--gray-200);
}

.pexels-mobile-toggle:focus {
    outline: 2px solid var(--gray-800);  /* WCAG 2.4.7 - Focus visible */
    outline-offset: 2px;
}

/* Active state (X): transparent background */
.pexels-mobile-toggle.active {
    background: transparent;  /* No !important needed - :not(.active) prevents conflicts */
}

/* When active (X), hover maintains transparent background */
.pexels-mobile-toggle.active:hover {
    background: transparent;  /* Explicit override for hover state when active */
}

/* When active (X), pressed state also maintains transparency */
.pexels-mobile-toggle.active:active {
    background: transparent;  /* Prevents :active pseudo-class from adding background */
    transform: scale(0.95);  /* Maintain touch feedback */
}

.pexels-mobile-menu {
    /* Fixed overlay that doesn't push content down */
    position: fixed;
    top: var(--navbar-height-mobile, 60px);
    left: 0;
    right: 0;
    bottom: 0;  /* Full height overlay */
    background: var(--white);
    padding: var(--space-4);
    overflow-y: auto;  /* Allow scrolling if content exceeds viewport */
    -webkit-overflow-scrolling: touch;  /* Smooth scrolling on iOS */
    z-index: 999;  /* Below navbar (z-index: 1000) but above content */
    /* SEO-friendly visibility (allows crawling of mobile navigation) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);  /* Slide from just above (not top of viewport) */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;

    /* Animated border using ::before pseudo-element */
    border-top: none;  /* Remove direct border */
}

/* Animated top border for mobile menu */
.pexels-mobile-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-200);
    opacity: 0;
    transition: opacity 0.5s ease 0s;  /* 0.5s fade-out when closing */
}

.pexels-mobile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);  /* Slide into view */
}

/* Fade in border 0.3s after 0.5s delay */
.pexels-mobile-menu.show::before {
    opacity: 1;
    transition: opacity 0.3s ease 0.5s;  /* 0.5s delay, then 0.3s fade-in */
}

/* Prevent background scrolling when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;  /* No scrolling on body */
    position: fixed;  /* Prevent iOS scroll bounce */
    width: 100%;  /* Maintain width when position: fixed */
}

.pexels-mobile-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
}

.pexels-mobile-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.pexels-mobile-item i {
    font-size: 18px;
    width: 20px;
}

/* === RESPONSIVE === */
/* Tighten spacing before nav items disappear */
@media (max-width: 1200px) {
    .pexels-nav-container {
        gap: var(--space-4);  /* 24px → 16px */
    }

    .pexels-logo {
        margin-right: 15px;  /* 25px → 15px */
    }
}

/* Further compress before mobile toggle */
@media (max-width: 1100px) {
    .pexels-nav-container {
        gap: var(--space-3);  /* 16px → 12px */
        padding: 0 var(--space-4);  /* 24px → 16px */
    }

    .search-type-dropdown {
        min-width: 95px;  /* Reduce from 110px to prevent overflow */
        padding: 0 var(--space-3);  /* 16px → 12px */
        flex-shrink: 1;  /* CRITICAL: Allow shrinking to min-width at smaller viewports */
    }

    .pexels-search-input {
        padding: 0 var(--space-3);  /* 16px → 12px, save 8px */
    }

    .pexels-search-icon-btn {
        padding: 0 var(--space-3);  /* 16px → 12px, save 8px */
    }

    .pexels-nav-item {
        padding: var(--space-2) var(--space-3);  /* Reduce nav button padding */
        font-size: 16px;  /* 17px → 16px */
    }
}

/* Mobile navigation */
@media (max-width: 1024px) {
    .pexels-nav-items {
        display: none;
    }

    .pexels-mobile-icons {
        display: flex;  /* Show mobile icon bar */
    }

    .pexels-search-container {
        display: none;  /* Hide desktop search */
    }

    .pexels-nav-container {
        gap: var(--space-3);  /* Tighter spacing */
    }

    /* Profile dropdown positioning on mobile */
    .pexels-mobile-icons .pexels-profile-btn {
        position: relative;
    }

    /* Profile dropdown: Override top position for mobile navbar height */
    #profileDropdown {
        top: var(--navbar-height-mobile) !important;  /* Mobile navbar height */
        right: 10% !important;  /* Not too far to the right edge on mobile */
        max-height: calc(100vh - var(--navbar-height-mobile) - 20px);  /* Prevent overflow on landscape */
    }

    /* RTL (Right-to-Left) language support for profile dropdown */
    [dir="rtl"] #profileDropdown {
        right: auto !important;  /* Reset right positioning */
        left: 10% !important;  /* Mirror positioning for RTL languages (Arabic, Hebrew) */
    }

    /* Touch-friendly dropdown spacing on mobile */
    .pexels-dropdown {
        min-width: 220px;
    }

    .pexels-dropdown-item {
        padding: var(--space-4) var(--space-5);
        min-height: 48px;  /* WCAG 2.5.5 - Target size minimum */
    }
}

@media (max-width: 768px) {
    .pexels-nav-container {
        padding: 0 var(--space-4);
        height: var(--navbar-height-mobile);
    }

    .pexels-logo {
        font-size: 24px;
    }

    .search-type-dropdown {
        min-width: 85px;  /* Further reduce at mobile sizes */
        padding: 0 var(--space-2);  /* 12px → 8px */
        flex-shrink: 1;  /* Ensure shrinking allowed at mobile sizes */
    }

    .search-type-text {
        font-size: 14px;
    }

    .pexels-search-input {
        padding: 0 var(--space-2);  /* Further reduce padding */
    }

    .pexels-search-icon-btn {
        padding: 0 var(--space-2);  /* Further reduce padding */
    }
}

@media (max-width: 576px) {
    .pexels-search-container {
        display: none;
    }

    .pexels-mobile-menu .pexels-search-container {
        display: block;
        max-width: none;
        margin-bottom: var(--space-4);
    }
}

/* Screens below 400px - Adjust mobile icon spacing with flexbox */
@media (max-width: 400px) {
    .pexels-mobile-icons {
        gap: 4px;  /* Tighter spacing for very small screens */
    }

    /* Ensure all buttons maintain WCAG 2.5.5 AAA compliance (44×44px) */
    .pexels-mobile-icon-btn,
    .pexels-profile-btn,
    .pexels-mobile-toggle {
        min-width: 44px;  /* Maintain tap target size */
        min-height: 44px;
    }

    /* Slightly smaller icons on very small screens (but buttons stay 44×44px) */
    .pexels-mobile-icon-btn {
        font-size: 20px;  /* Slightly smaller icons (maintains 44×44px button) */
    }

    /* Profile dropdown positioning - prevent overflow on very small screens (e.g., iPhone SE 375px) */
    #profileDropdown {
        right: 5% !important;  /* Reduced from 10% to prevent overflow (e.g., 375px × 5% = 18.75px vs 10% = 37.5px) */
    }

    /* RTL (Right-to-Left) language support */
    [dir="rtl"] #profileDropdown {
        right: auto !important;
        left: 5% !important;  /* Mirror positioning for RTL languages */
    }
}

/* Profile link styles - Phase F UX Fix */
a.profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a.profile-link:hover {
    color: var(--link-color);
    text-decoration: underline;
}

/* For usernames in cards */
.prompt-card a.profile-link {
    font-weight: 500;
}

/* For comment authors */
.comment-author a {
    color: var(--text-dark);
    font-weight: 600;
}

.comment-author a:hover {
    color: var(--link-color);
}

/* Ensure links in muted text stay visible */
.text-muted a {
    color: var(--text-muted);
}

.text-muted a:hover {
    color: var(--link-color);
}

/* Profile links in card overlays */
.card-overlay a.profile-link {
    color: white;
    font-weight: 500;
}

.card-overlay a.profile-link:hover {
    color: #e0e0e0;
    text-decoration: none;
    opacity: 0.9;
}

footer { color: var(--gray-600)}
footer .footer-header {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

footer .footer-header.logo {
    color: var(--black);
    text-decoration: none;
    display: inline-block;
}

footer .logo-text {
    width: 100%;
    margin-bottom: 15px;
    font-size: 1.8em;
    color: var(--black);
}
