/**
 * Home Page Search Box Styles
 * Modern, engaging search component to encourage user interaction
 */

/* Main search container - compact height */
.home-search-container {
    background: transparent url(../../images/bg_footer.jpg) repeat 0 0;
    border-radius: 16px;
    padding: 32px 24px 24px 24px;
    margin-bottom: 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible;
}

/* Subtle background pattern */
.home-search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Search wrapper with relative positioning for icon */
.home-search-wrapper {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    z-index: 1;
}

/* Search heading */
.home-search-heading {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

/* Search form */
.home-search-form {
    display: flex;
    align-items: center;
    position: relative;
}

/* Search input container for icon and button placement */
.home-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.home-search-input-wrapper:focus-within {
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.25);
    outline: 2px solid rgba(0, 191, 255, 0.4);
    outline-offset: 0px;
}

/* Search icon */
.home-search-icon {
    margin-right: 10px;
    color: #a0aec0;
    font-size: 18px;
    pointer-events: none;
    flex-shrink: 0;
}

/* Modern search input */
.home-search-input {
    flex: 1;
    padding: 14px 14px 14px 110px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #2d3748;
    outline: none;
    box-shadow: none;
}

.home-search-input:focus {
    outline: none;
    box-shadow: none;
}

.home-search-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Modern search button - inside input */
.home-search-btn {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 24px;
    background: #D2443C;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(210, 68, 60, 0.25);
    z-index: 2;
    flex-shrink: 0;
}

.home-search-btn:hover {
    background: #B83A33;
    box-shadow: 0 4px 12px rgba(210, 68, 60, 0.35);
    transform: translateY(-1px);
}

.home-search-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(210, 68, 60, 0.3);
}

/* Popular searches section - compact */
.home-search-popular {
    margin-top: 16px;
    padding-bottom: 4px;
    text-align: center;
    opacity: 0.95;
}

.home-search-popular-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
}

.home-search-popular-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.home-search-popular-link {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-search-popular-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .home-search-container {
        padding: 16px 12px 12px 12px; /* Reduced from 24px 16px 20px */
        border-radius: 8px;
        margin-bottom: 15px; /* Reduced from 25px */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); /* Lighter shadow on mobile */
    }

    .home-search-heading {
        font-size: 16px; /* Reduced from 18px */
        margin-bottom: 10px; /* Reduced from 14px */
    }

    .home-search-input-wrapper {
        min-height: 40px !important; /* Reduced from 42px */
    }

    .home-search-input {
        padding: 8px 10px 8px 85px !important;
        font-size: 14px; /* Reduced from 15px */
    }

    .home-search-icon {
        margin-right: 8px;
        font-size: 15px; /* Reduced from 16px */
    }

    .home-search-btn {
        left: 4px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 7px 10px !important; /* Reduced padding */
        font-size: 12px !important; /* Reduced from 13px */
        border-radius: 60px !important;
        min-height: 30px !important;
        height: auto !important;
        max-width: 70px !important;
    }

    .home-search-popular {
        margin-top: 10px; /* Reduced from 14px */
        padding-bottom: 2px; /* Reduced from 4px */
    }

    .home-search-popular-label {
        display: block;
        margin-bottom: 6px; /* Reduced from 8px */
        margin-left: 0;
        font-size: 12px; /* Added to reduce size */
    }

    .home-search-popular-link {
        font-size: 11px; /* Reduced from 12px */
        padding: 3px 10px; /* Reduced from 4px 12px */
    }
}

@media (max-width: 480px) {
    .home-search-container {
        padding: 12px 10px 10px 10px; /* Reduced significantly */
        margin-bottom: 12px; /* Reduced from 20px */
    }

    .home-search-heading {
        font-size: 14px; /* Reduced from 16px */
        margin-bottom: 8px;
    }

    .home-search-input-wrapper {
        min-height: 36px !important; /* Reduced from 38px */
    }

    .home-search-input {
        padding: 7px 8px 7px 65px !important; /* Reduced padding */
        font-size: 13px; /* Reduced from 14px */
    }

    .home-search-icon {
        margin-right: 5px; /* Reduced from 6px */
        font-size: 12px; /* Reduced from 13px */
    }

    .home-search-btn {
        left: 3px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 5px 7px !important; /* Reduced padding */
        font-size: 10px !important; /* Reduced from 11px */
        max-width: 56px !important; /* Reduced from 60px */
        border-radius: 60px !important;
        min-height: 28px !important;
        height: auto !important;
        line-height: 1.2 !important;
    }

    .home-search-popular {
        margin-top: 8px; /* Reduced */
    }

    .home-search-popular-label {
        font-size: 11px; /* Reduced */
        margin-bottom: 5px;
    }

    .home-search-popular-link {
        font-size: 10px; /* Reduced */
        padding: 2px 8px; /* Reduced */
    }
}

/* Very small screens (iPhone SE and smaller) */
@media (max-width: 390px) {
    .home-search-container {
        padding: 10px 8px 8px 8px; /* Even more compact */
        margin-bottom: 10px;
    }

    .home-search-heading {
        font-size: 13px; /* Reduced from 15px */
        margin-bottom: 6px;
    }

    .home-search-input-wrapper {
        min-height: 34px !important; /* Reduced from 36px */
    }

    .home-search-input {
        padding: 6px 6px 6px 58px !important; /* More compact */
        font-size: 12px; /* Reduced from 13px */
    }

    .home-search-icon {
        margin-right: 4px; /* Reduced from 5px */
        font-size: 11px; /* Reduced from 12px */
    }

    .home-search-btn {
        left: 2px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 4px 5px !important; /* More compact */
        font-size: 9px !important; /* Reduced from 10px */
        max-width: 50px !important; /* Reduced from 55px */
        border-radius: 60px !important;
        min-height: 26px !important;
        height: auto !important;
        line-height: 1.2 !important;
    }

    .home-search-popular {
        margin-top: 6px; /* Reduced */
    }

    .home-search-popular-label {
        font-size: 10px; /* Reduced */
        margin-bottom: 4px;
    }

    .home-search-popular-link {
        font-size: 9px; /* Reduced */
        padding: 2px 6px; /* Reduced */
    }
}

/* Extra small screens (293px and below) - Fix overflow issue */
@media (max-width: 320px) {
    .home-search-container {
        padding: 8px 6px 6px 6px !important;
    }

    .home-search-input {
        padding: 5px 4px 5px 50px !important;
        font-size: 11px !important;
    }

    .home-search-btn {
        left: 2px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 3px 5px !important;
        font-size: 8px !important;
        max-width: 44px !important;
        min-height: 24px !important;
    }
}

/* Focus state with keyboard navigation */
.home-search-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Loading state (optional for future enhancement) */
.home-search-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.home-search-btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility - screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
