/* =========================================
   PAGINA PERFIL — Glassmorphism Dark Theme
   Todo scoped bajo .perfil-page
   ========================================= */

/* ALERTAS */
.perfil-page .alert-success,
.perfil-page .alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.perfil-page .alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #6ee7b7;
}

.perfil-page .alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #fca5a5;
}

/* CONTENT */
.perfil-page {
    padding: 16px;
    padding-bottom: 24px;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* =============================================
   PROFILE HEADER CARD — Glass
   ============================================= */
.perfil-page .profile-header-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 16px;
    text-align: center;
    animation: perfilSlideUp 0.4s ease-out;
}

@keyframes perfilSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.perfil-page .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 14px rgba(74, 123, 167, 0.25);
}

.perfil-page .profile-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    line-height: 1.3;
    word-break: break-word;
}

.perfil-page .profile-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
    flex-wrap: wrap;
    word-break: break-all;
}

.perfil-page .profile-email i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.perfil-page .profile-trainer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 8px auto 0;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-weight: 500;
}

.perfil-page .profile-trainer i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* =============================================
   STATS GRID — siempre 3 columnas
   ============================================= */
.perfil-page .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.perfil-page .stat-item {
    text-align: center !important;
    padding: 10px 4px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    min-width: 0;
    display: block !important;
}

.perfil-page .stat-value {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: white !important;
    line-height: 1.2;
}

.perfil-page .stat-label {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================
   QUICK ACTIONS — 3 columnas verticales
   ============================================= */
.perfil-page .quick-actions {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px;
    animation: perfilSlideUp 0.4s ease-out 0.05s both;
}

.perfil-page .action-card {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 14px !important;
    padding: 16px 8px !important;
    text-align: center !important;
    box-shadow: none !important;
    display: block !important;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
    text-decoration: none !important;
}

.perfil-page .action-card:active {
    transform: scale(0.96) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.perfil-page .action-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 8px !important;
    box-shadow: 0 3px 8px rgba(74, 123, 167, 0.25);
}

.perfil-page .action-icon i {
    font-size: 18px;
    color: white;
}

.perfil-page .action-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: white !important;
    margin-bottom: 2px;
    line-height: 1.3;
}

.perfil-page .action-subtitle {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.45) !important;
    font-weight: 500;
    display: none;
}

/* =============================================
   COLLAPSIBLE SECTIONS — Glass
   ============================================= */
.perfil-page .collapsible-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    animation: perfilSlideUp 0.4s ease-out 0.1s both;
}

.perfil-page .collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.perfil-page .collapsible-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.perfil-page .collapsible-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: white;
}

.perfil-page .collapsible-title i {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.perfil-page .collapsible-toggle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    transition: transform 0.3s ease;
}

.perfil-page .collapsible-toggle.active {
    transform: rotate(180deg);
}

.perfil-page .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.perfil-page .collapsible-content.active {
    max-height: 800px;
    overflow-y: auto;
}

.perfil-page .collapsible-inner {
    padding: 0 16px 16px;
}

/* EMPTY STATE */
.perfil-page .empty-state {
    text-align: center !important;
    padding: 24px 16px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
}

.perfil-page .empty-state i {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.3);
    display: block;
    margin-bottom: 8px;
}

.perfil-page .empty-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

/* =============================================
   DOCUMENT CARD
   ============================================= */
.perfil-page .document-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.perfil-page .document-card:last-child {
    margin-bottom: 0;
}

.perfil-page .document-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.perfil-page .document-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perfil-page .document-icon i {
    font-size: 18px;
    color: white;
}

.perfil-page .document-info {
    flex: 1;
    min-width: 0;
}

.perfil-page .document-title {
    font-size: 13px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.perfil-page .document-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

/* =============================================
   ACHIEVEMENT CARD
   ============================================= */
.perfil-page .achievement-card {
    background: rgba(255, 193, 7, 0.12);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.perfil-page .achievement-card:last-child {
    margin-bottom: 0;
}

.perfil-page .achievement-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.perfil-page .achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.25);
}

.perfil-page .achievement-icon i {
    font-size: 18px;
    color: white;
}

.perfil-page .achievement-title {
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.perfil-page .achievement-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.perfil-page .achievement-date i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* =============================================
   SECTION HEADER
   ============================================= */
.perfil-page .section-header {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 15px !important;
    font-weight: 700;
    color: white !important;
    margin: 16px 0 12px;
    padding-left: 2px;
}

.perfil-page .section-header i {
    font-size: 20px;
}

/* =============================================
   INFO CARD — Glass
   ============================================= */
.perfil-page .info-card {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    box-shadow: none !important;
    animation: perfilSlideUp 0.4s ease-out 0.15s both;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    color: white !important;
    margin-bottom: 0 !important;
}

/* =============================================
   STATUS BADGE
   ============================================= */
.perfil-page .status-badge {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: inherit !important;
    white-space: normal !important;
    color: inherit !important;
}

.perfil-page .status-badge.complete {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.perfil-page .status-badge.incomplete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.perfil-page .status-badge i.status-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.perfil-page .status-badge.complete i.status-icon {
    color: #6ee7b7;
}

.perfil-page .status-badge.incomplete i.status-icon {
    color: #fca5a5;
}

.perfil-page .status-text {
    flex: 1;
    min-width: 0;
}

.perfil-page .status-title {
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.perfil-page .status-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.perfil-page .status-detail strong {
    color: white;
    font-weight: 700;
}

/* =============================================
   BTN ACTION — Glass
   ============================================= */
.perfil-page .btn-action {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100%;
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    color: white !important;
    backdrop-filter: none !important;
    box-sizing: border-box;
}

.perfil-page .btn-action:active {
    background: rgba(255, 255, 255, 0.12) !important;
    transform: scale(0.98);
}

.perfil-page .btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    min-width: 0;
}

.perfil-page .btn-content i {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.perfil-page .btn-action > i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* =============================================
   BTN LOGOUT — Keep red gradient
   ============================================= */
.perfil-page .btn-logout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    width: 100%;
    padding: 14px !important;
    margin-top: 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
    -webkit-tap-highlight-color: transparent;
}

.perfil-page .btn-logout:active {
    transform: scale(0.97);
}

.perfil-page .btn-logout i {
    font-size: 20px;
}

/* =============================================
   RESPONSIVE — 420px+ (phones grandes)
   ============================================= */
@media (min-width: 420px) {
    .perfil-page {
        padding: 20px;
    }

    .perfil-page .profile-header-card {
        padding: 28px 24px;
    }

    .perfil-page .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .perfil-page .profile-name {
        font-size: 22px;
    }

    .perfil-page .action-subtitle {
        display: block;
    }

    .perfil-page .action-icon {
        width: 44px !important;
        height: 44px !important;
    }

    .perfil-page .stat-value {
        font-size: 22px !important;
    }

    .perfil-page .stat-label {
        font-size: 11px !important;
    }
}

/* =============================================
   RESPONSIVE — <360px (phones pequenos)
   ============================================= */
@media (max-width: 359px) {
    .perfil-page {
        padding: 12px;
    }

    .perfil-page .profile-header-card {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .perfil-page .profile-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .perfil-page .profile-name {
        font-size: 17px;
    }

    .perfil-page .profile-email {
        font-size: 11px;
    }

    .perfil-page .stats-grid {
        gap: 6px !important;
    }

    .perfil-page .stat-item {
        padding: 8px 2px !important;
    }

    .perfil-page .stat-value {
        font-size: 17px !important;
    }

    .perfil-page .stat-label {
        font-size: 9px !important;
    }

    .perfil-page .quick-actions {
        gap: 6px !important;
    }

    .perfil-page .action-card {
        padding: 12px 6px !important;
        border-radius: 12px !important;
    }

    .perfil-page .action-icon {
        width: 34px !important;
        height: 34px !important;
        margin-bottom: 6px !important;
    }

    .perfil-page .action-icon i {
        font-size: 15px;
    }

    .perfil-page .action-title {
        font-size: 11px !important;
    }

    .perfil-page .info-card {
        padding: 12px !important;
        gap: 10px;
    }

    .perfil-page .status-badge {
        padding: 10px;
        gap: 8px;
    }

    .perfil-page .status-badge i.status-icon {
        font-size: 18px;
    }

    .perfil-page .status-title {
        font-size: 12px;
    }

    .perfil-page .status-detail {
        font-size: 10px;
    }

    .perfil-page .btn-content {
        font-size: 12px;
        gap: 8px;
    }

    .perfil-page .btn-action {
        padding: 10px 12px !important;
    }

    .perfil-page .btn-logout {
        padding: 12px !important;
        font-size: 13px !important;
    }
}
