/**
 * Modern Hero Search Bar
 * Ana sayfa için modern ve güzel arama çubuğu
 */

.hero-search-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 90px auto 20px; /* Increased top margin for better visibility */
    z-index: 100; /* Increased z-index to ensure visibility */
    padding: 0 20px; /* Add padding for mobile */
    overflow: visible; /* Ensure border is fully visible */
    box-sizing: border-box;
    isolation: isolate; /* Create new stacking context */
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(42, 39, 56, 0.95); /* More visible background */
    backdrop-filter: blur(20px);
    border: 2px solid rgba(146, 141, 171, 0.7); /* More visible border - increased opacity */
    border-top: 3px solid rgba(146, 141, 171, 0.9); /* Even more visible top border */
    border-radius: 50px;
    padding: 12px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                0 -2px 8px rgba(146, 141, 171, 0.3); /* Added top shadow for visibility */
    overflow: visible; /* Ensure border is fully visible */
    box-sizing: border-box; /* Include border in width calculation */
    width: 100%;
    z-index: 10; /* Ensure it's above other elements */
}

.search-wrapper:focus-within {
    border-color: rgba(146, 141, 171, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 48px rgba(146, 141, 171, 0.2),
                0 0 0 4px rgba(146, 141, 171, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    font-size: 1.5rem;
    margin-right: 12px;
    color: #928DAB;
    transition: transform 0.3s ease;
}

.search-wrapper:focus-within .search-icon {
    transform: scale(1.1);
    color: #B8B3CA;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 400;
    padding: 8px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.search-input::placeholder {
    color: rgba(184, 179, 202, 0.6);
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.search-btn:active {
    transform: translateY(0);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(31, 28, 44, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(146, 141, 171, 0.3);
    border-radius: 20px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out;
}

.search-results.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Results Tabs */
.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(146, 141, 171, 0.2);
    padding-bottom: 12px;
}

.search-tab {
    background: transparent;
    border: none;
    color: rgba(184, 179, 202, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-tab:hover {
    background: rgba(146, 141, 171, 0.1);
    color: #B8B3CA;
}

.search-tab.active {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Search Results List */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(42, 39, 56, 0.5);
    border: 1px solid rgba(146, 141, 171, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background: rgba(146, 141, 171, 0.15);
    border-color: rgba(146, 141, 171, 0.3);
    transform: translateX(4px);
}

.search-result-item img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(146, 141, 171, 0.2);
}

.search-result-item .result-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: rgba(184, 179, 202, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
}

.search-result-badge.models {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.search-result-badge.users {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.search-result-badge.collections {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Empty State */
.search-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(184, 179, 202, 0.6);
}

.search-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-empty-text {
    font-size: 0.95rem;
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(184, 179, 202, 0.6);
}

.search-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(146, 141, 171, 0.2);
    border-top-color: #928DAB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(42, 39, 56, 0.5);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(146, 141, 171, 0.4);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(146, 141, 171, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-search-container {
        max-width: 100%;
        padding: 0 20px;
        margin-bottom: 30px;
        overflow: visible; /* Ensure border is fully visible */
    }
    
    .search-wrapper {
        padding: 10px 16px;
        border-radius: 30px;
        overflow: visible; /* Ensure border is fully visible */
        width: 100%;
    }
    
    .search-input {
        font-size: 0.9rem;
    }
    
    .search-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
        margin-left: 8px;
    }
    
    .search-icon {
        font-size: 1.25rem;
        margin-right: 8px;
    }
    
    .search-results {
        border-radius: 16px;
        padding: 12px;
        max-height: 400px;
    }
    
    .search-result-item {
        padding: 10px;
    }
    
    .search-result-item img,
    .search-result-item .result-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .search-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .search-input::placeholder {
        font-size: 0.875rem;
    }
}

