/**
 * Profile Styles - Área de perfil de usuario
 * Plataforma SEAP-IAP
 */

/* ============================================
   LAYOUT PRINCIPAL DEL PERFIL
   ============================================ */

.profile-container {
    max-width: var(--seap-container-xl);
    margin: 0 auto;
    padding: var(--seap-space-2xl) var(--seap-space-lg);
}

.profile-header {
    margin-bottom: var(--seap-space-2xl);
}

.profile-title {
    font-size: var(--seap-font-size-3xl);
    font-weight: 700;
    color: var(--seap-text-main);
    margin: 0;
}

.profile-subtitle {
    font-size: var(--seap-font-size-md);
    color: var(--seap-text-muted);
    margin-top: var(--seap-space-xs);
}

/* Layout: Sidebar + Content */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--seap-space-2xl);
    align-items: start;
}

/* ============================================
   SIDEBAR DE NAVEGACIÓN
   ============================================ */

.profile-sidebar {
    background: var(--seap-bg);
    border: 1px solid var(--seap-border);
    border-radius: var(--seap-radius-lg);
    padding: var(--seap-space-lg);
    position: sticky;
    top: calc(var(--header-height, 70px) + var(--seap-space-lg));
}

.profile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-nav-item {
    margin-bottom: var(--seap-space-xs);
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--seap-space-sm);
    padding: var(--seap-space-md) var(--seap-space-lg);
    color: var(--seap-text-main);
    text-decoration: none;
    border-radius: var(--seap-radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-nav-link:hover {
    background: var(--seap-bg-soft);
    color: var(--seap-primary);
}

.profile-nav-link.active {
    background: var(--seap-primary);
    color: white;
}

.profile-nav-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.profile-nav-link.logout-link {
    color: var(--seap-danger);
    margin-top: var(--seap-space-lg);
    border-top: 1px solid var(--seap-border);
    padding-top: var(--seap-space-lg);
}

.profile-nav-link.logout-link:hover {
    background: rgba(195, 0, 79, 0.1);
}

/* Toggle para móvil */
.profile-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--seap-space-md) var(--seap-space-lg);
    background: var(--seap-primary);
    color: white;
    border: none;
    border-radius: var(--seap-radius-md);
    font-size: var(--seap-font-size-md);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: var(--seap-space-lg);
}

.profile-sidebar-toggle svg {
    transition: transform 0.3s ease;
}

.profile-sidebar-toggle.open svg {
    transform: rotate(180deg);
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.profile-content {
    min-height: 500px;
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.profile-card {
    background: var(--seap-bg);
    border: 1px solid var(--seap-border);
    border-radius: var(--seap-radius-lg);
    padding: var(--seap-space-2xl);
}

.profile-card-title {
    font-size: var(--seap-font-size-2xl);
    font-weight: 700;
    color: var(--seap-text-main);
    margin: 0 0 var(--seap-space-xs);
}

.profile-card-description {
    font-size: var(--seap-font-size-md);
    color: var(--seap-text-muted);
    margin: 0 0 var(--seap-space-2xl);
}

/* Estadísticas del usuario */
.profile-stats {
    display: flex;
    gap: var(--seap-space-lg);
    margin-bottom: var(--seap-space-xl);
    flex-wrap: wrap;
}

.profile-stat-item {
    flex: 1;
    min-width: 120px;
    background: var(--seap-bg-soft);
    border: 1px solid var(--seap-border-light);
    border-radius: var(--seap-radius-md);
    padding: var(--seap-space-md);
    text-align: center;
}

.profile-stat-value {
    font-size: var(--seap-font-size-2xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--seap-space-xs);
}

.profile-stat-primary {
    color: var(--seap-primary);
}

.profile-stat-success {
    color: var(--seap-success);
}

.profile-stat-warning {
    color: #D97706;
}

.profile-stat-label {
    font-size: var(--seap-font-size-sm);
    color: var(--seap-text-muted);
}

/* ============================================
   SECCIÓN: DATOS PERSONALES
   ============================================ */

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: var(--seap-space-xl);
    padding-bottom: var(--seap-space-2xl);
    margin-bottom: var(--seap-space-2xl);
    border-bottom: 1px solid var(--seap-border);
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--seap-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--seap-primary);
    border: 4px solid var(--seap-border);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--seap-primary);
    color: white;
    border: 3px solid var(--seap-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-avatar-upload:hover {
    background: var(--seap-primary-dark);
}

.profile-avatar-upload input {
    display: none;
}

.profile-avatar-info h3 {
    font-size: var(--seap-font-size-xl);
    font-weight: 700;
    color: var(--seap-text-main);
    margin: 0 0 var(--seap-space-xs);
}

.profile-avatar-info p {
    font-size: var(--seap-font-size-md);
    color: var(--seap-text-muted);
    margin: 0 0 var(--seap-space-md);
}

.profile-avatar-actions {
    display: flex;
    gap: var(--seap-space-sm);
}

/* Formulario de datos personales */
.profile-form {
    display: grid;
    gap: var(--seap-space-lg);
}

.profile-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--seap-space-lg);
}

.profile-form-actions {
    display: flex;
    gap: var(--seap-space-md);
    padding-top: var(--seap-space-lg);
    border-top: 1px solid var(--seap-border);
}

/* ============================================
   SECCIÓN: CAMBIAR CONTRASEÑA
   ============================================ */

.password-requirements {
    background: var(--seap-bg-soft);
    border-left: 3px solid var(--seap-primary);
    padding: var(--seap-space-lg);
    border-radius: var(--seap-radius-md);
    margin-bottom: var(--seap-space-xl);
}

.password-requirements h4 {
    font-size: var(--seap-font-size-md);
    font-weight: 600;
    color: var(--seap-text-main);
    margin: 0 0 var(--seap-space-sm);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    font-size: var(--seap-font-size-sm);
    color: var(--seap-text-muted);
    padding-left: var(--seap-space-lg);
    position: relative;
    margin-bottom: var(--seap-space-xs);
}

.password-requirements li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--seap-primary);
}

.password-strength {
    margin-top: var(--seap-space-sm);
}

.password-strength-label {
    display: block;
    font-size: var(--seap-font-size-sm);
    color: var(--seap-text-muted);
    margin-bottom: var(--seap-space-xs);
}

.password-strength-bar {
    height: 6px;
    background: var(--seap-border);
    border-radius: var(--seap-radius-full);
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    background: var(--seap-border);
    transition: all 0.3s ease;
    border-radius: var(--seap-radius-full);
}

.password-strength-fill.weak {
    width: 33%;
    background: var(--seap-danger);
}

.password-strength-fill.medium {
    width: 66%;
    background: #F59E0B;
}

.password-strength-fill.strong {
    width: 100%;
    background: #10B981;
}

/* ============================================
   SECCIÓN: PREFERENCIAS
   ============================================ */

.preferences-group {
    margin-bottom: var(--seap-space-2xl);
    padding-bottom: var(--seap-space-2xl);
    border-bottom: 1px solid var(--seap-border);
}

.preferences-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.preferences-group-title {
    font-size: var(--seap-font-size-lg);
    font-weight: 600;
    color: var(--seap-text-main);
    margin: 0 0 var(--seap-space-sm);
}

.preferences-group-description {
    font-size: var(--seap-font-size-sm);
    color: var(--seap-text-muted);
    margin: 0 0 var(--seap-space-lg);
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--seap-space-md) 0;
}

.preference-item-info h4 {
    font-size: var(--seap-font-size-md);
    font-weight: 500;
    color: var(--seap-text-main);
    margin: 0 0 var(--seap-space-xs);
}

.preference-item-info p {
    font-size: var(--seap-font-size-sm);
    color: var(--seap-text-muted);
    margin: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--seap-border);
    transition: 0.3s;
    border-radius: var(--seap-radius-full);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--seap-primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(240, 0, 100, 0.2);
}

/* ============================================
   ESTADOS Y ALERTAS
   ============================================ */

.profile-alert {
    padding: var(--seap-space-lg);
    border-radius: var(--seap-radius-md);
    margin-bottom: var(--seap-space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--seap-space-md);
}

.profile-alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.profile-alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.profile-alert.info {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.profile-alert.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.profile-alert.danger {
    background: rgba(195, 0, 79, 0.1);
    color: var(--seap-danger);
    border: 1px solid rgba(195, 0, 79, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    .profile-sidebar-toggle {
        display: flex;
    }

    .profile-nav {
        display: none;
    }

    .profile-sidebar.open .profile-nav {
        display: block;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 767px) {
    .profile-container {
        padding: var(--seap-space-xl) var(--seap-space-md);
    }

    .profile-header {
        margin-bottom: var(--seap-space-xl);
    }

    .profile-title {
        font-size: var(--seap-font-size-2xl);
    }

    .profile-card {
        padding: var(--seap-space-xl);
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar-info {
        width: 100%;
    }

    .profile-avatar-actions {
        justify-content: center;
    }

    .profile-form-row {
        grid-template-columns: 1fr;
    }

    .profile-form-actions {
        flex-direction: column;
    }

    .profile-form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .profile-container {
        padding: var(--seap-space-lg) var(--seap-space-sm);
    }

    .profile-title {
        font-size: var(--seap-font-size-xl);
    }

    .profile-card {
        padding: var(--seap-space-lg);
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .profile-avatar-upload {
        width: 35px;
        height: 35px;
    }
}