/* Enhanced Global Search Results UI - Modern Red Branded Design - Compact & Centered */

/* Search Results Container - Pure White & Red - No Dark Colors */
.global-search-result-inner {
    background: #ffffff !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 
        0 12px 40px rgba(220, 38, 38, 0.15),
        0 4px 16px rgba(220, 38, 38, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    padding: 16px !important;
    border-radius: 20px !important;
    border: 2px solid rgba(220, 38, 38, 0.25) !important;
    max-height: 500px !important;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 38, 38, 0.5) rgba(254, 242, 242, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.global-search-result-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 50%, #dc2626 100%);
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

.global-search-result-inner::-webkit-scrollbar {
    width: 8px;
}

.global-search-result-inner::-webkit-scrollbar-track {
    background: rgba(254, 242, 242, 0.6);
    border-radius: 10px;
    margin: 8px 0;
}

.global-search-result-inner::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.5) 0%, rgba(185, 28, 28, 0.7) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

.global-search-result-inner::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.7) 0%, rgba(185, 28, 28, 0.9) 100%);
}

/* Search Result Item - Fixed Size & White & Red Styling */
.global-search-result-inner-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #ffffff;
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(220, 38, 38, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 70px;
    max-height: 70px;
    margin: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.global-search-result-inner-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.08), transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.global-search-result-inner-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(239, 68, 68, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-search-result-inner-item:hover::before {
    left: 100%;
}

.global-search-result-inner-item:hover::after {
    opacity: 1;
}

.global-search-result-inner-item:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-color: rgba(220, 38, 38, 0.4);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 8px 24px rgba(220, 38, 38, 0.2),
        0 4px 12px rgba(220, 38, 38, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.global-search-result-inner-item:active {
    transform: translateY(0) scale(1);
    box-shadow: 
        0 4px 16px rgba(220, 38, 38, 0.15),
        0 2px 8px rgba(220, 38, 38, 0.1);
}

.global-search-result-inner-item:not(:last-child) {
    border-bottom: none !important;
    padding-bottom: 10px !important;
    margin-bottom: 0 !important;
}

/* Profile Image Thumbnail - Fixed Size */
.global-search-result-inner-item-thumb {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 4px 12px rgba(220, 38, 38, 0.2),
        0 2px 6px rgba(220, 38, 38, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(220, 38, 38, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(254, 242, 242, 0.1) 100%);
    z-index: 1;
    box-sizing: border-box;
}

.global-search-result-inner-item:hover .global-search-result-inner-item-thumb {
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(220, 38, 38, 0.3),
        0 3px 10px rgba(220, 38, 38, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(220, 38, 38, 0.4);
}

.global-search-result-inner-item-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.global-search-result-inner-item:hover .global-search-result-inner-item-thumb::before {
    opacity: 1;
}

.global-search-result-inner-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(254, 242, 242, 0.1) 100%);
}

/* Fallback for broken images */
.global-search-result-inner-item-thumb img[src=""],
.global-search-result-inner-item-thumb img:not([src]) {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(254, 242, 242, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search-result-inner-item-thumb img::after {
    content: '👤';
    font-size: 24px;
    display: none;
}

.global-search-result-inner-item-thumb img[src=""].error::after,
.global-search-result-inner-item-thumb img:not([src]).error::after {
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search-result-inner-item:hover .global-search-result-inner-item-thumb img {
    transform: scale(1.1);
}

/* Content Area - Left Aligned for Consistency */
.global-search-result-inner-item-contents {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 6px;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

/* Title - Fixed Size & Left Aligned - White & Red */
.global-search-result-inner-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #dc2626 !important;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
    text-align: left;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.global-search-result-inner-item:hover .global-search-result-inner-title {
    color: #b91c1c !important;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* Price/Role Badge - Fixed Size & Left Aligned */
.global-search-result-inner-price {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #dc2626 100%);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 3px 8px rgba(220, 38, 38, 0.25),
        0 1px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: relative;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.global-search-result-inner-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.global-search-result-inner-item:hover .global-search-result-inner-price {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #b91c1c 100%);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
    box-shadow: 
        0 4px 12px rgba(220, 38, 38, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.global-search-result-inner-item:hover .global-search-result-inner-price::before {
    left: 100%;
}

/* Contents Wrapper - Left Aligned */
.global-search-result-inner-contents {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.global-search-result-inner-contents.mt-1 {
    margin-top: 6px !important;
}

/* Fixed Content - Red */
.global-search-result-inner-fixed {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #dc2626;
    margin-top: 4px;
    text-align: left;
}

/* Empty State - White & Red */
.global-search-result-inner:empty::before {
    content: '🔍 No results found';
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(254, 242, 242, 0.9) 100%);
    border-radius: 14px;
    border: 2px dashed rgba(220, 38, 38, 0.3);
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* Loading State */
.global-search-result-inner.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.global-search-result-inner.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(220, 38, 38, 0.2);
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

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

/* Animation for new items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.global-search-result-inner-item {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

.global-search-result-inner-item:nth-child(1) { animation-delay: 0.03s; }
.global-search-result-inner-item:nth-child(2) { animation-delay: 0.06s; }
.global-search-result-inner-item:nth-child(3) { animation-delay: 0.09s; }
.global-search-result-inner-item:nth-child(4) { animation-delay: 0.12s; }
.global-search-result-inner-item:nth-child(5) { animation-delay: 0.15s; }
.global-search-result-inner-item:nth-child(6) { animation-delay: 0.18s; }
.global-search-result-inner-item:nth-child(7) { animation-delay: 0.21s; }
.global-search-result-inner-item:nth-child(8) { animation-delay: 0.24s; }
.global-search-result-inner-item:nth-child(9) { animation-delay: 0.27s; }
.global-search-result-inner-item:nth-child(10) { animation-delay: 0.3s; }
.global-search-result-inner-item:nth-child(11) { animation-delay: 0.33s; }
.global-search-result-inner-item:nth-child(12) { animation-delay: 0.36s; }

/* Focus State for Accessibility */
.global-search-result-inner-item:focus {
    outline: 2px solid rgba(220, 38, 38, 0.4);
    outline-offset: 2px;
}

.global-search-result-inner-item:focus-visible {
    outline: 2px solid rgba(220, 38, 38, 0.5);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .global-search-result-inner {
        padding: 12px !important;
        border-radius: 16px !important;
        max-height: 400px !important;
        gap: 6px;
    }

    .global-search-result-inner-item {
        padding: 8px 12px;
        gap: 10px;
        border-radius: 12px;
        max-width: 280px;
    }

    .global-search-result-inner-item-thumb {
        max-width: 45px !important;
        min-width: 45px;
        height: 45px;
        border-radius: 10px;
    }

    .global-search-result-inner-title {
        font-size: 13px !important;
    }

    .global-search-result-inner-price {
        font-size: 9px !important;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .global-search-result-inner {
        padding: 10px !important;
        border-radius: 14px !important;
        gap: 5px;
    }

    .global-search-result-inner-item {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 12px;
        max-width: 260px;
    }

    .global-search-result-inner-item-thumb {
        max-width: 40px !important;
        min-width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .global-search-result-inner-title {
        font-size: 12px !important;
    }

    .global-search-result-inner-price {
        font-size: 8px !important;
        padding: 3px 7px;
    }
}

/* Always White & Red - No Dark Mode */
.global-search-result-inner {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 50%, #ffffff 100%) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
}

.global-search-result-inner::before {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 50%, #dc2626 100%) !important;
}

.global-search-result-inner-item {
    background: #ffffff !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
}

.global-search-result-inner-item:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%) !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
}

.global-search-result-inner-title {
    color: #dc2626 !important;
}

.global-search-result-inner-item:hover .global-search-result-inner-title {
    color: #b91c1c !important;
}

.global-search-result-inner-price {
    color: #ffffff !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #dc2626 100%) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.global-search-result-inner-item:hover .global-search-result-inner-price {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #b91c1c 100%) !important;
}
