/* Enhanced UX Styles for Daily Travel Fix */

/* Interactive Header Elements */
.header-interactive-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 196, 160, 0.1);
    transition: all 0.3s ease;
    margin: 0 5px;
}

.header-interactive-btn:hover {
    background: #ffc4a0;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 196, 160, 0.3);
}

.header-interactive-btn i {
    font-size: 18px;
}

/* Counter badges */
.favorites-count, .bucket-list-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    animation: pulse 2s infinite;
}

.favorites-count:empty, .bucket-list-count:empty {
    display: none;
}

/* Tooltips */
.btn-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.btn-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.9);
}

.header-interactive-btn:hover .btn-tooltip {
    opacity: 1;
}

/* Enhanced Search */
.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-dropdown {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.language-btn:hover {
    background: #ffc4a0;
    color: #fff;
    border-color: #ffc4a0;
}

.language-btn .icofont-globe {
    font-size: 16px;
}

.lang-flag-btn {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-btn .icofont-simple-down {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-btn[aria-expanded="true"] .icofont-simple-down {
    transform: rotate(180deg);
}

.current-lang {
    text-transform: uppercase;
    font-weight: 600;
}

.language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-menu li {
    margin: 0;
    padding: 0;
}

.language-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.language-menu a:hover {
    background: #f8f9fa;
    color: #ffc4a0;
}

.language-menu a.active {
    background: #ffc4a0;
    color: #fff;
    font-weight: 600;
}

.lang-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lang-name {
    font-size: 14px;
}

/* Mobile adjustments for language selector */
@media (max-width: 768px) {
    .language-btn .current-lang {
        display: none;
    }
    
    .language-btn {
        padding: 10px 12px;
    }
    
    .search-container {
        gap: 8px;
    }
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-btn:hover {
    background: #ffc4a0;
    color: #fff;
    border-color: #ffc4a0;
}

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

/* Enhanced Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay__header {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-overlay-title {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.mobile-navigation-close-icon {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.mobile-navigation-close-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-overlay__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.search-input-group {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.search-input-group input {
    width: 100%;
    padding: 20px 60px 20px 25px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    outline: none;
}

.search-input-group input:focus {
    box-shadow: 0 10px 40px rgba(255, 196, 160, 0.3);
}

.search-submit-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: #ffc4a0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-submit-btn:hover {
    background: #d4966f;
    transform: translateY(-50%) scale(1.1);
}

.search-suggestions {
    margin-top: 40px;
    text-align: center;
}

.search-suggestions h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.search-tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-tag:hover {
    background: #ffc4a0;
    color: #000;
    transform: translateY(-2px);
}

/* Accessibility */
.visually-hidden {
    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;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffc4a0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus states for accessibility */
.header-interactive-btn:focus,
.search-btn:focus,
.search-tag:focus {
    outline: 2px solid #ffc4a0;
    outline-offset: 2px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-overlay-title {
        font-size: 20px;
    }
    
    .search-input-group input {
        font-size: 16px;
        padding: 15px 50px 15px 20px;
    }
    
    .search-submit-btn {
        width: 40px;
        height: 40px;
    }
    
    .search-tags {
        gap: 8px;
    }
    
    .search-tag {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-tooltip {
        display: none; /* Hide tooltips on mobile to prevent overlap */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .header-interactive-btn {
        border: 2px solid currentColor;
    }
    
    .search-overlay {
        background: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .header-interactive-btn,
    .search-btn,
    .search-tag,
    .search-submit-btn {
        transition: none;
    }
    
    .favorites-count,
    .bucket-list-count {
        animation: none;
    }
}
