/* ═══════════════════════════════════════════════════════════════════
   Guided Introduction System — Fiscal Authority Blue+Gold Theme
   Overrides Bootstrap Tour popover styling for SkylinePOS
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tour Popover ── */
.popover.tour {
    max-width: 420px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(15, 27, 45, 0.25), 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
    z-index: 100100;
    overflow: visible;
}
.popover.tour .arrow {
    border-width: 12px;
}
.popover.tour.bottom .arrow::after,
.popover.tour.bottom > .arrow::after {
    border-bottom-color: #0f1b2d;
}
.popover.tour.top .arrow::after,
.popover.tour.top > .arrow::after {
    border-top-color: #fff;
}
.popover.tour.left .arrow::after,
.popover.tour.left > .arrow::after {
    border-left-color: #fff;
}
.popover.tour.right .arrow::after,
.popover.tour.right > .arrow::after {
    border-right-color: #fff;
}

/* ── Title Bar ── */
.popover.tour .popover-title {
    background: linear-gradient(135deg, #0f1b2d 0%, #1e3a5f 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 20px 14px;
    border-radius: 14px 14px 0 0;
    border-bottom: 3px solid #c9a84c;
    letter-spacing: -0.2px;
    position: relative;
}
.popover.tour .popover-title::before {
    content: '\f05a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #c9a84c;
    font-size: 15px;
}
/* RTL title icon */
html[dir="rtl"] .popover.tour .popover-title::before,
body.rtl .popover.tour .popover-title::before {
    margin-right: 0;
    margin-left: 10px;
}

/* ── Step Counter Badge ── */
.popover.tour .popover-title .sk-tour-step-badge {
    float: right;
    background: rgba(201, 168, 76, 0.2);
    color: #e8d48b;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    letter-spacing: 0.5px;
}
html[dir="rtl"] .popover.tour .popover-title .sk-tour-step-badge,
body.rtl .popover.tour .popover-title .sk-tour-step-badge {
    float: left;
}

/* ── Content Body ── */
.popover.tour .popover-content {
    padding: 18px 20px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    background: #fff;
}
.popover.tour .popover-content p {
    margin: 0 0 8px;
}
.popover.tour .popover-content .sk-tour-section-label {
    display: inline-block;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #1e3a5f;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.popover.tour .popover-content .sk-tour-tip {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
}
.popover.tour .popover-content .sk-tour-tip::before {
    content: '\f0eb';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #d97706;
}
html[dir="rtl"] .popover.tour .popover-content .sk-tour-tip::before,
body.rtl .popover.tour .popover-content .sk-tour-tip::before {
    margin-right: 0;
    margin-left: 8px;
}

/* ── Navigation Buttons ── */
.popover.tour .popover-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 14px 14px;
}
.popover.tour .popover-navigation [data-role="prev"] {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}
.popover.tour .popover-navigation [data-role="prev"]:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.popover.tour .popover-navigation [data-role="next"] {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}
.popover.tour .popover-navigation [data-role="next"]:hover {
    background: linear-gradient(135deg, #163050, #245080);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}
.popover.tour .popover-navigation [data-role="end"] {
    margin-left: auto;
    background: transparent;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}
html[dir="rtl"] .popover.tour .popover-navigation [data-role="end"],
body.rtl .popover.tour .popover-navigation [data-role="end"] {
    margin-left: 0;
    margin-right: auto;
}
.popover.tour .popover-navigation [data-role="end"]:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* ── Backdrop ── */
.tour-backdrop {
    background: rgba(15, 27, 45, 0.55) !important;
    z-index: 100000 !important;
}
.tour-step-background {
    z-index: 100001 !important;
    border-radius: 10px;
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.5), 0 0 24px rgba(201, 168, 76, 0.2);
}

/* ── Tour Launch Button (in page headers) ── */
.sk-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid rgba(201, 168, 76, 0.4);
    background: rgba(201, 168, 76, 0.12);
    color: #e8d48b;
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
    text-decoration: none;
}
.sk-tour-btn:hover {
    background: rgba(201, 168, 76, 0.25);
    border-color: #c9a84c;
    color: #fff;
    text-decoration: none;
}
.sk-tour-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.3);
}
.sk-tour-btn i {
    font-size: 14px;
    color: #c9a84c;
}
/* Treasury-style tour button (for expense page) */
.sk-tour-btn-treasury {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid rgba(79, 70, 229, 0.3);
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
}
.sk-tour-btn-treasury:hover {
    background: rgba(79, 70, 229, 0.15);
    border-color: #4f46e5;
    color: #3730a3;
}
.sk-tour-btn-treasury i { color: #4f46e5; }

/* ── Welcome Modal (forced intro) ── */
.sk-intro-welcome-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 27, 45, 0.7);
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sk-intro-fade-in 0.3s ease;
}
@keyframes sk-intro-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sk-intro-welcome-card {
    background: #fff;
    border-radius: 18px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: sk-intro-slide-up 0.35s ease;
}
@keyframes sk-intro-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.sk-intro-welcome-header {
    background: linear-gradient(135deg, #0f1b2d 0%, #1e3a5f 100%);
    padding: 28px 30px 22px;
    text-align: center;
    position: relative;
}
.sk-intro-welcome-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c9a84c, #e8d48b, #c9a84c);
}
.sk-intro-welcome-header .sk-intro-icon {
    width: 64px; height: 64px;
    background: rgba(201, 168, 76, 0.15);
    border: 2px solid rgba(201, 168, 76, 0.3);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #c9a84c;
    margin-bottom: 14px;
}
.sk-intro-welcome-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}
.sk-intro-welcome-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}
.sk-intro-welcome-body {
    padding: 24px 30px 28px;
    text-align: center;
}
.sk-intro-welcome-body p {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 20px;
}
.sk-intro-welcome-body .sk-intro-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #c9a84c, #e8d48b);
    color: #1e3a5f;
    border: none;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
}
.sk-intro-welcome-body .sk-intro-start-btn:hover {
    background: linear-gradient(135deg, #b8973f, #d4c170);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}
.sk-intro-welcome-body .sk-intro-skip-btn {
    display: block;
    margin: 12px auto 0;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 12px;
    transition: color 0.2s;
}
.sk-intro-welcome-body .sk-intro-skip-btn:hover {
    color: #6b7280;
}

/* ── Progress Bar in Tour ── */
.sk-tour-progress {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}
.sk-tour-progress-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.3s;
}
.sk-tour-progress-dot.active {
    background: #c9a84c;
    width: 20px;
    border-radius: 4px;
}
.sk-tour-progress-dot.done {
    background: #1e3a5f;
}

/* ── Non-blocking Intro Banner (first visit) ── */
.sk-intro-banner {
    background: linear-gradient(135deg, #0f1b2d 0%, #1e3a5f 100%);
    border-bottom: 3px solid #c9a84c;
    padding: 0;
    z-index: 1000;
    position: relative;
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
}
.sk-intro-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.sk-intro-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sk-intro-banner-icon {
    font-size: 20px;
    color: #c9a84c;
    width: 40px; height: 40px;
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sk-intro-banner-left strong {
    color: #fff;
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}
.sk-intro-banner-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    display: block;
}
.sk-intro-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sk-intro-banner-start {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #c9a84c, #e8d48b);
    color: #1e3a5f;
    border: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'saudi_riyal', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}
.sk-intro-banner-start:hover {
    background: linear-gradient(135deg, #b8973f, #d4c170);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}
.sk-intro-banner-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    line-height: 1;
}
.sk-intro-banner-dismiss:hover {
    color: #fff;
}

/* ── Print: hide everything tour-related ── */
@media print {
    .popover.tour,
    .tour-backdrop,
    .tour-step-background,
    .sk-tour-btn,
    .sk-tour-btn-treasury,
    .sk-intro-welcome-overlay,
    .sk-intro-banner {
        display: none !important;
    }
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .popover.tour {
        max-width: 300px;
    }
    .popover.tour .popover-title {
        font-size: 14px;
        padding: 12px 16px;
    }
    .popover.tour .popover-content {
        padding: 14px 16px;
        font-size: 13px;
    }
    .popover.tour .popover-navigation {
        padding: 10px 16px 14px;
    }
}
