// Estilos para Perfil de Usuario - Grupo 4
// Vista de perfil editable con modo ver/edicion

/* Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Navbar (consistente con dashboard) */
.navbar {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand h1 {
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-logout {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-1px);
}

.navbar-user {
    font-weight: 500;
    margin-left: 2rem;
}

/* Contenido Principal */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* Contenedor de Perfil */
.profile-container {
    display: grid;
    gap: 2rem;
    animation: fadeIn 0.4s ease-out;
}

/* Header del Perfil */
.profile-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.profile-info h1 {
    margin: 0;
    color: #1976d2;
    font-size: 1.8rem;
}

.profile-info p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 1rem;
}

.membership-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.membership-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.membership-badge.inactive {
    background: #ffebee;
    color: #c62828;
}

/* Botones */
.btn-edit {
    background: #1976d2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-edit:hover {
    background: #115293;
    transform: translateY(-1px);
}

.btn-edit.editing {
    background: #ff9800;
}

.btn-edit.editing:hover {
    background: #f57c00;
}

.btn-primary {
    background: #1976d2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.btn-primary:hover {
    background: #115293;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #757575;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-1px);
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    animation: spin 1s linear infinite;
}

.btn-primary.loading .btn-loader {
    display: inline;
    position: absolute;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card del Formulario */
.profile-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #000; /* Changed to black for better readability */
}

.form-group input.editable {
    background: white;
    cursor: text;
}

.form-group input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-group input.valid {
    border-color: #4caf50;
}

.form-group input.invalid {
    border-color: #f44336;
}

.field-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.error-message {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Info de Membresía */
.membership-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.membership-info h3 {
    margin: 0 0 1rem;
    color: #1976d2;
    font-size: 1.1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
}

/* Acciones del Formulario */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

/* Mensajes */
.form-messages {
    margin-top: 1.5rem;
    min-height: 50px;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

/* Stats Summary */
.profile-stats {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-stats h3 {
    margin: 0 0 1.5rem;
    color: #1976d2;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1976d2;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.9rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    text-align: center;
    font-size: 1.2rem;
    color: #1976d2;
    font-weight: 600;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-container {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .profile-header {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .btn-edit {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
