/*
 * Estilos para el Asistente de Tallas Doctor Baby
 * Version: 1.0.0
 */

/* === CONTENEDOR PRINCIPAL === */
.atdb-asistente-container {
    max-width: 800px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* === PESTAÑAS === */
.atdb-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 30px;
    gap: 10px;
}

.atdb-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
}

.atdb-tab:hover {
    color: #667eea;
    background: #f9fafb;
}

.atdb-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* === CONTENIDO DE PESTAÑAS === */
.atdb-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.atdb-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === FORMULARIO === */
.atdb-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.atdb-form-group {
    margin-bottom: 20px;
}

.atdb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.atdb-form-group input,
.atdb-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.atdb-form-group input:focus,
.atdb-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.atdb-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* === BOTONES === */
.atdb-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.atdb-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.atdb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.atdb-btn-primary:active {
    transform: translateY(0);
}

/* === RESULTADO === */
.atdb-resultado {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: none;
}

.atdb-resultado.show {
    display: block;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.atdb-talla-grande {
    font-size: 64px;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.atdb-confianza {
    text-align: center;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin: 20px auto;
    display: inline-block;
    width: 100%;
}

.atdb-confianza.alta {
    background: #d1fae5;
    color: #065f46;
}

.atdb-confianza.medio {
    background: #fef3c7;
    color: #92400e;
}

.atdb-confianza.bajo {
    background: #fee2e2;
    color: #991b1b;
}

.atdb-explicacion {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    line-height: 1.6;
}

/* === CHAT === */
.atdb-chat-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.atdb-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
}

.atdb-mensaje {
    margin-bottom: 15px;
    display: flex;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.atdb-mensaje.usuario {
    justify-content: flex-end;
}

.atdb-mensaje-contenido {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.atdb-mensaje.asistente .atdb-mensaje-contenido {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.atdb-mensaje.usuario .atdb-mensaje-contenido {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.atdb-chat-input-container {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.atdb-chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.atdb-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.atdb-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.atdb-chat-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.atdb-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.atdb-chat-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === MODAL === */
.atdb-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.atdb-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.atdb-modal-contenido {
    background: #f9fafb;
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.atdb-cerrar {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.3s ease;
}

.atdb-cerrar:hover {
    color: #667eea;
}

/* === BOTÓN EN PRODUCTO === */
.atdb-boton-container {
    margin: 20px 0;
}

.atdb-abrir-asistente {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.atdb-abrir-asistente:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* === LOADING === */
.atdb-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .atdb-asistente-container {
        padding: 15px;
    }

    .atdb-form,
    .atdb-resultado {
        padding: 20px;
    }

    .atdb-form-row {
        grid-template-columns: 1fr;
    }

    .atdb-talla-grande {
        font-size: 48px;
    }

    .atdb-tabs {
        flex-wrap: wrap;
    }

    .atdb-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }

    .atdb-modal-contenido {
        width: 95%;
        padding: 20px;
    }

    .atdb-chat-container {
        height: 500px;
    }

    .atdb-mensaje-contenido {
        max-width: 85%;
    }
}

/* === ACCESIBILIDAD === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
