/* Custom Shepherd.js Tour Styles for Filament with Glass Blur Effect */

/* ==================== CSS Variables for Customization ==================== */
:root {
    --tour-header-color: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --tour-primary-btn-color: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --tour-primary-btn-hover: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    --tour-secondary-btn-color: linear-gradient(135deg, rgba(243, 244, 246, 0.95) 0%, rgba(229, 231, 235, 0.9) 100%);
    --tour-secondary-btn-hover: linear-gradient(135deg, rgba(229, 231, 235, 1) 0%, rgba(209, 213, 219, 0.95) 100%);
    --tour-text-color: #1f2937;
    --tour-background-color: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 250, 251, 0.90) 100%);
    --tour-content-bg-color: transparent;
    --tour-footer-bg-color: transparent;
    --tour-primary-btn-text: #ffffff;
    --tour-secondary-btn-text: #1f2937;
    --tour-footer-border: rgba(0, 0, 0, 0.05);
}

/* ==================== Tour Theme Customization ==================== */
.shepherd-theme-custom {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 420px;
    
    /* Enhanced Glass Blur Effect */
    background: var(--tour-background-color, linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 250, 251, 0.90) 100%));
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dark mode support for glass effect */
@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom {
        background: linear-gradient(135deg, 
            rgba(31, 41, 55, 0.92) 0%, 
            rgba(17, 24, 39, 0.90) 100%);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
}

.shepherd-theme-custom .shepherd-content {
    border-radius: 16px;
    padding: 0;
    font-family: inherit;
    background: transparent;
}

.shepherd-theme-custom .shepherd-header {
    padding: 1.75rem 1.75rem 0.75rem;
    /* Customizable Header Color */
    background: var(--tour-header-color, linear-gradient(135deg, #f59e0b 0%, #f97316 100%)) !important;
    position: relative;
    overflow: hidden;
}

/* Add decorative pattern to header */
.shepherd-theme-custom .shepherd-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.shepherd-theme-custom .shepherd-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    margin: 0;
    padding: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.shepherd-theme-custom .shepherd-cancel-icon {
    color: white;
    opacity: 0.9;
    transition: all 0.2s ease;
    font-size: 1.5rem;
    font-weight: 300;
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.shepherd-theme-custom .shepherd-cancel-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.shepherd-theme-custom .shepherd-text {
    padding: 1.75rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--tour-text-color, #1f2937);
    direction: rtl;
    text-align: right;
    background: var(--tour-content-bg-color, transparent);
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-text {
        color: #e5e7eb;
    }
}

.shepherd-theme-custom .shepherd-text p {
    margin: 0;
}

.shepherd-theme-custom .shepherd-text strong {
    color: #111827;
    font-weight: 700;
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-text strong {
        color: #f9fafb;
    }
}

.shepherd-theme-custom .shepherd-footer {
    padding: 1.25rem 1.75rem 1.75rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.875rem;
    direction: rtl;
    background: var(--tour-footer-bg-color, linear-gradient(180deg, 
        rgba(249, 250, 251, 0.4) 0%, 
        rgba(255, 255, 255, 0.6) 100%));
    border-top: 1px solid var(--tour-footer-border, rgba(0, 0, 0, 0.05));
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-footer {
        background: var(--tour-footer-bg-color, linear-gradient(180deg, 
            rgba(17, 24, 39, 0.3) 0%, 
            rgba(31, 41, 55, 0.4) 100%));
        border-top: 1px solid var(--tour-footer-border, rgba(255, 255, 255, 0.05));
    }
}

.shepherd-theme-custom .shepherd-button {
    /* Customizable Primary Button */
    background: var(--tour-primary-btn-color, linear-gradient(135deg, #f59e0b 0%, #f97316 100%));
    color: var(--tour-primary-btn-text, #ffffff);
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25),
                0 2px 4px rgba(245, 158, 11, 0.15);
    position: relative;
    overflow: hidden;
}

.shepherd-theme-custom .shepherd-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shepherd-theme-custom .shepherd-button:hover {
    background: var(--tour-primary-btn-hover, linear-gradient(135deg, #ea580c 0%, #dc2626 100%));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35),
                0 4px 8px rgba(245, 158, 11, 0.2);
}

.shepherd-theme-custom .shepherd-button:hover::before {
    opacity: 1;
}

.shepherd-theme-custom .shepherd-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.shepherd-theme-custom .shepherd-button-secondary {
    /* Customizable Secondary Button */
    background: var(--tour-secondary-btn-color, linear-gradient(135deg, rgba(243, 244, 246, 0.95) 0%, rgba(229, 231, 235, 0.9) 100%));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--tour-secondary-btn-text, #374151);
    border: 1px solid rgba(209, 213, 219, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-button-secondary {
        background: var(--tour-secondary-btn-color, linear-gradient(135deg, 
            rgba(55, 65, 81, 0.9) 0%, 
            rgba(31, 41, 55, 0.85) 100%));
        color: var(--tour-secondary-btn-text, #d1d5db);
        border: 1px solid rgba(75, 85, 99, 0.5);
    }
}

.shepherd-theme-custom .shepherd-button-secondary:hover {
    background: var(--tour-secondary-btn-hover, linear-gradient(135deg, rgba(229, 231, 235, 1) 0%, rgba(209, 213, 219, 0.95) 100%));
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: rgba(156, 163, 175, 0.7);
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-button-secondary:hover {
        background: var(--tour-secondary-btn-hover, linear-gradient(135deg, 
            rgba(75, 85, 99, 0.95) 0%, 
            rgba(55, 65, 81, 0.9) 100%));
        color: var(--tour-secondary-btn-text, #f3f4f6);
        border-color: rgba(107, 114, 128, 0.7);
    }
}

/* ==================== Modal Overlay with Glass Blur ==================== */
.shepherd-modal-overlay-container {
    z-index: 9998;
    backdrop-filter: blur(4px) brightness(0.7);
    -webkit-backdrop-filter: blur(4px) brightness(0.7);
    background: rgba(0, 0, 0, 0.3);
}

.shepherd-modal-overlay-container.shepherd-modal-is-visible {
    transition: opacity 0.3s ease;
}

.shepherd-element {
    z-index: 9999;
    right: 28%;
}

/* ==================== Arrow Styling ==================== */
.shepherd-theme-custom .shepherd-arrow {
    width: 18px;
    height: 18px;
}

.shepherd-theme-custom .shepherd-arrow:before {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
    .shepherd-theme-custom .shepherd-arrow:before {
        background: rgba(31, 41, 55, 0.85);
    }
}

/* ==================== Target Element Highlight ==================== */
.shepherd-target {
    outline: 3px solid #f59e0b;
    outline-offset: 8px;
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25),
                0 0 24px rgba(245, 158, 11, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Animations ==================== */
@keyframes shepherd-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.shepherd-theme-custom.shepherd-element.shepherd-open {
    animation: shepherd-fadein 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shepherd-fadein {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== RTL Support ==================== */
.shepherd-theme-custom[dir="rtl"] .shepherd-footer {
    flex-direction: row-reverse;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 640px) {
    .shepherd-theme-custom {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }

    .shepherd-theme-custom .shepherd-text {
        font-size: 0.95rem;
        padding: 1.25rem;
        line-height: 1.6;
    }

    .shepherd-theme-custom .shepherd-header {
        padding: 1.25rem 1.25rem 0.5rem;
        background: linear-gradient(135deg, #009688, #009688) !important;
    }

    .shepherd-theme-custom .shepherd-title {
        font-size: 1.1rem;
    }

    .shepherd-theme-custom .shepherd-footer {
        padding: 0 1.25rem 1.25rem;
        flex-direction: column;
    }

    .shepherd-theme-custom .shepherd-button {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }
}

/* ==================== Tour Button Styling ==================== */
[data-shepherd-tour-trigger] {
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-shepherd-tour-trigger]:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

[data-shepherd-tour-trigger]:active {
    transform: scale(0.98);
}

/* ==================== Progress Indicator (Optional) ==================== */
.shepherd-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}

.shepherd-progress-bar {
    height: 100%;
    background: white;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==================== Special Step Styling ==================== */
/* Welcome Step - Purple/Pink gradient */
#shepherd-step-welcome .shepherd-header {
    background: linear-gradient(135deg, 
        #8b5cf6 0%, 
        #ec4899 100%) !important;
}

#shepherd-step-welcome .shepherd-header::before {
    background-image: 
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

/* Finish Step - Green success */
#shepherd-step-finish .shepherd-header,
#shepherd-step-complete .shepherd-header {
    background: linear-gradient(135deg, 
        #10b981 0%, 
        #059669 100%) !important;
}

#shepherd-step-finish .shepherd-header::before,
#shepherd-step-complete .shepherd-header::before {
    background-image: 
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

/* Error Step - Red warning */
#shepherd-step-error .shepherd-header,
#shepherd-step-no-steps .shepherd-header {
    background: linear-gradient(135deg, 
        #ef4444 0%, 
        #dc2626 100%) !important;
}

#shepherd-step-error .shepherd-header::before,
#shepherd-step-no-steps .shepherd-header::before {
    background-image: 
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

/* ==================== Loading State ==================== */
.shepherd-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: shepherd-spin 0.8s linear infinite;
}

/* ==================== Pulse Animation for Highlight ==================== */
@keyframes shepherd-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25),
                    0 0 24px rgba(245, 158, 11, 0.15),
                    0 0 0 1px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.4),
                    0 0 32px rgba(245, 158, 11, 0.25),
                    0 0 0 1px rgba(255, 255, 255, 0.7);
    }
}

.shepherd-target {
    animation: shepherd-pulse 2.5s ease-in-out infinite;
}

/* ==================== Accessibility ==================== */
.shepherd-theme-custom:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.shepherd-theme-custom .shepherd-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ==================== Print Styles ==================== */
@media print {
    .shepherd-theme-custom,
    .shepherd-modal-overlay-container {
        display: none !important;
    }
}

/* ==================== Resource Tour Highlight Pulse ==================== */
@keyframes shepherd-highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 150, 136, 0.7),
                    0 0 20px rgba(0, 150, 136, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 150, 136, 0),
                    0 0 30px rgba(0, 150, 136, 0.5);
        transform: scale(1.02);
    }
}

.shepherd-highlight-pulse {
    animation: shepherd-highlight-pulse 2s ease-in-out infinite !important;
    border-radius: 8px;
    position: relative;
    z-index: 10000;
}

/* Add glow effect for dark mode */
@media (prefers-color-scheme: dark) {
    @keyframes shepherd-highlight-pulse {
        0%, 100% {
            box-shadow: 0 0 0 0 rgba(0, 200, 183, 0.7),
                        0 0 20px rgba(0, 200, 183, 0.4);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 0 10px rgba(0, 200, 183, 0),
                        0 0 30px rgba(0, 200, 183, 0.6);
            transform: scale(1.02);
        }
    }
}

/* ==================== Hide Original Filament Active State During Tour ==================== */
.tour-original-active,
.tour-original-active.fi-sidebar-item,
.tour-original-active.fi-sidebar-group-item,
a.tour-original-active,
button.tour-original-active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.tour-original-active span,
.tour-original-active .fi-sidebar-item-label,
.tour-original-active .fi-sidebar-group-label {
    color: inherit !important;
    font-weight: 400 !important;
}

.tour-original-active svg,
.tour-original-active .fi-sidebar-item-icon {
    color: inherit !important;
}

/* ==================== Active Navigation Item Highlighting During Tour ==================== */
.shepherd-tour-active-nav,
.shepherd-tour-active-nav.fi-sidebar-item,
.shepherd-tour-active-nav.fi-sidebar-group-item,
a.shepherd-tour-active-nav,
button.shepherd-tour-active-nav {
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.2) 0%, 
        rgba(249, 115, 22, 0.15) 100%) !important;
    border-right: 4px solid #f59e0b !important;
    box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.15),
                0 4px 12px rgba(245, 158, 11, 0.2) !important;
    transform: translateX(-2px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    animation: shepherd-nav-pulse 2s ease-in-out infinite !important;
}

.shepherd-tour-active-nav span,
.shepherd-tour-active-nav .fi-sidebar-item-label,
.shepherd-tour-active-nav .fi-sidebar-group-label {
    color: #f59e0b !important;
    font-weight: 700 !important;
}

.shepherd-tour-active-nav svg,
.shepherd-tour-active-nav .fi-sidebar-item-icon {
    color: #f59e0b !important;
}

@keyframes shepherd-nav-pulse {
    0%, 100% {
        box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.15),
                    0 4px 12px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: inset 0 0 25px rgba(245, 158, 11, 0.2),
                    0 6px 16px rgba(245, 158, 11, 0.3);
    }
}

