/* Línea de la Vida Emocional - Estilos Actualizados */
.lve-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.lve-wrapper {
    font-family: 'Arial', sans-serif;
    margin: 20px auto;
    padding: 20px;
    max-width: 1000px;
}

.lve-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    position: relative;
}

.lve-header {
    text-align: center;
    margin-bottom: 40px;
}

.lve-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lve-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 15px;
}

.lve-info {
    font-size: 1em;
    color: #555;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e8f4fd, #d7efff);
    border-radius: 25px;
    border: 2px solid #667eea;
    display: inline-block;
}

.lve-name-section {
    margin: 25px 0;
}

.lve-name-section label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.lve-name-section input {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.lve-name-section input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.lve-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.lve-btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lve-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.lve-btn-secondary {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #333;
}

.lve-btn-success {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #333;
}

.lve-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.lve-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Timeline Styles */
.lve-timeline-container {
    position: relative;
    padding: 40px 0;
}

.lve-timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transform: translateX(-50%);
    border-radius: 2px;
}

.lve-event-container {
    position: relative;
    margin: 40px 0;
    display: flex;
    align-items: center;
}

.lve-event-container.lve-left {
    justify-content: flex-end;
    text-align: right;
}

.lve-event-container.lve-right {
    justify-content: flex-start;
    text-align: left;
}

.lve-event-card {
    width: 45%;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.lve-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.lve-left .lve-event-card {
    margin-right: 8%;
}

.lve-right .lve-event-card {
    margin-left: 8%;
}

.lve-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}

.lve-event-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.lve-emoji-selector {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lve-emoji-btn {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lve-emoji-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.lve-emoji-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.lve-selected-emoji {
    font-size: 24px;
    padding: 5px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #f8f9fa;
    min-width: 40px;
    text-align: center;
}

.lve-event-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Mejoras adicionales para contraste y legibilidad */
.lve-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Mejorar visibilidad en modo claro */
.lve-wrapper:not([data-theme="dark"]) .lve-field label {
    color: #2d3748;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.lve-wrapper:not([data-theme="dark"]) .lve-field input:not(:focus):not(.valid):not(.error),
.lve-wrapper:not([data-theme="dark"]) .lve-field textarea:not(:focus):not(.valid):not(.error) {
    color: #4a5568;
    font-weight: 500;
}

/* Asegurar contraste en campos activos */
.lve-field input:focus,
.lve-field textarea:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lve-field input.valid,
.lve-field textarea.valid {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.lve-field input.error,
.lve-field textarea.error {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.lve-field label {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.lve-field input,
.lve-field textarea {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2d3748;
    font-weight: 500;
}

.lve-field input:focus,
.lve-field textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    color: #1a202c;
    font-weight: 500;
}

.lve-field input::placeholder,
.lve-field textarea::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.lve-field textarea {
    resize: vertical;
    min-height: 80px;
}

.lve-timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    background: white;
    border: 4px solid #667eea;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Badges para eventos requeridos/opcionales */
.lve-required-badge {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: #8b0000;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.lve-optional-badge {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #8b4513;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.lve-event-container.lve-required .lve-event-card {
    border-left: 4px solid #ff9a9e;
}

.lve-event-container.lve-optional {
    opacity: 0.85;
}

.lve-event-container.lve-optional .lve-event-card {
    border-style: dashed;
    border-left: 4px dashed #fcb69f;
}

.lve-event-container.completed .lve-event-card {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8, #ffffff);
}

.lve-event-container.completed.lve-optional .lve-event-card {
    border-style: solid;
    border-left: 4px solid #4CAF50;
}

/* Progress Bar */
.lve-progress-section {
    margin-top: 30px;
    text-align: center;
}

.lve-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.lve-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.lve-progress-text {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
}

/* Modal Styles */
.lve-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.lve-modal.show {
    opacity: 1;
    visibility: visible;
}

.lve-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    text-align: left;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: auto;
    position: relative;
}

.lve-modal-content h3 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lve-instructions-content {
    margin-bottom: 25px;
}

.lve-instruction-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.lve-instruction-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.lve-instruction-item p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.lve-instruction-item ul {
    margin-left: 20px;
    color: #666;
}

.lve-instruction-item li {
    margin: 5px 0;
    line-height: 1.4;
}

/* Estados de validación mejorados */
.lve-field input.valid,
.lve-field textarea.valid {
    border-color: #4CAF50;
    background: #f0fff4;
    color: #1a365d;
    font-weight: 600;
}

.lve-field input.error,
.lve-field textarea.error {
    border-color: #f44336;
    background: #fff5f5;
    color: #c53030;
    font-weight: 500;
}

/* Mejorar visibilidad de labels en diferentes estados */
.lve-field input.valid + label,
.lve-field textarea.valid + label,
.lve-field:has(.valid) label {
    color: #2f855a;
}

.lve-field input.error + label,
.lve-field textarea.error + label,
.lve-field:has(.error) label {
    color: #e53e3e;
}

/* Animaciones */
.lve-timeline-dot.pulse-success {
    animation: pulseSuccess 1s ease-out;
}

@keyframes pulseSuccess {
    0% {
        transform: translate(-50%, -50%) scale(1);
        border-color: #667eea;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        border-color: #4CAF50;
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        border-color: #4CAF50;
    }
}

.lve-selected-emoji.bounce {
    animation: bounce 0.5s ease-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.lve-btn.ready {
    animation: glow 2s infinite;
}

.lve-btn.ready.complete {
    background: linear-gradient(135deg, #4CAF50, #43e97b);
    animation: glowComplete 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4), 0 0 20px rgba(102, 126, 234, 0.3);
    }
}

@keyframes glowComplete {
    0%, 100% {
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4), 0 0 20px rgba(76, 175, 80, 0.3);
    }
}

.lve-event-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast notifications */
.lve-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 350px;
}

.lve-toast.show {
    transform: translateX(0);
}

.lve-toast-content {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lve-toast-success {
    border-left: 4px solid #4CAF50;
}

.lve-toast-error {
    border-left: 4px solid #f44336;
}

.lve-toast-info {
    border-left: 4px solid #667eea;
}

.lve-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.lve-toast-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lve-wrapper {
        padding: 10px;
    }
    
    .lve-container {
        padding: 20px;
    }
    
    .lve-title {
        font-size: 2em;
    }
    
    .lve-info {
        font-size: 0.9em;
        padding: 10px 15px;
    }
    
    .lve-timeline-line {
        left: 30px;
    }
    
    .lve-event-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lve-event-container.lve-left,
    .lve-event-container.lve-right {
        justify-content: flex-start;
        text-align: left;
    }
    
    .lve-event-card {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        margin-right: 0 !important;
    }
    
    .lve-timeline-dot {
        left: 30px;
    }
    
    .lve-emoji-selector {
        flex-wrap: wrap;
        max-width: 200px;
    }
    
    .lve-event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lve-event-header > * {
        margin: 0;
    }
    
    .lve-required-badge,
    .lve-optional-badge {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .lve-modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .lve-modal-content {
        padding: 20px;
        margin: 0;
        border-radius: 15px;
        max-height: calc(100vh - 20px);
    }
    
    .lve-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .lve-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .lve-event-card {
        width: calc(100% - 50px);
        margin-left: 50px !important;
        padding: 15px;
    }
    
    .lve-timeline-line {
        left: 25px;
    }
    
    .lve-timeline-dot {
        left: 25px;
        width: 12px;
        height: 12px;
        border-width: 3px;
    }
    
    .lve-event-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .lve-emoji-selector {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .lve-modal-content {
        padding: 15px;
    }
    
    .lve-instruction-item {
        padding: 12px;
    }
    
    .lve-toast {
        max-width: calc(100vw - 40px);
        right: 20px;
    }
}

/* Custom Scrollbar */
.lve-modal-content::-webkit-scrollbar {
    width: 6px;
}

.lve-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.lve-modal-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.lve-modal-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Efectos especiales para eventos completados */
.lve-event-container.completed .lve-event-number {
    background: linear-gradient(135deg, #4CAF50, #43e97b);
    animation: completedPulse 2s ease-in-out infinite;
}

@keyframes completedPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
}

/* Indicadores de progreso mejorados */
.lve-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 80%, #4CAF50 100%);
    position: relative;
    overflow: hidden;
}

.lve-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Estados especiales para eventos opcionales */
.lve-event-container.lve-optional:not(.completed) {
    position: relative;
}

.lve-event-container.lve-optional:not(.completed)::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    z-index: 5;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Mejoras de accesibilidad */
.lve-btn:focus,
.lve-emoji-btn:focus,
.lve-field input:focus,
.lve-field textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support mejorado */
@media (prefers-color-scheme: dark) {
    .lve-container {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .lve-event-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .lve-field label {
        color: #e2e8f0;
        font-weight: 600;
    }
    
    .lve-field input,
    .lve-field textarea {
        background: #4a5568;
        border-color: #718096;
        color: #f7fafc;
        font-weight: 500;
    }
    
    .lve-field input::placeholder,
    .lve-field textarea::placeholder {
        color: #a0aec0;
        font-weight: 400;
    }
    
    .lve-field input:focus,
    .lve-field textarea:focus {
        background: #2d3748;
        border-color: #667eea;
        color: #ffffff;
        font-weight: 500;
    }
    
    .lve-field input.valid,
    .lve-field textarea.valid {
        background: #22543d;
        border-color: #4CAF50;
        color: #c6f6d5;
        font-weight: 600;
    }
    
    .lve-field input.error,
    .lve-field textarea.error {
        background: #742a2a;
        border-color: #f44336;
        color: #fed7d7;
        font-weight: 500;
    }
    
    .lve-instruction-item {
        background: #2d3748;
        border-left-color: #667eea;
        color: #e2e8f0;
    }
    
    .lve-instruction-item h4 {
        color: #f7fafc;
    }
    
    .lve-instruction-item p,
    .lve-instruction-item li {
        color: #cbd5e0;
    }
}