/**
 * Intro.js Custom Styling
 * Fixes and enhancements for the onboarding tour
 */

/* Better tooltip styling */
.introjs-tooltip {
    max-width: 400px;
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Improve title styling */
.introjs-tooltip-title {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

/* Content area */
.introjs-tooltiptext {
    padding: 15px;
    line-height: 1.6;
}

/* Button styling */
.introjs-button {
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.introjs-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.introjs-nextbutton,
.introjs-donebutton {
    background-color: #0d6efd;
    color: white;
    border: none;
}

.introjs-nextbutton:hover,
.introjs-donebutton:hover {
    background-color: #0b5ed7;
}

.introjs-prevbutton {
    background-color: #6c757d;
    color: white;
    border: none;
}

.introjs-skipbutton {
    color: #6c757d;
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.introjs-skipbutton:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
}

/* Progress bar styling */
.introjs-progress {
    background-color: #e9ecef;
    height: 4px;
}

.introjs-progressbar {
    background-color: #0d6efd;
}

/* Bullets styling */
.introjs-bullets ul li a {
    width: 8px;
    height: 8px;
    background-color: #dee2e6;
}

.introjs-bullets ul li a.active {
    background-color: #0d6efd;
    width: 10px;
    height: 10px;
}

/* Overlay styling */
.introjs-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Highlight styling */
.introjs-helperLayer {
    border-radius: 5px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .introjs-tooltip {
        max-width: 90vw;
        min-width: 280px;
    }
    
    .introjs-tooltiptext {
        font-size: 0.9rem;
    }
    
    .introjs-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .introjs-tooltip-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .introjs-tooltip {
        min-width: 260px;
    }
    
    .introjs-tooltipbuttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .introjs-button {
        flex: 1;
        min-width: 70px;
    }
}

/* Dark theme support */
[data-theme="dark"] .introjs-tooltip {
    background-color: #2d3748;
    color: #e2e8f0;
}

[data-theme="dark"] .introjs-tooltip-title {
    background-color: #1a202c;
    border-bottom-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .introjs-tooltiptext {
    color: #e2e8f0;
}

[data-theme="dark"] .introjs-skipbutton {
    color: #cbd5e0;
}

[data-theme="dark"] .introjs-skipbutton:hover {
    background-color: rgba(203, 213, 224, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .introjs-progress {
    background-color: #4a5568;
}

[data-theme="dark"] .introjs-bullets ul li a {
    background-color: #4a5568;
}

/* Checkbox container styling in final step */
.intro-checkbox-container {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

[data-theme="dark"] .intro-checkbox-container {
    background-color: #2d3748;
    border-color: #4a5568;
}

/* Checkbox styling in final step */
#intro-dont-show {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Z-index fixes to ensure tour is above all elements */
.introjs-overlay {
    z-index: 9998 !important;
}

.introjs-helperLayer {
    z-index: 9998 !important;
}

.introjs-tooltipReferenceLayer {
    z-index: 9999 !important;
}

.introjs-tooltip {
    z-index: 10000 !important;
}

/* Ensure highlighted element is visible */
.introjs-showElement {
    z-index: 9999 !important;
}

/* Arrow styling improvements */
.introjs-arrow {
    border-color: transparent;
}

.introjs-arrow.top {
    border-bottom-color: #f8f9fa;
}

.introjs-arrow.bottom {
    border-top-color: #f8f9fa;
}

.introjs-arrow.left {
    border-right-color: #f8f9fa;
}

.introjs-arrow.right {
    border-left-color: #f8f9fa;
}

[data-theme="dark"] .introjs-arrow.top {
    border-bottom-color: #1a202c;
}

[data-theme="dark"] .introjs-arrow.bottom {
    border-top-color: #1a202c;
}

[data-theme="dark"] .introjs-arrow.left {
    border-right-color: #1a202c;
}

[data-theme="dark"] .introjs-arrow.right {
    border-left-color: #1a202c;
}

/* Focus states for accessibility */
.introjs-button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Animation for tooltip appearance */
.introjs-tooltip {
    animation: introjs-fade-in 0.3s ease-out;
}

@keyframes introjs-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
