/**
 * Tour Guide Styles - أنماط نظام الإرشادات التفاعلي
 */

/* ============================================
   المتغيرات
   ============================================ */
:root {
    --tour-primary: #dc2626;
    --tour-primary-hover: #b91c1c;
    --tour-primary-light: #fef2f2;
    --tour-secondary: #64748b;
    --tour-success: #10b981;
    --tour-warning: #f59e0b;
    --tour-danger: #ef4444;
    --tour-dark: #1e293b;
    --tour-light: #f8fafc;
    --tour-overlay: rgba(0, 0, 0, 0.75);
    --tour-shadow: 0 25px 50px -12px rgba(220, 38, 38, 0.25);
    --tour-border-radius: 16px;
    --tour-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Body عند تفعيل الجولة
   ============================================ */
body.tour-active {
    overflow: hidden;
}

/* ============================================
   Overlay - طبقة التعتيم
   ============================================ */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tour-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tour-overlay[style*="display: none"] {
    display: none !important;
}

.tour-overlay-top,
.tour-overlay-left,
.tour-overlay-right,
.tour-overlay-bottom {
    position: fixed;
    background: var(--tour-overlay);
    transition: var(--tour-transition);
}

.tour-overlay-top {
    top: 0;
    left: 0;
    width: 100%;
}

.tour-overlay-left {
    left: 0;
}

.tour-overlay-right {
    right: 0;
}

.tour-overlay-bottom {
    left: 0;
    width: 100%;
    bottom: 0;
    height: auto;
}

/* ============================================
   Modal - النافذة المنبثقة
   ============================================ */
.tour-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--tour-transition);
}

.tour-modal.active {
    opacity: 1;
    visibility: visible;
}

.tour-modal[style*="display: none"] {
    display: none !important;
}

.tour-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tour-overlay);
    backdrop-filter: blur(8px);
}

.tour-modal-content {
    position: relative;
    background: linear-gradient(145deg, #ffffff, #fff5f5);
    border-radius: var(--tour-border-radius);
    padding: 2.5rem;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--tour-shadow);
    transform: scale(0.9) translateY(20px);
    transition: var(--tour-transition);
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.tour-modal.active .tour-modal-content {
    transform: scale(1) translateY(0);
}

/* Dark mode */
.dark .tour-modal-content {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: rgba(255, 255, 255, 0.1);
}

.tour-modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--tour-primary), #f97316);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 40px -10px var(--tour-primary);
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px -10px var(--tour-primary);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px -10px var(--tour-primary);
    }
}

.tour-modal-icon i {
    font-size: 2rem;
    color: white;
}

.tour-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tour-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.dark .tour-modal-title {
    color: white;
}

.tour-modal-description {
    font-size: 1rem;
    color: var(--tour-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tour-modal-description ul,
.tour-modal-description ol {
    margin: 0.5rem 0;
    padding-right: 1rem;
}

.tour-modal-description li {
    margin-bottom: 0.25rem;
}

.tour-modal-description p {
    margin-bottom: 0.5rem;
}

.tour-modal-description .grid {
    display: grid;
}

.tour-modal-description .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tour-modal-description .gap-2 {
    gap: 0.5rem;
}

.tour-modal-description .space-y-1 > * + * {
    margin-top: 0.25rem;
}

.tour-modal-description .space-y-2 > * + * {
    margin-top: 0.5rem;
}

.tour-modal-description .space-y-3 > * + * {
    margin-top: 0.75rem;
}

.tour-modal-description .bg-gray-100 {
    background-color: #f3f4f6;
}

.tour-modal-description .bg-gradient-to-r {
    background: linear-gradient(to right, var(--tw-gradient-stops));
}

.tour-modal-description .from-red-50 {
    --tw-gradient-from: #fef2f2;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(254, 242, 242, 0));
}

.tour-modal-description .to-orange-50 {
    --tw-gradient-to: #fff7ed;
}

.tour-modal-description .p-2,
.tour-modal-description .p-3 {
    padding: 0.5rem;
}

.tour-modal-description .rounded,
.tour-modal-description .rounded-lg {
    border-radius: 0.375rem;
}

.tour-modal-description .text-sm {
    font-size: 0.875rem;
}

.tour-modal-description .text-xs {
    font-size: 0.75rem;
}

.tour-modal-description .font-semibold {
    font-weight: 600;
}

.tour-modal-description .flex {
    display: flex;
}

.tour-modal-description .items-center {
    align-items: center;
}

.tour-modal-description .gap-1 {
    gap: 0.25rem;
}

.tour-modal-description .w-6 {
    width: 1.5rem;
}

.tour-modal-description .text-red-500 {
    color: var(--tour-primary);
}

.tour-modal-description .text-red-600 {
    color: #dc2626;
}

.tour-modal-description .text-blue-500 {
    color: #3b82f6;
}

.tour-modal-description .text-green-500 {
    color: #22c55e;
}

.tour-modal-description .text-yellow-500 {
    color: #eab308;
}

.tour-modal-description .text-purple-500 {
    color: #a855f7;
}

.tour-modal-description .opacity-75 {
    opacity: 0.75;
}

.tour-modal-description .opacity-90 {
    opacity: 0.9;
}

.tour-modal-description .mt-2 {
    margin-top: 0.5rem;
}

.tour-modal-description .mt-4 {
    margin-top: 1rem;
}

.tour-modal-description .mb-2 {
    margin-bottom: 0.5rem;
}

.tour-modal-description .list-disc {
    list-style-type: disc;
}

.tour-modal-description .list-inside {
    list-style-position: inside;
}

.dark .tour-modal-description {
    color: #94a3b8;
}

.dark .tour-modal-description .bg-gray-100,
.dark .tour-modal-description .bg-gray-700 {
    background-color: #374151;
}

.dark .tour-modal-description .from-red-50 {
    --tw-gradient-from: rgba(220, 38, 38, 0.1);
}

.dark .tour-modal-description .to-orange-50 {
    --tw-gradient-to: rgba(249, 115, 22, 0.1);
}

.dark .tour-modal-description .text-red-400 {
    color: #f87171;
}

/* ============================================
   Progress Bar - شريط التقدم
   ============================================ */
.tour-modal-progress,
.tour-tooltip-progress {
    margin-bottom: 1.5rem;
}

.tour-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dark .tour-progress-bar {
    background: #334155;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tour-primary), #f97316);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.tour-progress-text {
    font-size: 0.875rem;
    color: var(--tour-secondary);
    font-weight: 500;
}

.dark .tour-progress-text {
    color: #94a3b8;
}

/* Progress Dots */
.tour-progress-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tour-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: var(--tour-transition);
}

.dark .tour-progress-dot {
    background: #334155;
}

.tour-progress-dot.active {
    background: var(--tour-primary);
    transform: scale(1.3);
}

.tour-progress-dot.completed {
    background: var(--tour-success);
}

/* ============================================
   Buttons - الأزرار
   ============================================ */
.tour-modal-buttons,
.tour-tooltip-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--tour-transition);
    text-decoration: none;
}

.tour-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.tour-btn-primary {
    background: linear-gradient(135deg, var(--tour-primary), #b91c1c);
    color: white;
    box-shadow: 0 4px 15px -3px var(--tour-primary);
}

.tour-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px var(--tour-primary);
}

.tour-btn-secondary {
    background: #e2e8f0;
    color: var(--tour-dark);
}

.dark .tour-btn-secondary {
    background: #334155;
    color: white;
}

.tour-btn-secondary:hover {
    background: #cbd5e1;
}

.dark .tour-btn-secondary:hover {
    background: #475569;
}

.tour-btn-outline {
    background: transparent;
    color: var(--tour-secondary);
    border: 2px solid #e2e8f0;
}

.dark .tour-btn-outline {
    border-color: #334155;
    color: #94a3b8;
}

.tour-btn-outline:hover {
    background: #f8fafc;
    border-color: var(--tour-primary);
    color: var(--tour-primary);
}

.dark .tour-btn-outline:hover {
    background: #1e293b;
}

/* Skip Button */
.tour-skip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--tour-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--tour-transition);
}

.tour-skip-btn:hover {
    color: var(--tour-danger);
}

/* ============================================
   Tooltip - التلميحات
   ============================================ */
.tour-tooltip {
    position: fixed;
    z-index: 9999;
    background: white;
    border-radius: var(--tour-border-radius);
    padding: 1.5rem;
    max-width: 380px;
    width: calc(100vw - 40px);
    box-shadow: var(--tour-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--tour-transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tour-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tour-tooltip[style*="display: none"] {
    display: none !important;
}

.dark .tour-tooltip {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Tooltip Arrow */
.tour-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .tour-tooltip-arrow {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

.tour-tooltip[data-position="bottom"] .tour-tooltip-arrow {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    border-right: none;
    border-bottom: none;
}

.tour-tooltip[data-position="top"] .tour-tooltip-arrow {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    border-left: none;
    border-top: none;
}

.tour-tooltip[data-position="left"] .tour-tooltip-arrow {
    right: -8px;
    top: 50%;
    margin-top: -8px;
    border-left: none;
    border-bottom: none;
}

.tour-tooltip[data-position="right"] .tour-tooltip-arrow {
    left: -8px;
    top: 50%;
    margin-top: -8px;
    border-right: none;
    border-top: none;
}

/* Tooltip Header */
.tour-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tour-tooltip-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--tour-primary), #f97316);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tour-tooltip-icon i {
    font-size: 1rem;
    color: white;
}

.tour-tooltip-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--tour-dark);
    margin: 0;
    line-height: 1.3;
}

.dark .tour-tooltip-title {
    color: white;
}

.tour-tooltip-description {
    font-size: 0.875rem;
    color: var(--tour-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tour-tooltip-description ul,
.tour-tooltip-description ol {
    margin: 0.5rem 0;
    padding-right: 0.75rem;
}

.tour-tooltip-description li {
    margin-bottom: 0.25rem;
}

.tour-tooltip-description p {
    margin-bottom: 0.5rem;
}

.tour-tooltip-description .grid {
    display: grid;
}

.tour-tooltip-description .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tour-tooltip-description .gap-2 {
    gap: 0.5rem;
}

.tour-tooltip-description .space-y-1 > * + * {
    margin-top: 0.25rem;
}

.tour-tooltip-description .space-y-2 > * + * {
    margin-top: 0.5rem;
}

.tour-tooltip-description .text-sm {
    font-size: 0.8125rem;
}

.tour-tooltip-description .text-xs {
    font-size: 0.75rem;
}

.tour-tooltip-description .flex {
    display: flex;
}

.tour-tooltip-description .items-center {
    align-items: center;
}

.tour-tooltip-description .gap-1 {
    gap: 0.25rem;
}

.tour-tooltip-description .text-red-500 {
    color: var(--tour-primary);
}

.tour-tooltip-description .text-blue-500 {
    color: #3b82f6;
}

.tour-tooltip-description .text-green-500 {
    color: #22c55e;
}

.tour-tooltip-description .text-purple-500 {
    color: #a855f7;
}

.tour-tooltip-description .opacity-75 {
    opacity: 0.75;
}

.tour-tooltip-description .opacity-90 {
    opacity: 0.9;
}

.tour-tooltip-description .mt-2 {
    margin-top: 0.5rem;
}

.dark .tour-tooltip-description {
    color: #94a3b8;
}

.tour-tooltip-progress {
    margin-bottom: 1rem;
}

/* ============================================
   Highlighted Element - العنصر المبرز
   ============================================ */
.tour-highlighted {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px var(--tour-primary), 0 0 0 8px rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    animation: highlight-pulse 2s infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px var(--tour-primary), 0 0 0 8px rgba(220, 38, 38, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px var(--tour-primary), 0 0 0 16px rgba(220, 38, 38, 0.1);
    }
}

/* ============================================
   Restart Tour Button - زر إعادة الجولة
   ============================================ */
.restart-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--tour-primary);
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--tour-transition);
}

.restart-tour-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: var(--tour-primary);
}

/* ============================================
   Responsive - التجاوب
   ============================================ */
@media (max-width: 640px) {
    .tour-modal-content {
        padding: 1.5rem;
        max-width: 95%;
    }
    
    .tour-modal-icon {
        width: 60px;
        height: 60px;
    }
    
    .tour-modal-icon i {
        font-size: 1.5rem;
    }
    
    .tour-modal-title {
        font-size: 1.5rem;
    }
    
    .tour-modal-description {
        font-size: 1rem;
    }
    
    .tour-tooltip {
        max-width: calc(100vw - 20px);
        padding: 1rem;
    }
    
    .tour-tooltip-title {
        font-size: 1rem;
    }
    
    .tour-tooltip-description {
        font-size: 0.875rem;
    }
    
    .tour-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .tour-modal-buttons {
        flex-direction: column;
    }
    
    .tour-tooltip-buttons {
        flex-wrap: wrap;
    }
    
    .tour-progress-dots {
        max-width: 200px;
        margin: 0 auto 0.5rem;
    }
}

/* ============================================
   Animations - الحركات
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   RTL Support - دعم اللغة العربية
   ============================================ */
[dir="rtl"] .tour-btn i.fa-arrow-left {
    transform: scaleX(-1);
}

[dir="rtl"] .tour-btn i.fa-arrow-right {
    transform: scaleX(-1);
}

[dir="rtl"] .tour-tooltip-header {
    flex-direction: row;
}

[dir="rtl"] .tour-modal-buttons,
[dir="rtl"] .tour-tooltip-buttons {
    flex-direction: row-reverse;
}

@media (max-width: 640px) {
    [dir="rtl"] .tour-modal-buttons {
        flex-direction: column;
    }
}

