/* AI Tutor Tour Styles - Comprehensive tour styling with RTL and mobile support */

/* ========================================
   OVERLAY
   ======================================== */
.ai-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999998;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.ai-tour-overlay.fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* ========================================
   SPOTLIGHT EFFECT
   ======================================== */
.ai-tour-spotlight {
    position: relative;
    z-index: 999999 !important;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ai-tour-spotlight-pulse {
    animation: spotlightPulse 2s infinite;
}

@keyframes spotlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85), 0 0 20px rgba(117, 79, 254, 0.5);
    }
}

/* ========================================
   TOUR TOOLTIP
   ======================================== */
.ai-tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    z-index: 1000000;
    animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   TOOLTIP HEADER
   ======================================== */
.ai-tour-header {
    background: linear-gradient(135deg, #754ffe 0%, #5537e5 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    margin: -24px -24px 16px -24px;
}

.ai-tour-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

/* ========================================
   PROGRESS INDICATOR
   ======================================== */
.ai-tour-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    align-items: center;
}

.ai-tour-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.ai-tour-progress-dot.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.ai-tour-progress-dot.completed {
    background: rgba(255, 255, 255, 0.6);
}

/* ========================================
   TOOLTIP CONTENT
   ======================================== */
.ai-tour-content {
    padding: 4px 0;
}

.ai-tour-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.ai-tour-content p:not(:last-child) {
    margin-bottom: 12px;
}

/* ========================================
   NAVIGATION BUTTONS
   ======================================== */
.ai-tour-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.ai-tour-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.ai-tour-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-tour-btn:active {
    transform: translateY(0);
}

.ai-tour-btn-primary {
    background: linear-gradient(135deg, #754ffe 0%, #5537e5 100%);
    color: white;
}

.ai-tour-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(117, 79, 254, 0.4);
}

.ai-tour-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.ai-tour-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.ai-tour-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-tour-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ========================================
   TOOLTIP ARROW (OPTIONAL)
   ======================================== */
.ai-tour-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.ai-tour-tooltip[data-position="bottom"]::before {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent white transparent;
}

.ai-tour-tooltip[data-position="top"]::before {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: white transparent transparent transparent;
}

.ai-tour-tooltip[data-position="left"]::before {
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.ai-tour-tooltip[data-position="right"]::before {
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

/* ========================================
   KEYBOARD SHORTCUT HINTS
   ======================================== */
.ai-tour-keyboard-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.ai-tour-keyboard-hint kbd {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-family: monospace;
    font-size: 11px;
}

/* ========================================
   RTL OVERRIDES
   ======================================== */
[dir="rtl"] .ai-tour-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-tour-progress {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-tour-content p {
    text-align: right;
}

[dir="rtl"] .ai-tour-header h5 {
    text-align: right;
}

[dir="rtl"] .ai-tour-tooltip[data-position="left"]::before {
    right: auto;
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

[dir="rtl"] .ai-tour-tooltip[data-position="right"]::before {
    left: auto;
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

/* ========================================
   MOBILE RESPONSIVE (TABLETS)
   ======================================== */
@media (max-width: 768px) {
    .ai-tour-tooltip {
        max-width: 90%;
        left: 5% !important;
        right: 5% !important;
        padding: 20px;
    }

    .ai-tour-header {
        padding: 14px 16px;
        margin: -20px -20px 14px -20px;
    }

    .ai-tour-header h5 {
        font-size: 16px;
    }

    .ai-tour-content p {
        font-size: 14px;
    }

    .ai-tour-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .ai-tour-btn {
        width: 100%;
        padding: 12px 20px;
    }

    .ai-tour-tooltip::before {
        display: none; /* Hide arrows on mobile for better positioning */
    }
}

/* ========================================
   MOBILE RESPONSIVE (PHONES)
   ======================================== */
@media (max-width: 480px) {
    .ai-tour-tooltip {
        max-width: 95%;
        left: 2.5% !important;
        right: 2.5% !important;
        padding: 16px;
    }

    .ai-tour-header {
        padding: 12px 14px;
        margin: -16px -16px 12px -16px;
    }

    .ai-tour-header h5 {
        font-size: 15px;
    }

    .ai-tour-progress-dot {
        width: 6px;
        height: 6px;
    }

    .ai-tour-content p {
        font-size: 13px;
        line-height: 1.5;
    }

    .ai-tour-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    .ai-tour-keyboard-hint {
        display: none; /* Hide keyboard hints on mobile */
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.ai-tour-btn:focus {
    outline: 2px solid #754ffe;
    outline-offset: 2px;
}

.ai-tour-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only content */
.ai-tour-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .ai-tour-overlay,
    .ai-tour-tooltip,
    .ai-tour-spotlight {
        display: none !important;
    }
}

/* ========================================
   ANIMATIONS - REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .ai-tour-overlay,
    .ai-tour-tooltip,
    .ai-tour-spotlight,
    .ai-tour-btn,
    .ai-tour-progress-dot {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   DARK MODE SUPPORT (FUTURE)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .ai-tour-tooltip {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .ai-tour-content p {
        color: #d1d5db;
    }

    .ai-tour-btn-secondary {
        background: #374151;
        color: #d1d5db;
    }

    .ai-tour-btn-secondary:hover {
        background: #4b5563;
        color: #f3f4f6;
    }

    .ai-tour-keyboard-hint {
        color: #6b7280;
        border-color: #374151;
    }

    .ai-tour-keyboard-hint kbd {
        background: #374151;
        border-color: #4b5563;
    }
}
