/* User Profiles Section */
.user-profiles-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    background-color: var(--background);
}

.apps-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem 6rem;
    background-color: var(--background);
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: var(--card-bg);
    color: var(--text-secondary);
}

.filter-btn:hover {
    background-color: var(--button-secondary-hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* User Profiles Grid */
.user-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.user-profile-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-profile-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 222, 70, 0.15);
    transform: translateY(-2px);
}

.profile-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary-color);
    opacity: 0.9;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.profile-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-item i {
    font-size: 1rem;
    color: var(--icon-color);
}

/* Profile Modal */
.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.profile-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content-wrapper {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-cover {
    height: 128px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, #008844 100%);
}

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

.modal-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--card-bg) 100%);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    position: relative;
    background-color: var(--card-bg);
}

.modal-profile-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-avatar-wrapper {
    position: relative;
    margin-top: -80px;
    z-index: 10;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg);
}

.modal-profile-info {
    flex: 1;
    padding-top: 0.5rem;
}

.modal-profile-name {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-profile-bio {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.modal-stats {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-stat i {
    color: var(--icon-color);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn-primary {
    background-color: var(--primary-color);
    color: #000;
    font-weight: 600;
}

.modal-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 222, 70, 0.3);
}

.modal-btn-secondary {
    background-color: var(--button-secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.modal-btn-secondary:hover {
    background-color: var(--button-secondary-hover-bg);
    transform: translateY(-1px);
}

/* Light Theme Specific Adjustments */
[data-theme="light"] .profile-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-close {
    background-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .modal-close:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .user-profile-card:hover {
    box-shadow: 0 4px 20px rgba(0, 222, 70, 0.2);
}

/* Loading Spinner for User Profiles */
.user-profiles-grid .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    color: var(--primary-color);
}

.user-profiles-grid .text-center {
    grid-column: 1 / -1;
    padding: 3rem 1rem;
}

/* Smooth transitions between theme changes */
.user-profile-card,
.modal-content-wrapper,
.modal-body,
.filter-btn {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                transform 0.3s ease,
                box-shadow 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .user-profiles-section,
    .apps-section {
        padding: 2rem 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .user-profiles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        white-space: nowrap;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-content-wrapper {
        margin: 0 0.5rem;
    }
    
    .profile-stats {
        gap: 1rem;
    }
    
    .modal-stats {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 48px;
        height: 48px;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}
