/* Carria Networks Search Styles */

/* Search Modal Overlay - Keep Original Transparent Design */
.ul-search-form-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ul-search-form-wrapper.active {
    opacity: 1;
    visibility: visible;
}

/* Search Form Container - Transparent Centered Design */
.ul-search-form {
    background: transparent;
    border: none;
    padding: 0;
    width: 90%;
    max-width: 500px;
    position: relative;
}

/* Search Input - Responsive Design */
.ul-search-form-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ul-search-form input[type="search"] {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    width: 100%;
    max-width: 400px;
    min-width: 200px;
    border-radius: 50px 0 0 50px;
    outline: none;
    transition: all 0.3s ease;
    flex: 1;
}

.ul-search-form input[type="search"]:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.ul-search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ul-search-form button[type="submit"] {
    background: rgba(0, 129, 204, 0.8);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -2px;
    flex-shrink: 0;
    min-width: 60px;
}

.ul-search-form button[type="submit"]:hover {
    background: rgba(0, 129, 204, 1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Search Close Button - Transparent Style */
.ul-search-closer {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ul-search-closer:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-results-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 15px;
}

.search-results-header h3 {
    margin: 0 0 5px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.search-results-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Search Result Items */
.search-result-item {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

.search-result-item:hover {
    background: #f8fafc;
    border-color: #0081cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 129, 204, 0.1);
}

.search-result-category {
    font-size: 12px;
    color: #0081cc;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.search-result-title {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.search-result-excerpt {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.search-result-excerpt mark {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.search-no-results h3 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 18px;
}

.search-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Body class when search is active */
body.search-active {
    overflow: hidden;
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .ul-search-form {
        width: 95%;
        max-width: 600px;
    }
    
    .ul-search-form input[type="search"] {
        font-size: 16px;
        padding: 12px 18px;
    }
    
    .ul-search-form button[type="submit"] {
        padding: 12px 18px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .ul-search-form-wrapper {
        padding: 15px;
        padding-top: 70px;
    }
    
    .ul-search-form {
        width: 100%;
        max-width: 500px;
    }
    
    .ul-search-form input[type="search"] {
        font-size: 16px;
        padding: 12px 16px;
        max-width: none;
    }
    
    .ul-search-form button[type="submit"] {
        padding: 12px 16px;
        min-width: 55px;
    }
    
    .search-results {
        max-height: 350px;
    }
    
    .ul-search-closer {
        top: -45px;
        width: 35px;
        height: 35px;
    }
}

/* Small tablets and large phones */
@media (max-width: 640px) {
    .ul-search-form-wrapper {
        padding: 10px;
        padding-top: 60px;
    }
    
    .ul-search-form input[type="search"] {
        font-size: 15px;
        padding: 10px 14px;
    }
    
    .ul-search-form button[type="submit"] {
        padding: 10px 14px;
        min-width: 50px;
    }
    
    .search-results {
        max-height: 300px;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .search-result-title {
        font-size: 15px;
    }
    
    .search-result-excerpt {
        font-size: 13px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .ul-search-form-wrapper {
        padding: 8px;
        padding-top: 50px;
    }
    
    .ul-search-form-right {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .ul-search-form input[type="search"] {
        border-radius: 25px;
        font-size: 14px;
        padding: 10px 15px;
        width: 100%;
        max-width: none;
    }
    
    .ul-search-form button[type="submit"] {
        border-radius: 25px;
        width: 100%;
        min-width: auto;
        margin-left: 0;
        padding: 10px 15px;
        justify-content: center;
    }
    
    .search-results {
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .search-result-title {
        font-size: 14px;
    }
    
    .search-result-excerpt {
        font-size: 12px;
    }
    
    .ul-search-closer {
        top: -40px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .ul-search-form-wrapper {
        padding: 5px;
        padding-top: 45px;
    }
    
    .ul-search-form input[type="search"] {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .ul-search-form button[type="submit"] {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .search-results {
        max-height: 200px;
    }
    
    .search-result-item {
        padding: 8px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    .search-result-excerpt {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .ul-search-closer {
        top: -35px;
        width: 28px;
        height: 28px;
    }
}

/* Search Button in Header */
.ul-header-search-opener {
    background: none;
    border: none;
    color: #1f2937;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ul-header-search-opener:hover {
    background: #f3f4f6;
    color: #0081cc;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .ul-header-search-opener {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    
    .search-result-item {
        min-height: 44px;
        padding: 15px;
    }
    
    .ul-search-closer {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #0081cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 
Landscape orientation on mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    .ul-search-form-wrapper {
        padding-top: 40px;
    }
    
    .search-results {
        max-height: 200px;
    }
    
    .ul-search-closer {
        top: -35px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ul-search-form input[type="search"],
    .ul-search-form button[type="submit"] {
        border-width: 1px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ul-search-form-wrapper,
    .ul-search-form input[type="search"],
    .ul-search-form button[type="submit"],
    .ul-search-closer,
    .search-result-item {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-results {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .search-results-header h3,
    .search-result-title {
        color: #f9fafb;
    }
    
    .search-results-header p,
    .search-result-excerpt {
        color: #d1d5db;
    }
    
    .search-result-item {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .search-result-item:hover {
        background: rgba(55, 65, 81, 0.8);
    }
}

/* Focus improvements for accessibility */
.ul-search-form input[type="search"]:focus,
.ul-search-form button[type="submit"]:focus,
.ul-search-closer:focus {
    outline: 2px solid #0081cc;
    outline-offset: 2px;
}

.search-result-item:focus {
    outline: 2px solid #0081cc;
    outline-offset: -2px;
}

/* Keyboard navigation */
.search-result-item.keyboard-focused {
    background: #f8fafc;
    border-color: #0081cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 129, 204, 0.15);
}