/**
 * Estilos del Componente de Perfil de Usuario
 * Menú dropdown y avatar
 */

.user-profile-menu {
    position: relative;
    display: inline-block;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-profile-trigger:hover {
    border-color: #FF6B35;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FF6B35;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlide 0.2s ease;
}

.user-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-display-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    font-size: 13px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.menu-item:hover {
    background: #f5f5f5;
    color: #FF6B35;
}

.menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.menu-item:hover svg {
    opacity: 1;
}

.menu-item-danger {
    color: #dc3545;
}

.menu-item-danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

/* Animación */
@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .user-profile-trigger {
        padding: 6px 12px;
        gap: 8px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-name {
        max-width: 80px;
        font-size: 13px;
    }

    .user-dropdown {
        min-width: 260px;
        right: -10px;
    }

    .user-dropdown-header {
        padding: 16px;
    }

    .user-avatar-large {
        width: 48px;
        height: 48px;
    }

    .user-display-name {
        font-size: 15px;
    }

    .user-email {
        font-size: 12px;
    }

    .menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .user-profile-trigger {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }

    .user-profile-trigger:hover {
        border-color: #FF6B35;
    }

    .user-dropdown {
        background: #2a2a2a;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .menu-item {
        color: #e0e0e0;
    }

    .menu-item:hover {
        background: #333;
        color: #FF6B35;
    }

    .menu-divider {
        background: #444;
    }

    .menu-item-danger:hover {
        background: #3a1f1f;
    }
}

/* Estados adicionales */
.user-profile-menu.loading .user-profile-trigger {
    opacity: 0.6;
    cursor: wait;
}

.user-profile-menu.error .user-profile-trigger {
    border-color: #dc3545;
}

/* Badge de notificaciones (opcional) */
.user-profile-trigger .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
}

/* ========================================
   Eventos Asistidos (Check-in)
   ======================================== */

.asistidos-header {
    margin-bottom: 24px;
}

.asistidos-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.asistidos-header p {
    font-size: 14px;
    color: #666;
}

/* Estadísticas de asistencia */
.attendance-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.attendance-stats .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.attendance-stats .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attendance-stats .stat-icon i {
    font-size: 24px;
}

.attendance-stats .stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attendance-stats .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.attendance-stats .stat-label {
    font-size: 13px;
    color: #666;
}

.asistidos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.evento-asistido-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.evento-asistido-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.evento-asistido-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.evento-asistido-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.evento-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.checkin-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.evento-asistido-info {
    padding: 16px;
}

.evento-asistido-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checkin-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.checkin-date i {
    font-size: 16px;
    color: #667eea;
}

.evento-asistido-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.btn-ver-evento {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-ver-evento:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-ver-evento i {
    font-size: 16px;
}

.btn-share-evento {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-share-evento:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

/* Badge en la pestaña */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #FF6B35;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

/* Estadísticas de asistencia */
.attendance-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: fit-content;
}

.stat-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 24px;
    height: 24px;
    background: #f9fafb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 14px;
    color: #6b7280;
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 18px;
    text-align: left;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .attendance-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon i {
        font-size: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 11px;
    }

    .asistidos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .evento-asistido-image {
        height: 160px;
    }
}