/**
 * FitTrack Pro - Onboarding Tour Styles
 * Custom styling for Driver.js to match dark theme
 */

/* Override Driver.js default styles for dark theme */
.driver-popover {
    background: var(--bg-secondary, #2a2a2a) !important;
    color: var(--text-primary, #e0e0e0) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    max-width: 400px !important;
}

.driver-popover-title {
    color: var(--primary-color, #667eea) !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
}

.driver-popover-description {
    color: var(--text-secondary, #b0b0b0) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

.driver-popover-description strong {
    color: var(--primary-color, #667eea) !important;
    font-weight: 600 !important;
}

/* Arrow styling */
.driver-popover-arrow {
    border-color: var(--bg-secondary, #2a2a2a) !important;
}

.driver-popover-arrow-side-top {
    border-top-color: var(--bg-secondary, #2a2a2a) !important;
}

.driver-popover-arrow-side-bottom {
    border-bottom-color: var(--bg-secondary, #2a2a2a) !important;
}

.driver-popover-arrow-side-left {
    border-left-color: var(--bg-secondary, #2a2a2a) !important;
}

.driver-popover-arrow-side-right {
    border-right-color: var(--bg-secondary, #2a2a2a) !important;
}

/* Footer buttons */
.driver-popover-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
}

.driver-popover-navigation-btns {
    display: flex;
    gap: 0.5rem;
}

.driver-popover-btn {
    background: var(--primary-color, #667eea) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.driver-popover-btn:hover {
    background: var(--primary-hover, #5568d3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.driver-popover-prev-btn {
    background: var(--bg-tertiary, #3a3a3a) !important;
}

.driver-popover-prev-btn:hover {
    background: var(--bg-hover, #4a4a4a) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.driver-popover-close-btn {
    background: transparent !important;
    color: var(--text-secondary, #b0b0b0) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 1.25rem !important;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.driver-popover-close-btn:hover {
    background: var(--bg-tertiary, #3a3a3a) !important;
    color: var(--text-primary, #e0e0e0) !important;
    transform: none;
}

/* Progress text */
.driver-popover-progress-text {
    color: var(--text-tertiary, #888) !important;
    font-size: 0.85rem !important;
}

/* Overlay */
.driver-overlay {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

/* Highlighted element */
.driver-active-element {
    position: relative;
    z-index: 9999;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .driver-popover {
        max-width: 90vw !important;
        margin: 1rem !important;
    }

    .driver-popover-title {
        font-size: 1.1rem !important;
    }

    .driver-popover-description {
        font-size: 0.9rem !important;
    }

    .driver-popover-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
    }
}

/* Specific optimization for mobile portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .driver-popover {
        max-width: 95vw !important;
        /* Use more width but smaller content */
        margin: 0 auto !important;
        padding: 15px !important;
    }

    .driver-popover-title {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .driver-popover-description {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }

    .driver-popover-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .driver-popover-footer {
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
    }
}

/* Animations */
@keyframes driverPopoverFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.driver-popover {
    animation: driverPopoverFadeIn 0.2s ease-out;
}

/* Tour restart button styling */
.restart-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--accent-primary, #764ba2) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restart-tour-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.restart-tour-btn i {
    font-size: 1rem;
}

/* Small icon button for dashboard */
.onboarding-quick-start {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--accent-primary, #764ba2) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.onboarding-quick-start:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.onboarding-quick-start i {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .onboarding-quick-start {
        bottom: 90px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* Pulse animation for first-time users */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }
}

.onboarding-quick-start.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Force sidebar to stay open during onboarding tour */
body.onboarding-tour-active .sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Prevent sidebar from closing during tour */
body.onboarding-tour-active .sidebar.active {
    transform: translateX(0) !important;
}

/* Ensure overlay stays visible during tour */
body.onboarding-tour-active .sidebar::before {
    opacity: 1 !important;
}