/**
 * Advanced Search and Sticky Button Styles
 * Responsive design for all devices
 * Accessibility-focused styling
 */

/* ==================== ADVANCED SEARCH STYLES ==================== */

/* Search Recommendations Panel */
.search-recommendations {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: rgba(20, 20, 20, 0.98);
    border-bottom: 2px solid var(--header-bg-color);
    border-top: 1px solid rgba(7, 100, 250, 0.3);
    z-index: 996;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease;
}

.search-recommendations.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Info Bar */
.search-info-bar {
    padding: 1rem 1.5rem;
    background: rgba(7, 100, 250, 0.1);
    border-bottom: 1px solid rgba(7, 100, 250, 0.2);
    color: #a0d5ff;
    font-size: 0.9rem;
    font-family: 'Inter', Arial, sans-serif;
    transition: all 0.3s ease;
}

.search-info-bar.error {
    background: rgba(255, 71, 87, 0.1);
    color: #ff8787;
    border-bottom-color: rgba(255, 71, 87, 0.2);
}

.search-info-bar.info {
    background: rgba(7, 100, 250, 0.1);
    color: #a0d5ff;
}

/* Search Results Container */
.search-results-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* Recommendation Item */
.search-recommendation-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-recommendation-item:hover,
.search-recommendation-item:focus {
    background: rgba(7, 100, 250, 0.2);
    border-color: var(--header-bg-color);
    box-shadow: 0 4px 12px rgba(7, 100, 250, 0.2);
    transform: translateX(4px);
    outline: none;
}

.search-recommendation-item:active {
    transform: translateX(2px);
}

/* Recommendation Header */
.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.rec-page {
    font-weight: 600;
    color: var(--header-bg-color);
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    background: rgba(7, 100, 250, 0.15);
    border-radius: 4px;
}

.rec-section {
    color: #a0d5ff;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Recommendation Content */
.rec-content {
    color: #d0d0d0;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.search-term-highlight {
    background: rgba(255, 235, 59, 0.3);
    color: #ffeb3b;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Recommendation Meta */
.rec-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
    gap: 1rem;
    flex-wrap: wrap;
}

.rec-match-type {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 111, 0, 0.1);
    border-radius: 3px;
    color: #ff9100;
}

.rec-relevance {
    color: #666;
}

/* Page Highlight */
.search-page-highlight {
    animation: highlightFlash 2s ease;
    background: rgba(255, 235, 59, 0.2) !important;
    border-left: 3px solid #ffeb3b;
    padding-left: 8px;
}

@keyframes highlightFlash {
    0% {
        background: rgba(255, 235, 59, 0.4);
    }
    100% {
        background: transparent;
    }
}

/* ==================== STICKY PHONE BUTTON ==================== */

.sticky-phone-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #00C853, #00AA47);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 990;
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.5), 0 0 30px rgba(0, 200, 83, 0.3), inset 0 -2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    animation: phoneSlideIn 0.5s ease;
}

@keyframes phoneSlideIn {
    from {
        opacity: 0;
        transform: translateX(-40px) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sticky-phone-button:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(0, 200, 83, 0.7), 0 0 40px rgba(0, 200, 83, 0.4), inset 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.sticky-phone-button:active {
    transform: scale(1.08);
}

.sticky-phone-button.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-120px);
}

.phone-icon {
    width: 28px;
    height: 28px;
    stroke-width: 1;
    animation: phonePulse 2s ease infinite;
}

@keyframes phonePulse {
    0%, 100% {
        filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    }
}

.sticky-phone-button:hover .phone-icon {
    animation: phoneRing 0.6s ease infinite;
}

@keyframes phoneRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(-5deg);
    }
    20% {
        transform: rotate(5deg);
    }
    30% {
        transform: rotate(-5deg);
    }
}

/* ==================== FOOTER SOCIALS CENTERED ==================== */

.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 1rem 0;
}

.footer-socials a,
.footer-socials span {
    width: 100%;
    text-align: center;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .search-recommendations {
        top: 110px;
        max-height: 60vh;
    }

    .search-info-bar {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .search-results-container {
        gap: 0.4rem;
        padding: 0.4rem;
    }

    .search-recommendation-item {
        padding: 0.8rem;
    }

    .rec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .rec-page {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }

    .rec-content {
        font-size: 0.85rem;
    }

    .rec-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .sticky-phone-button {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 64px;
        height: 64px;
    }

    .phone-icon {
        width: 30px;
        height: 30px;
    }
}

/* Mobile - 480px and below */
@media (max-width: 480px) {
    .search-recommendations {
        top: 100px;
        max-height: 55vh;
        left: 0;
        right: 0;
    }

    .search-info-bar {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .search-results-container {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.3rem;
    }

    .search-recommendation-item {
        padding: 0.7rem;
        border-radius: 6px;
    }

    .search-recommendation-item:hover,
    .search-recommendation-item:focus {
        background: rgba(7, 100, 250, 0.15);
        transform: translateX(2px);
    }

    .rec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .rec-page {
        font-size: 0.8rem;
        padding: 0.15rem 0.5rem;
    }

    .rec-section {
        font-size: 0.8rem;
    }

    .rec-content {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .rec-meta {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.7rem;
        gap: 0.2rem;
    }

    .sticky-phone-button {
        bottom: 1rem;
        right: 1rem;
        width: 58px;
        height: 58px;
        box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
    }

    .phone-icon {
        width: 28px;
        height: 28px;
    }

    .sticky-phone-button:hover {
        box-shadow: 0 6px 20px rgba(0, 200, 83, 0.6);
    }
}

/* Extra Small - 320px */
@media (max-width: 320px) {
    .search-recommendations {
        top: 95px;
    }

    .search-info-bar {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }

    .search-recommendation-item {
        padding: 0.6rem;
    }

    .rec-page,
    .rec-section {
        font-size: 0.75rem;
    }

    .rec-content {
        font-size: 0.75rem;
    }

    .sticky-phone-button {
        bottom: 0.8rem;
        right: 0.8rem;
        width: 54px;
        height: 54px;
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus states for keyboard navigation */
.search-recommendation-item:focus {
    outline: 2px solid var(--header-bg-color);
    outline-offset: -1px;
}

.sticky-phone-button:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .search-recommendations,
    .search-recommendation-item,
    .sticky-phone-button,
    .phone-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .search-recommendations {
        border: 2px solid var(--header-bg-color);
    }

    .search-recommendation-item {
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sticky-phone-button {
        border: 2px solid white;
    }
}

/* Dark mode (already implemented but ensure it works) */
@media (prefers-color-scheme: dark) {
    .search-recommendations {
        background: rgba(10, 10, 10, 0.98);
    }

    .search-recommendation-item {
        background: rgba(30, 30, 30, 0.8);
    }
}

/* ==================== HEADER HOME BUTTON ==================== */

.header-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.2rem;
    margin: 0 0.5rem;
}

.header-nav-btn:hover {
    background: rgba(212, 175, 55, 0.9);
    color: #800000;
    transform: scale(1.1);
}

.header-nav-btn:active {
    transform: scale(0.95);
}

.header-nav-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.header-nav-btn.home-btn {
    order: -1;
}

@media (max-width: 768px) {
    .header-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin: 0 0.3rem;
    }
}

@media (max-width: 480px) {
    .header-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        margin: 0 0.2rem;
    }
}
