/* Estilos para el sistema social y perfil */

.profile-container {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ===================================
   HEADER DE PERFIL
   =================================== */

.profile-header {
    padding: 2rem 1.5rem;
}

.profile-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    position: relative;
    margin-right: 1.5rem;
}

.avatar-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(102, 126, 234, 0.3);
}

.level-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.profile-username {
    font-size: 1rem;
    opacity: 0.7;
    margin-bottom: 0.75rem;
}

.profile-stats-quick {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.stat-item {
    color: rgba(255, 255, 255, 0.8);
}

.stat-divider {
    opacity: 0.5;
}

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

/* ===================================
   PESTAÑAS DE NAVEGACIÓN
   =================================== */

.profile-tabs {
    padding: 1rem;
}

.tabs-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.tab-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.tab-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.tab-text {
    font-size: 0.75rem;
    font-weight: 500;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* ===================================
   ESTADÍSTICAS DETALLADAS
   =================================== */

.detailed-stats {
    padding: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   SOLICITUDES DE AMISTAD
   =================================== */

.friend-requests {
    padding: 1.5rem;
}

.requests-count {
    color: #667eea;
    font-weight: 600;
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.request-user {
    display: flex;
    align-items: center;
    flex: 1;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.user-username {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.request-time {
    font-size: 0.75rem;
    opacity: 0.6;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* ===================================
   LISTA DE AMIGOS
   =================================== */

.friends-list {
    padding: 1.5rem;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.friend-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.friend-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.friend-username {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.friend-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.friend-level {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.friend-points {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.friend-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
}

/* ===================================
   ESTADO VACÍO
   =================================== */

.friends-empty,
.empty-ranking,
.search-placeholder,
.settings-placeholder {
    padding: 3rem 2rem;
}

.empty-icon,
.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-title,
.placeholder-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.empty-description,
.placeholder-description {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* ===================================
   RANKINGS
   =================================== */

.ranking-selector {
    padding: 1rem;
}

.selector-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.selector-btn {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    color: rgba(255, 255, 255, 0.9);
}

.selector-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ranking-item.current-user {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.ranking-position {
    position: relative;
    min-width: 60px;
    text-align: center;
    margin-right: 1rem;
}

.position-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
}

.medal-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
}

.ranking-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.ranking-username {
    font-size: 0.875rem;
    opacity: 0.7;
}

.ranking-stats {
    text-align: right;
}

.ranking-points {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.ranking-level,
.ranking-completed {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===================================
   POSICIÓN DEL USUARIO
   =================================== */

.user-ranking {
    padding: 1.5rem;
}

.position-display {
    text-align: center;
    padding: 2rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.position-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
    display: block;
}

.position-text {
    font-size: 1rem;
    opacity: 0.8;
}

/* ===================================
   ACTIVIDAD RECIENTE
   =================================== */

.recent-activity,
.friend-activity {
    padding: 1.5rem;
}

.activity-placeholder {
    text-align: center;
    padding: 2rem;
    opacity: 0.6;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-user {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.activity-description {
    font-size: 0.875rem;
    opacity: 0.8;
}

.activity-time {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .profile-container {
        padding: 0.5rem;
    }
    
    .tabs-nav {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.25rem;
    }
    
    .tab-text {
        font-size: 0.625rem;
    }
    
    .profile-info {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .friends-grid {
        grid-template-columns: 1fr;
    }
    
    .friend-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .friend-avatar {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .friend-actions {
        flex-direction: row;
        margin-left: 0;
    }
    
    .request-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .request-user {
        flex-direction: column;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .ranking-item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .ranking-position {
        margin-right: 0;
    }
    
    .ranking-stats {
        text-align: left;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-name {
        font-size: 1.5rem;
    }
    
    .avatar-image {
        width: 60px;
        height: 60px;
    }
    
    .level-badge {
        width: 25px;
        height: 25px;
        font-size: 0.625rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .selector-buttons {
        grid-template-columns: 1fr;
    }
    
    .tabs-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .position-number {
        font-size: 2rem;
    }
}

/* ===================================
   ANIMACIONES
   =================================== */

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

.glass-fade-in {
    animation: slideInUp 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: scale(1);
    }
    40%, 43% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1.05);
    }
    90% {
        transform: scale(1.02);
    }
}

.notification-badge {
    animation: bounce 2s infinite;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .tab-btn,
    .selector-btn,
    .friend-card,
    .ranking-item,
    .glass-fade-in,
    .notification-badge {
        transition: none;
        animation: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .tab-btn,
    .selector-btn,
    .friend-card,
    .ranking-item,
    .request-item,
    .stat-card {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .tab-btn:hover,
    .selector-btn:hover,
    .friend-card:hover,
    .ranking-item:hover {
        border-color: #ffffff;
    }
    
    .profile-name,
    .section-title {
        color: #ffffff;
    }
}