/**
 * Estilos para Widget Flotante de Versículos Bíblicos
 * Clase mundial con múltiples temas y estilos
 */

/* ============================================================
   VARIABLES DE COLOR POR TEMA
   ============================================================ */

.biblical-widget[data-theme="blue"] {
    --gradient-start: #4a5fd4;
    --gradient-end: #5b3a8f;
    --shadow-color: rgba(74, 95, 212, 0.4);
}

.biblical-widget[data-theme="purple"] {
    --gradient-start: #8b5cf6;
    --gradient-end: #c026d3;
    --shadow-color: rgba(139, 92, 246, 0.4);
}

.biblical-widget[data-theme="green"] {
    --gradient-start: #059669;
    --gradient-end: #0891b2;
    --shadow-color: rgba(5, 150, 105, 0.4);
}

.biblical-widget[data-theme="gold"] {
    --gradient-start: #d97706;
    --gradient-end: #c2410c;
    --shadow-color: rgba(217, 119, 6, 0.4);
}

.biblical-widget[data-theme="red"] {
    --gradient-start: #dc2626;
    --gradient-end: #be123c;
    --shadow-color: rgba(220, 38, 38, 0.4);
}

.biblical-widget[data-theme="orange"] {
    --gradient-start: #ea580c;
    --gradient-end: #dc2626;
    --shadow-color: rgba(234, 88, 12, 0.4);
}

/* ============================================================
   ESTRUCTURA BASE DEL WIDGET
   ============================================================ */

.biblical-widget {
    position: fixed;
    width: 300px;
    max-width: 90vw;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 20px;
    padding: 22px 18px 16px;
    box-shadow: 0 15px 40px var(--shadow-color),
                0 8px 20px rgba(0, 0, 0, 0.2);
    color: white;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    user-select: none;
    overflow: hidden;
    box-sizing: border-box;
}

/* Prevenir que los elementos hijos se salgan del contenedor */
.biblical-widget * {
    box-sizing: border-box;
}

.biblical-widget.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.biblical-widget.dragging {
    cursor: grabbing !important;
    transition: box-shadow 0.2s;
    box-shadow: 0 30px 80px var(--shadow-color),
                0 15px 40px rgba(0, 0, 0, 0.3);
}

.biblical-widget.transitioning .widget-content > * {
    opacity: 0.3;
    transform: translateY(-10px);
}

/* ============================================================
   HANDLE PARA ARRASTRAR
   ============================================================ */

.widget-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.widget-handle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.widget-handle:active {
    cursor: grabbing;
}

.handle-icon {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: -2px;
    font-weight: 700;
}

/* ============================================================
   BOTÓN CERRAR
   ============================================================ */

.widget-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
    z-index: 10;
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================================
   CONTENIDO DEL WIDGET
   ============================================================ */

.widget-content {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.widget-content > * {
    transition: all 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

/* Header */
.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-top: 8px;
}

.widget-icon {
    font-size: 20px;
}

.widget-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: white;
}

/* Título del versículo */
.verse-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
}

/* Contenedor de texto bíblico */
.verse-text-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.verse-text {
    margin: 0 0 8px 0;
    font-size: 12px;
    line-height: 1.6;
    color: white;
    font-style: italic;
    font-weight: 400;
}

.verse-reference {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
}

/* Interpretación */
.verse-interpretation-container {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 10px;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.verse-interpretation {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

.verse-interpretation strong {
    display: block;
    margin-bottom: 3px;
}

/* Progreso */
.verse-progress {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.progress-dots {
    display: flex;
    gap: 5px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-start;
}

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
    flex-shrink: 0;
}

.progress-dot.active {
    background: white;
    width: 18px;
    border-radius: 3px;
}

.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
}

/* Controles */
.widget-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.control-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: 700;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

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

.control-play {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

/* Barra de progreso automático */
.auto-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    z-index: 1;
}

.auto-progress-fill {
    height: 100%;
    background: white;
    width: 0;
    transition: width 0.1s linear;
}

/* ============================================================
   BOTÓN MINIMIZADO
   ============================================================ */

.biblical-minimized-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.biblical-minimized-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.biblical-minimized-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5),
                0 8px 20px rgba(0, 0, 0, 0.3);
}

.biblical-minimized-btn:active {
    transform: scale(0.95);
}

/* ============================================================
   ESTILO: MODERNO (Glassmorphism)
   ============================================================ */

.biblical-widget-modern {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.biblical-widget-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    z-index: 0;
}

/* ============================================================
   ESTILO: CLÁSICO (Post-it)
   ============================================================ */

.biblical-widget-classic {
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15),
                0 5px 15px rgba(0, 0, 0, 0.1);
    background: #fef9e7;
    color: #333;
    padding: 24px 20px 18px;
}

.biblical-widget-classic .widget-title,
.biblical-widget-classic .verse-title,
.biblical-widget-classic .verse-text,
.biblical-widget-classic .verse-reference,
.biblical-widget-classic .verse-interpretation,
.biblical-widget-classic .progress-text {
    color: #333;
}

.biblical-widget-classic .verse-text-container,
.biblical-widget-classic .verse-interpretation-container {
    background: rgba(0, 0, 0, 0.05);
}

.biblical-widget-classic .control-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
}

.biblical-widget-classic .widget-close {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* ============================================================
   ESTILO: ELEGANTE (Neumorphism)
   ============================================================ */

.biblical-widget-elegant {
    box-shadow: 20px 20px 60px var(--shadow-color),
                -20px -20px 60px rgba(255, 255, 255, 0.1);
}

.biblical-widget-elegant .verse-text-container,
.biblical-widget-elegant .verse-interpretation-container {
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.1),
                inset -5px -5px 10px rgba(255, 255, 255, 0.1);
}

.biblical-widget-elegant .control-btn {
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.15),
                -5px -5px 10px rgba(255, 255, 255, 0.1);
}

/* ============================================================
   ESTILO: MINIMALISTA
   ============================================================ */

.biblical-widget-minimal {
    background: white;
    color: #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.biblical-widget-minimal .widget-title,
.biblical-widget-minimal .verse-title,
.biblical-widget-minimal .verse-text,
.biblical-widget-minimal .verse-reference,
.biblical-widget-minimal .verse-interpretation,
.biblical-widget-minimal .progress-text {
    color: #333;
}

.biblical-widget-minimal .verse-text-container {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.biblical-widget-minimal .verse-interpretation-container {
    background: #fafafa;
    border-left-color: var(--gradient-start);
}

.biblical-widget-minimal .control-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.biblical-widget-minimal .widget-close {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.biblical-widget-minimal .progress-dot {
    background: #e0e0e0;
}

.biblical-widget-minimal .progress-dot.active {
    background: var(--gradient-start);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .biblical-widget {
        width: calc(100vw - 40px);
        max-width: 300px;
        padding: 20px 16px 14px;
    }

    .widget-title {
        font-size: 14px;
    }

    .verse-title {
        font-size: 13px;
    }

    .verse-text {
        font-size: 11px;
    }

    .verse-interpretation {
        font-size: 10px;
    }

    .control-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .control-play {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    /* Ajustes adicionales para progreso en móvil */
    .progress-dot {
        width: 5px;
        height: 5px;
    }

    .progress-dot.active {
        width: 15px;
    }

    .progress-text {
        font-size: 10px;
    }

    .verse-progress {
        gap: 8px;
        padding: 0 2px;
    }
}

/* ============================================================
   ANIMACIONES
   ============================================================ */

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animación de entrada suave */
.biblical-widget.visible .widget-content > * {
    animation: fadeInUp 0.5s ease forwards;
}

.biblical-widget.visible .verse-title {
    animation-delay: 0.1s;
}

.biblical-widget.visible .verse-text-container {
    animation-delay: 0.2s;
}

.biblical-widget.visible .verse-interpretation-container {
    animation-delay: 0.3s;
}

.biblical-widget.visible .widget-controls {
    animation-delay: 0.4s;
}
