/* ================================
   File: /public_html/css/header/search.css
   Version: 2.3.0
   Last Updated: 2025-01-12
   
   SEARCH BAR STYLES
   Desktop header search and mobile YouTube-style search overlay
   
   v2.2.0 - Removed mic button, removed focus outline on search icon
   v2.1.1 - Fixed overlay showing by default on mobile
   v2.1.0 - Removed slide animation, added microphone button styles
   v2.0.0 - Added YouTube-style mobile search (header replacement pattern)
   ================================ */

/* ====================================================================
   DESKTOP SEARCH BAR (in header)
   ==================================================================== */

.header-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-search-form {
    display: flex;
    align-items: center;
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 2px;
    transition: all 0.3s ease;
    min-width: 160px;
    max-width: 200px;
}

.header-search-form:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.header-search-input {
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    color: #2c3e50;
    min-width: 0;
}

.header-search-input::placeholder {
    color: #888;
    font-size: 13px;
}

.header-search-button {
    background: #007bff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.header-search-button:hover {
    background: #0056b3;
}

.header-search-button svg {
    width: 16px;
    height: 16px;
}

/* Show/Hide Controls */
.desktop-only {
    display: flex;
}

/* ====================================================================
   MOBILE SEARCH ICON (in header, next to hamburger)
   ==================================================================== */

.mobile-search-icon {
    display: none; /* Hidden on desktop, shown via responsive.css */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-icon:hover {
    background: #0056b3;
}

.mobile-search-icon svg {
    width: 20px;
    height: 20px;
}

/* ====================================================================
   MOBILE SEARCH OVERLAY (YouTube-style header replacement)
   ==================================================================== */

.mobile-search-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001; /* Above header */
    background: #fff;
}

/* Active state - just show */
.mobile-search-overlay.active {
    display: block;
}

/* The search header container */
.mobile-search-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    min-height: 56px;
    border-bottom: 1px solid #e0e0e0;
}

/* Back button */
.mobile-search-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #374151;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-back:hover,
.mobile-search-back:focus {
    background: #f3f4f6;
}

.mobile-search-back:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.mobile-search-back svg {
    width: 24px;
    height: 24px;
}

/* Search form in overlay */
.mobile-search-form {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Search input in overlay */
.mobile-search-overlay .mobile-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    color: #2c3e50;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mobile-search-overlay .mobile-search-input:focus {
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.mobile-search-overlay .mobile-search-input::placeholder {
    color: #9ca3af;
}

/* Search submit button in overlay */
.mobile-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-submit:hover,
.mobile-search-submit:focus {
    background: #0056b3;
}

.mobile-search-submit:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.mobile-search-submit svg {
    width: 20px;
    height: 20px;
}

/* ====================================================================
   HEADER SEARCH MODE STATE
   When search overlay is active, hide normal header content on mobile
   ==================================================================== */

/* Hide header content when in search mode (mobile only) */
@media (max-width: 768px) {
    header.search-mode .container {
        visibility: hidden;
    }
    
    /* Enable the mobile search overlay on mobile (still needs .active to show) */
    .mobile-search-overlay {
        display: none; /* Hidden by default */
    }
    
    .mobile-search-overlay.active {
        display: block; /* Show only when active */
    }
}

/* ====================================================================
   LEGACY: OLD MOBILE SEARCH BAR (keeping for backward compatibility)
   This was the sticky bar under the header - now deprecated
   ==================================================================== */

.mobile-search-bar {
    display: none; /* Completely hidden - replaced by overlay */
}