/* Search Section */
.search-section {
    padding: 2rem 0;
    background: var(--dark-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(69, 202, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.clear-search {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.clear-search:hover {
    color: var(--text-primary);
}

.shuffle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.shuffle-btn svg {
    transition: transform 0.3s ease;
}

.shuffle-btn:hover svg {
    transform: rotate(180deg);
}

/* Profiles Section */
.profiles-section {
    padding: 3rem 0;
    min-height: 500px;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Profile Card */
.profile-card {
    background: var(--dark-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out both;
}

.profile-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
    box-shadow: 0 12px 40px rgba(69, 202, 255, 0.2);
}

.profile-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(255, 27, 107, 0.1), rgba(69, 202, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image-placeholder {
    font-size: 4rem;
}

.profile-arr-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.arr-badge-bronze {
    background: rgba(205, 127, 50, 0.9);
    color: #ffffff;
}

.arr-badge-silver {
    background: rgba(192, 192, 192, 0.9);
    color: #000000;
}

.arr-badge-gold {
    background: rgba(255, 215, 0, 0.9);
    color: #000000;
}

.arr-badge-platinum {
    background: linear-gradient(135deg, rgba(229, 228, 226, 0.9), rgba(200, 200, 200, 0.9));
    color: #000000;
}

.arr-badge-diamond {
    background: linear-gradient(135deg, rgba(185, 242, 255, 0.9), rgba(120, 200, 255, 0.9));
    color: #000000;
}

.arr-badge-unranked {
    background: rgba(100, 100, 100, 0.9);
    color: #ffffff;
}

.profile-info {
    padding: 1.5rem;
}

.profile-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-team {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.profile-nationality {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.25rem;
}

.profile-bio-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading & No Results */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    color: var(--text-secondary);
}

.no-results {
    text-align: center;
    padding: 4rem 0;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
}

/* Profile Modal */
.profile-modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-modal-body {
    padding: 0;
}

.modal-profile-header {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(255, 27, 107, 0.1), rgba(69, 202, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-profile-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-profile-header-placeholder {
    font-size: 6rem;
}

.modal-profile-details {
    padding: 2rem;
}

.modal-profile-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.modal-meta-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-meta-value.arr-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.modal-profile-backstory {
    margin-bottom: 1.5rem;
}

.modal-backstory-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-backstory-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.modal-backstory-text p {
    margin-bottom: 1rem;
}

.modal-backstory-text p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .search-wrapper {
        flex-direction: column;
    }
    
    .shuffle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .profiles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-profile-name {
        font-size: 1.5rem;
    }
    
    .modal-profile-meta {
        gap: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flag Icons */
.flag-icon {
    width: 20px !important;
    height: 14px !important;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
}

.modal-meta-value .flag-icon,
.profile-nationality .flag-icon {
    width: 20px !important;
    height: 14px !important;
    max-width: 20px;
    max-height: 14px;
}
