/* ==============================================
   ONBOARDING TOUR - Driver.js Custom Styles
   Rey de la Cancha
   ============================================== */

/* Variables CSS para el tour */
:root {
    --tour-primary: #10b981;
    --tour-primary-dark: #059669;
    --tour-secondary: #6366f1;
    --tour-bg: #1e293b;
    --tour-text: #f1f5f9;
    --tour-text-muted: #94a3b8;
    --tour-border: #334155;
    --tour-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ============================================== 
   Overlay oscuro de fondo
   ============================================== */
.driver-overlay {
    background-color: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(4px);
}

/* ============================================== 
   Popover principal
   ============================================== */
.driver-popover {
    background: linear-gradient(135deg, var(--tour-bg) 0%, #0f172a 100%) !important;
    border: 1px solid var(--tour-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--tour-shadow) !important;
    max-width: 400px !important;
    padding: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Flecha del popover */
.driver-popover-arrow {
    border-color: var(--tour-border) !important;
}

.driver-popover-arrow-side-left {
    border-left-color: var(--tour-bg) !important;
}

.driver-popover-arrow-side-right {
    border-right-color: var(--tour-bg) !important;
}

.driver-popover-arrow-side-top {
    border-top-color: var(--tour-bg) !important;
}

.driver-popover-arrow-side-bottom {
    border-bottom-color: var(--tour-bg) !important;
}

/* ============================================== 
   Título del paso
   ============================================== */
.driver-popover-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--tour-text) !important;
    padding: 1.25rem 1.5rem 0.75rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.driver-popover-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--tour-primary) 0%, var(--tour-secondary) 100%);
    border-radius: 2px;
    margin-right: 0.25rem;
}

/* ============================================== 
   Descripción del paso
   ============================================== */
.driver-popover-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: var(--tour-text-muted) !important;
    padding: 0 1.5rem 1rem !important;
    margin: 0 !important;
}

/* ============================================== 
   Indicador de progreso
   ============================================== */
.driver-popover-progress-text {
    font-size: 0.8rem !important;
    color: var(--tour-text-muted) !important;
    padding: 0.5rem 1.5rem !important;
    border-top: 1px solid var(--tour-border) !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 0 0 16px 16px !important;
}

/* ============================================== 
   Footer con botones
   ============================================== */
.driver-popover-footer {
    padding: 0.75rem 1.5rem 1.25rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

/* Botón genérico */
.driver-popover-footer button {
    padding: 0.6rem 1.25rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

/* Botón Anterior */
.driver-popover-prev-btn {
    background: transparent !important;
    color: var(--tour-text-muted) !important;
    border: 1px solid var(--tour-border) !important;
}

.driver-popover-prev-btn:hover {
    background: var(--tour-border) !important;
    color: var(--tour-text) !important;
}

/* Botón Siguiente */
.driver-popover-next-btn {
    background: linear-gradient(135deg, var(--tour-primary) 0%, var(--tour-primary-dark) 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

.driver-popover-next-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
}

/* Botón Cerrar/Omitir */
.driver-popover-close-btn {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--tour-text-muted) !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.driver-popover-close-btn:hover {
    background: var(--tour-border) !important;
    color: var(--tour-text) !important;
}

/* ============================================== 
   Elemento resaltado
   ============================================== */
.driver-active-element {
    border-radius: 8px !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4) !important;
}

/* ============================================== 
   Animaciones
   ============================================== */
@keyframes tour-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.driver-popover {
    animation: tour-fade-in 0.3s ease-out !important;
}

/* ============================================== 
   Responsive
   ============================================== */
@media (max-width: 640px) {
    .driver-popover {
        max-width: 320px !important;
        margin: 0.5rem !important;
    }

    .driver-popover-title {
        font-size: 1.1rem !important;
        padding: 1rem 1rem 0.5rem !important;
    }

    .driver-popover-description {
        font-size: 0.9rem !important;
        padding: 0 1rem 0.75rem !important;
    }

    .driver-popover-footer {
        padding: 0.5rem 1rem 1rem !important;
        flex-wrap: wrap !important;
    }

    .driver-popover-footer button {
        flex: 1 !important;
        min-width: 100px !important;
    }
}

/* ============================================== 
   Botón flotante para reiniciar tour
   ============================================== */
#tour-help-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tour-primary) 0%, var(--tour-primary-dark) 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

#tour-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

#tour-help-btn.hidden {
    display: none;
}

/* Tooltip del botón de ayuda */
#tour-help-btn::after {
    content: 'Ver Tutorial';
    position: absolute;
    right: 60px;
    background: var(--tour-bg);
    color: var(--tour-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#tour-help-btn:hover::after {
    opacity: 1;
}

/* ============================================== 
   Pantalla de bienvenida (modal inicial)
   ============================================== */
#onboarding-welcome {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#onboarding-welcome.active {
    opacity: 1;
    visibility: visible;
}

.welcome-card {
    background: linear-gradient(135deg, var(--tour-bg) 0%, #0f172a 100%);
    border: 1px solid var(--tour-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 480px;
    text-align: center;
    box-shadow: var(--tour-shadow);
    animation: tour-fade-in 0.4s ease-out;
}

.welcome-card .logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.welcome-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tour-text);
    margin-bottom: 0.75rem;
}

.welcome-card p {
    color: var(--tour-text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.welcome-card .btn-start-tour {
    background: linear-gradient(135deg, var(--tour-primary) 0%, var(--tour-primary-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.welcome-card .btn-start-tour:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.welcome-card .btn-skip {
    background: transparent;
    color: var(--tour-text-muted);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--tour-border);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: all 0.2s;
}

.welcome-card .btn-skip:hover {
    background: var(--tour-border);
    color: var(--tour-text);
}

/* ============================================== 
   Modal de bienvenida mejorado (versión larga)
   ============================================== */
.welcome-card-large {
    max-width: 550px;
    padding: 2rem 2.5rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    text-align: left;
}

.welcome-highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--tour-border);
}

.welcome-highlight-item .highlight-icon {
    font-size: 1.75rem;
    min-width: 40px;
    text-align: center;
}

.welcome-highlight-item div {
    display: flex;
    flex-direction: column;
}

.welcome-highlight-item strong {
    color: var(--tour-text);
    font-size: 0.95rem;
}

.welcome-highlight-item small {
    color: var(--tour-text-muted);
    font-size: 0.8rem;
}

.welcome-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
    color: #fcd34d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.welcome-warning strong {
    color: #f59e0b;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.welcome-buttons .btn-start-tour {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-skip-warn {
    background: transparent;
    color: var(--tour-text-muted);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--tour-border);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-skip-warn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    opacity: 1;
}

.welcome-footer-note {
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--tour-text-muted);
}

.welcome-footer-note a {
    color: inherit;
    text-decoration: underline;
}

.welcome-footer-note a:hover {
    color: var(--tour-primary);
}

@media (max-width: 576px) {
    .welcome-card-large {
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .welcome-icon {
        font-size: 3rem;
    }
    
    .welcome-card-large h1 {
        font-size: 1.4rem;
    }
    
    .welcome-highlight-item {
        padding: 0.5rem 0.75rem;
    }
    
    .welcome-highlight-item .highlight-icon {
        font-size: 1.5rem;
        min-width: 32px;
    }
}
