/* ========================================
   Pantalla de Perfil
   ======================================== */

/* ========================================
   Header con botón de volver (consistente con notas.css)
   ======================================== */
.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gris-oscuro);
    transition: background-color 0.2s ease;
    padding: 0;
}

.back-btn:active {
    background-color: var(--gris-claro);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gris-oscuro);
    line-height: 1.2;
    margin: 0;
}

/* ========================================
   Profile Header
   ======================================== */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--color-primario), var(--color-primario-dark));
    border-radius: var(--radius-lg);
    color: var(--blanco);
    position: relative;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: var(--space-4);
    position: relative;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--blanco);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primario);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

.edit-avatar-btn:active {
    transform: scale(0.95);
}

.edit-avatar-btn svg {
    width: 18px;
    height: 18px;
}

.profile-info {
    width: 100%;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--blanco);
    line-height: 1.2;
    margin: 0 0 var(--space-2) 0;
}

.profile-id {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 var(--space-3) 0;
}

.profile-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.badge-student {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--blanco);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
}

.badge-year {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--blanco);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   Profile Stats
   ======================================== */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.stat-card {
    background-color: var(--blanco);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primario);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gris-medio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ========================================
   Profile Sections
   ======================================== */
.profile-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.profile-section {
    background-color: var(--blanco);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gris-oscuro);
    line-height: 1.2;
    margin: 0;
}

.edit-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background-color: var(--gris-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gris-medio);
    transition: background-color 0.2s ease;
    padding: 0;
}

.edit-btn:active {
    background-color: var(--color-primario);
    color: var(--blanco);
}

.edit-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Information Grid
   ======================================== */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--gris-claro);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gris-medio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--gris-oscuro);
    line-height: 1.4;
}

/* ========================================
   Settings List
   ======================================== */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: var(--gris-claro);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    background-color: var(--blanco);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
}

.setting-item:active {
    background-color: var(--gris-claro);
}

.setting-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background-color: var(--gris-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gris-medio);
}

.setting-icon svg {
    width: 20px;
    height: 20px;
}

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

.setting-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--gris-oscuro);
    line-height: 1.3;
    margin-bottom: 2px;
}

.setting-subtitle {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--gris-medio);
    line-height: 1.3;
}

.setting-item svg:last-child {
    width: 20px;
    height: 20px;
    color: var(--gris-medio);
    flex-shrink: 0;
}

/* ========================================
   Toggle Switch
   ======================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gris-medio);
    transition: .4s;
    border-radius: 34px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--blanco);
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--color-primario);
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(24px);
}

/* ========================================
   Actions List
   ======================================== */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    width: 100%;
}

.action-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-btn-primary {
    background-color: var(--color-primario);
    color: var(--blanco);
}

.action-btn-secondary {
    background-color: var(--gris-claro);
    color: var(--gris-oscuro);
}

/* ========================================
   App Info
   ======================================== */
.app-info {
    text-align: center;
    background-color: var(--gris-claro);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.app-version {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.app-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gris-oscuro);
}

.app-version-number {
    font-size: 14px;
    font-weight: 400;
    color: var(--gris-medio);
}

.app-description {
    font-size: 14px;
    font-weight: 400;
    color: var(--gris-medio);
    line-height: 1.5;
    margin: 0 0 var(--space-4) 0;
}

.app-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.app-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primario);
    text-decoration: none;
}

.app-link:active {
    opacity: 0.7;
}

.app-link-separator {
    font-size: 13px;
    color: var(--gris-medio);
}

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

.profile-header {
    animation: fadeInUp 0.5s ease-out;
}

.profile-stats {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.profile-section {
    animation: fadeInUp 0.5s ease-out;
}

.profile-section:nth-child(1) { animation-delay: 0.2s; }
.profile-section:nth-child(2) { animation-delay: 0.3s; }
.profile-section:nth-child(3) { animation-delay: 0.4s; }
.profile-section:nth-child(4) { animation-delay: 0.5s; }

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 360px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-name {
        font-size: 20px;
    }
    
    .setting-title {
        font-size: 15px;
    }
    
    .setting-subtitle {
        font-size: 12px;
    }
}

/* ========================================
   Dark Mode Support (Placeholder)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .profile-section,
    .stat-card,
    .setting-item {
        background-color: #1A1F28;
        color: var(--blanco);
    }
    
    .info-value,
    .setting-title,
    .section-title {
        color: var(--blanco);
    }
    
    .info-label,
    .setting-subtitle,
    .app-description {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .settings-list {
        background-color: #2D3748;
    }
    
    .app-info {
        background-color: #2D3748;
        border-color: #4A5568;
    }
}
