/* Interactive Onboarding Tutorial Styles */

/* Onboarding Overlay System */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
}

.onboarding-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.onboarding-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    animation: backdropFadeIn 0.3s ease-out forwards;
}

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Onboarding Tooltip */
.onboarding-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 420px;
    min-width: 350px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: all;
    opacity: 0;
    animation: tooltipShow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
    z-index: 10001;
}

/* Better centering for desktop */
@media (min-width: 992px) {
    .onboarding-tooltip {
        max-width: 450px;
        min-width: 400px;
    }
}

[data-bs-theme="dark"] .onboarding-tooltip {
    background: rgba(33, 37, 41, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

@keyframes tooltipShow {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tooltip-content {
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

.tooltip-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.05));
}

[data-bs-theme="dark"] .tooltip-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.1));
}

.tooltip-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

[data-bs-theme="dark"] .tooltip-title {
    color: #ffffff;
}

.progress-indicator {
    font-size: 11px;
    color: #6b7280;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

[data-bs-theme="dark"] .progress-indicator {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #e5e7eb;
}

.tooltip-body {
    padding: 0 24px 20px;
    line-height: 1.6;
    color: #4b5563;
}

[data-bs-theme="dark"] .tooltip-body {
    color: #d1d5db;
}

.tooltip-body p {
    margin: 0 0 16px;
    font-size: 15px;
}

.tooltip-body p:last-child {
    margin-bottom: 0;
}

/* Tip Boxes */
.tip-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0 0;
    position: relative;
}

.tip-box.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.05));
    border-color: rgba(34, 197, 94, 0.3);
}

[data-bs-theme="dark"] .tip-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.1));
    border-color: rgba(34, 197, 94, 0.3);
}

.tip-box strong {
    color: #059669;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

[data-bs-theme="dark"] .tip-box strong {
    color: #10b981;
}

.tip-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.tip-box ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.tip-box li {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Tooltip Footer */
.tooltip-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .tooltip-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.tooltip-footer .btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.tooltip-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tooltip Arrow */
.tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    z-index: -1;
}

/* Dynamic arrow positioning */
.tooltip-arrow.arrow-top,
.tooltip-arrow.arrow-bottom {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.tooltip-arrow.arrow-left,
.tooltip-arrow.arrow-right {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

[data-bs-theme="dark"] .tooltip-arrow {
    background: rgba(33, 37, 41, 0.98);
    border-color: rgba(255, 255, 255, 0.15);
}

.arrow-top {
    top: -8px;
}

.arrow-bottom {
    bottom: -8px;
}

.arrow-left {
    left: -8px;
}

.arrow-right {
    right: -8px;
}

/* Element Highlighting */
.onboarding-highlight {
    position: relative;
    z-index: 9999;
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.3) !important;
    animation: highlightPulse 2s infinite;
}

@keyframes highlightPulse {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.4), 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

.onboarding-pulse {
    animation: gentlePulse 2s ease-in-out 3;
}

@keyframes gentlePulse {
    0%, 100% { 
        background-color: rgba(59, 130, 246, 0.1);
        transform: scale(1);
    }
    50% { 
        background-color: rgba(59, 130, 246, 0.2);
        transform: scale(1.05);
    }
}

/* Completion Toast */
.onboarding-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(34, 197, 94, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10002;
    font-weight: 500;
    font-size: 14px;
}

.onboarding-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .onboarding-tooltip {
        max-width: calc(100vw - 40px);
        min-width: calc(100vw - 40px);
        left: 20px !important;
        right: 20px !important;
    }
    
    .tooltip-header {
        padding: 16px 20px 12px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .tooltip-title {
        font-size: 16px;
    }
    
    .tooltip-body {
        padding: 0 20px 16px;
        font-size: 14px;
    }
    
    .tooltip-footer {
        padding: 12px 20px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .tooltip-footer .btn {
        flex: 1;
        min-width: 80px;
    }
    
    .skip-btn {
        align-self: center;
    }

    .onboarding-toast {
        left: 10px;
        right: 10px;
        top: 70px;
        transform: translateY(-100%);
    }
    
    .onboarding-toast.show {
        transform: translateY(0);
    }
    
    .toast-content {
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tooltip-body {
        font-size: 13px;
    }
    
    .tip-box {
        padding: 12px;
        margin: 12px 0 0;
    }
    
    .tip-box p, .tip-box li {
        font-size: 12px;
    }
}

/* Focus states for accessibility */
.tooltip-footer .btn:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Celebration animations */
@keyframes celebrationFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes emojiBlast {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

/* Smooth transitions for all onboarding elements */
.onboarding-overlay * {
    transition: all 0.2s ease;
}

/* Special styling for highlighted navigation items */
.navbar-nav .nav-link.onboarding-pulse {
    border-radius: 6px;
    margin: 0 2px;
}