/* AJAX Search Styles - Modern Gaming Theme */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper.loading input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%236B7280' stroke-width='2'/%3E%3Cpath d='M4 12a8 8 0 0 1 8-8V2.5' stroke='%233B82F6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.search-wrapper.loading input::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%236B7280' stroke-width='2'/%3E%3Cpath d='M4 12a8 8 0 0 1 8-8V2.5' stroke='%233B82F6' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    animation: spin-loader 1s linear infinite;
}

@keyframes spin-loader {
    from {
        transform: translateY(-50%) rotate(0deg);
    }
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 14px;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.suggestion-item mark {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    padding: 0 2px;
    border-radius: 2px;
}

.game-suggestion i {
    color: #3b82f6;
}

.category-suggestion i {
    color: #10b981;
}

/* AJAX Search Results Modal */
.ajax-search-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.ajax-search-results * {
    animation: none !important;
}

.ajax-search-results .ajax-search-modal {
    animation: modalSlideIn 0.3s ease-out !important;
}

/* Specifically disable FontAwesome icon animations and transforms */
.ajax-search-results .fas,
.ajax-search-results .far,
.ajax-search-results .fab,
.ajax-search-results i[class*="fa-"] {
    animation: none !important;
    transform: none !important;
}

.ajax-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.ajax-search-modal {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    margin: 5vh auto;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ajax-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
}

.search-title i {
    color: #3b82f6;
    animation: none !important;
    transform: none !important;
    position: static !important;
    display: inline !important;
}

.close-search {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.close-search:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

.ajax-search-content {
    padding: 24px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

/* Search Stats */
.search-stats {
    margin-bottom: 20px;
    font-size: 14px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.game-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

.game-thumbnail {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.game-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1);
}

.game-info {
    padding: 12px;
}

.game-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-title mark {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    padding: 0 2px;
    border-radius: 2px;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

.category {
    color: #10b981;
    font-weight: 500;
}

.views {
    color: #64748b;
}

/* Search Footer */
.search-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 40px 20px;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-results h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.no-results p {
    color: #94a3b8;
    margin: 0 0 24px 0;
    font-size: 1rem;
}

.popular-categories {
    margin-top: 24px;
}

.popular-categories h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 12px 0;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.category-chip {
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-chip:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px;
    color: #ef4444;
}

.error-message p {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ajax-search-modal {
        width: 95%;
        margin: 2vh auto;
        max-height: 90vh;
        border-radius: 16px;
    }

    .ajax-search-header {
        padding: 16px 20px;
    }

    .search-title {
        font-size: 1.25rem;
    }

    .ajax-search-content {
        padding: 20px;
        max-height: calc(90vh - 100px);
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .game-thumbnail {
        height: 100px;
    }

    .game-info {
        padding: 10px;
    }

    .game-title {
        font-size: 13px;
    }

    .category-chips {
        gap: 6px;
    }

    .category-chip {
        font-size: 11px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .game-thumbnail {
        height: 80px;
    }

    .game-info {
        padding: 8px;
    }

    .game-title {
        font-size: 12px;
    }

    .ajax-search-header {
        padding: 12px 16px;
    }

    .ajax-search-content {
        padding: 16px;
    }
}

/* Smooth scrollbar for search content */
.ajax-search-content::-webkit-scrollbar {
    width: 6px;
}

.ajax-search-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ajax-search-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.ajax-search-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Search suggestions scrollbar */
.search-suggestions::-webkit-scrollbar {
    width: 4px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}
