/* Estilos generales */
#hwa-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header */
.hwa-header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #d35400, #e67e22);
    color: white;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.3);
    position: relative;
    overflow: hidden;
}

.hwa-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(360deg); }
}

.hwa-header h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.hwa-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

/* Tarjetas */
.hwa-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hwa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.hwa-card h2 {
    margin-top: 0;
    color: #e67e22;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hwa-card h3 {
    color: #2c3e50;
    font-size: 18px;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

/* Ficha de usuario */
.user-profile .profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.last-update {
    color: #7f8c8d;
    font-size: 14px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #fff5eb, #ffe8d6);
    border: 2px solid #ffa94d;
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 169, 77, 0.3);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #e67e22;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-details {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.detail-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-item strong {
    color: #2c3e50;
    display: inline-block;
    min-width: 150px;
}

/* Formularios */
.hwa-form {
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f8f9fa;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
    background-color: white;
    transform: translateY(-1px);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

/* Botones */
.hwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
    min-width: 140px;
}

.hwa-btn-primary {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.hwa-btn-primary:hover {
    background: linear-gradient(135deg, #d35400, #c0392b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.hwa-btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.hwa-btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7a7d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.hwa-btn-icon {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.hwa-btn-icon:hover {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
    transform: scale(1.1);
}

/* Contenedor de consejos */
.advice-container {
    background: linear-gradient(135deg, #fff9f2, #fff5eb);
    border: 2px solid #ffa94d;
}

.advice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.advice-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#hwa-advice-counter {
    font-weight: 600;
    color: #e67e22;
    min-width: 40px;
    text-align: center;
}

.advice-display {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 15px;
    border: 2px dashed #ffe8d6;
    margin-bottom: 20px;
}

.advice-content {
    font-size: 18px;
    line-height: 1.6;
    color: #2c3e50;
    margin: 0;
    font-weight: 500;
}

.advice-loading {
    color: #7f8c8d;
    font-style: italic;
}

.advice-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ffe8d6;
}

.advice-note {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Mensajes */
.hwa-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hwa-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #c8e6c9;
}

.hwa-error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ffcdd2;
}

.hwa-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #bbdefb;
}

/* Login requerido */
.hwa-login-required {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hwa-login-required p {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.hwa-login-required a {
    color: #e67e22;
    text-decoration: none;
    font-weight: 600;
}

.hwa-login-required a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    #hwa-container {
        padding: 15px;
    }
    
    .hwa-header {
        padding: 25px 15px;
    }
    
    .hwa-header h1 {
        font-size: 26px;
    }
    
    .hwa-card {
        padding: 20px;
        border-radius: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advice-header {
        flex-direction: column;
        text-align: center;
    }
    
    .advice-controls {
        margin-top: 10px;
    }
    
    .advice-display {
        padding: 20px;
    }
    
    .advice-content {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hwa-header h1 {
        font-size: 22px;
    }
    
    .hwa-card h2 {
        font-size: 20px;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }
    
    .detail-item strong {
        min-width: 120px;
        display: block;
        margin-bottom: 5px;
    }
}

/* Animaciones adicionales */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estados de carga */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}