/* Search Bar Refinement - Add subtle border for better definition */

/* Header search container - add border and refine appearance */
.header:not(.hidden) .search-container {
    border: 1px solid var(--border) !important;
    border-radius: 4px !important; /* Minimal radius to match design system */
    background-color: rgba(255, 255, 255, 0.02) !important; /* Very subtle background */
    transition: all 0.2s ease !important;
}

/* Remove the bottom border since we now have full border */
.header:not(.hidden) .search-container {
    border-bottom: 1px solid var(--border) !important;
}

/* Hover state - slightly brighter border */
.header:not(.hidden) .search-container:hover {
    border-color: var(--border-light) !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Focus state - more prominent but still subtle */
.header:not(.hidden) .search-container:focus-within {
    border-color: var(--text-tertiary) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Remove conflicting underline styles from search input group */
.header:not(.hidden) .search-input-group::before,
.header:not(.hidden) .search-input-group::after {
    display: none !important; /* Remove the rainbow and baseline effects in header */
}

/* Ensure search input has proper padding and no conflicting styles */
.header:not(.hidden) .search-input {
    background-color: transparent !important;
    border: none !important;
    padding: 8px 12px !important;
}

/* Search button styling - in the middle of the search bar */
.header:not(.hidden) .search-button {
    border: none !important;
    border-left: 1px solid var(--border) !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 0 !important; /* No rounded corners - flat integration */
    transition: all 0.2s ease !important;
}

.header:not(.hidden) .search-button:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-left-color: var(--border-light) !important;
}

/* Last button in search container gets right rounded corners */
.header:not(.hidden) .search-input-group > *:last-child {
    border-radius: 0 3px 3px 0 !important;
}

/* Import button in header - integrated into search bar */
.header:not(.hidden) .import-button-header {
    border: none !important;
    border-left: 1px solid var(--border) !important;
    border-radius: 0 !important; /* No rounded corners - flat integration */
    background-color: transparent !important;
    transition: all 0.2s ease !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

.header:not(.hidden) .import-button-header:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-left-color: var(--border-light) !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header:not(.hidden) .search-container {
        border-radius: 4px !important;
    }
    
    .header:not(.hidden) .search-input {
        padding: 6px 8px !important;
        font-size: 14px !important;
    }
    
    .header:not(.hidden) .search-button {
        padding: 0 10px !important;
    }
}

/* Portrait mode adjustments */
@media (orientation: portrait) and (max-width: 1024px) {
    .header:not(.hidden) .search-container {
        border-radius: 4px !important;
    }
}

/* Contracted header search bar - also needs border */
.header-contracted .search-container {
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.header-contracted .search-container:hover {
    border-color: var(--border-light) !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.header-contracted .search-container:focus-within {
    border-color: var(--text-tertiary) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Ensure the contracted header search elements align properly */
.header-contracted .search-input-group {
    border-radius: 4px !important;
    overflow: hidden !important;
}

.header-contracted .search-button {
    border: none !important;
    border-left: 1px solid var(--border) !important;
    border-radius: 0 !important;
}

.header-contracted .import-button-header {
    border: none !important;
    border-left: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

/* Last button in contracted header search gets rounded right corners */
.header-contracted .search-input-group > *:last-child {
    border-radius: 0 3px 3px 0 !important;
}

/* Landing page search should keep its original style */
.landing-search-container {
    border: none !important;
    border-bottom: 2px solid var(--border) !important; /* Keep the underline style */
    border-radius: 0 !important;
    background-color: transparent !important;
}

/* Ensure landing page keeps its rainbow effects */
.landing-page .search-input-group::before,
.landing-page .search-input-group::after {
    display: block !important; /* Keep the effects on landing page */
}