/* ============================================
   Shepherd.js Tour Custom Styles
   CAPAVIDA Onboarding Tours
   ============================================ */

/* Tour Modal Base Styles */
.shepherd-element {
    max-width: 400px;
    z-index: 10000 !important;
}

.shepherd-modal-overlay-container {
    z-index: 9999 !important;
}

/* Tour Content Styles */
.shepherd-content {
    /*border-radius: 12px;*/
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: none;
    overflow: hidden;
}

.shepherd-header {
    background: #1a5928 !important;
    /*border-radius: 12px 12px 0 0;*/
    padding: 16px 20px;
}

.shepherd-title {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.shepherd-cancel-icon {
    color: #ffffff !important;
    opacity: 0.9;
    font-size: 1.5rem;
    transition: opacity 0.2s;
}

.shepherd-cancel-icon:hover {
    opacity: 1;
}

.shepherd-text {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.shepherd-text p {
    margin-bottom: 10px;
}

.shepherd-text p:last-child {
    margin-bottom: 0;
}

/* Tour Footer & Buttons */
.shepherd-footer {
    padding: 12px 20px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shepherd-button {
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shepherd-button-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.shepherd-button-primary:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.shepherd-button-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.shepherd-button-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

/* Arrow Styles */
.shepherd-arrow,
.shepherd-arrow:before {
    position: absolute;
    width: 16px;
    height: 16px;
    background: inherit;
}

.shepherd-arrow {
    visibility: hidden;
}

.shepherd-arrow:before {
    visibility: visible;
    content: '';
    transform: rotate(45deg);
    background: #fff;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.04);
}

.shepherd-element[data-popper-placement^='top'] > .shepherd-arrow {
    bottom: -8px;
}

.shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow {
    top: -8px;
}

.shepherd-element[data-popper-placement^='left'] > .shepherd-arrow {
    right: -8px;
}

.shepherd-element[data-popper-placement^='right'] > .shepherd-arrow {
    left: -8px;
}

/* Progress Indicator */
.tour-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.tour-progress-bar {
    width: 60px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ============================================
   Tour FAB (Floating Action Button) Styles
   ============================================ */

.tour-fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
}

/* RTL Support */
[dir="rtl"] .tour-fab-container {
    right: auto;
    left: 24px;
}

.tour-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.5rem;
}

.tour-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.5);
}

.tour-fab:active {
    transform: scale(0.95);
}

.tour-fab:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3), 0 4px 20px rgba(40, 167, 69, 0.4);
}

/* FAB Icon Animation */
.tour-fab i {
    transition: transform 0.3s ease;
}

.tour-fab:hover i {
    transform: rotate(15deg);
}

/* FAB Tooltip */
.tour-fab-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

[dir="rtl"] .tour-fab-tooltip {
    right: auto;
    left: 70px;
}

.tour-fab-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

[dir="rtl"] .tour-fab-tooltip::after {
    right: auto;
    left: -6px;
    border-color: transparent #333 transparent transparent;
}

.tour-fab-container:hover .tour-fab-tooltip {
    opacity: 1;
    visibility: visible;
}

/* FAB Menu (for multiple tours) */
.tour-fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

[dir="rtl"] .tour-fab-menu {
    right: auto;
    left: 0;
}

.tour-fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tour-fab-menu-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.tour-fab-menu-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.tour-fab-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    color: #555;
    font-size: 0.9rem;
}

.tour-fab-menu-item:hover {
    background: #f8f9fa;
    color: #28a745;
}

.tour-fab-menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.tour-fab-menu-item.completed {
    color: #adb5bd;
}

.tour-fab-menu-item.completed::after {
    content: '?';
    margin-left: auto;
    color: #28a745;
    font-weight: bold;
}

[dir="rtl"] .tour-fab-menu-item.completed::after {
    margin-left: 0;
    margin-right: auto;
}

/* ============================================
   Tour Welcome Modal Styles
   ============================================ */

.tour-welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tour-welcome-modal.active {
    opacity: 1;
    visibility: visible;
}

.tour-welcome-content {
    background: #fff;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    padding: 32px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tour-welcome-modal.active .tour-welcome-content {
    transform: scale(1);
}

.tour-welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    color: #fff;
}

.tour-welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.tour-welcome-text {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.tour-welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tour-welcome-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

.tour-welcome-btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.tour-welcome-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.tour-welcome-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.tour-welcome-btn-secondary:hover {
    background: #e9ecef;
}

.tour-welcome-skip {
    margin-top: 16px;
    color: #adb5bd;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.tour-welcome-skip:hover {
    color: #6c757d;
}

/* ============================================
   Highlighted Element Styles
   ============================================ */

.shepherd-target-highlight {
    position: relative;
    z-index: 9998 !important;
}

.shepherd-modal-is-visible .shepherd-target {
    pointer-events: auto !important;
}

/* Pulse animation for highlighted elements */
@keyframes tour-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.tour-highlight-pulse {
    animation: tour-pulse 2s infinite;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .shepherd-element {
        max-width: calc(100vw - 32px);
    }

    .tour-fab-container {
        bottom: 16px;
        right: 16px;
    }

    [dir="rtl"] .tour-fab-container {
        right: auto;
        left: 16px;
    }

    .tour-fab {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .tour-fab-tooltip {
        display: none;
    }

    .tour-fab-menu {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    [dir="rtl"] .tour-fab-menu {
        right: auto;
        left: 0;
    }

    .tour-welcome-content {
        padding: 24px;
    }

    .tour-welcome-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .tour-welcome-title {
        font-size: 1.25rem;
    }

    .tour-welcome-actions {
        flex-direction: column;
    }
}

/* ============================================
   Theme Variants
   ============================================ */

/* Admin Theme */
.tour-theme-admin .shepherd-header {
    background: linear-gradient(135deg, #696cff 0%, #8b8eff 100%);
}

.tour-theme-admin .shepherd-button-primary {
    background: linear-gradient(135deg, #696cff 0%, #8b8eff 100%);
}

.tour-theme-admin .shepherd-button-primary:hover {
    background: linear-gradient(135deg, #5f61e6 0%, #7c7fe6 100%);
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3);
}

.tour-theme-admin .tour-fab {
    background: linear-gradient(135deg, #696cff 0%, #8b8eff 100%);
    box-shadow: 0 4px 20px rgba(105, 108, 255, 0.4);
}

.tour-theme-admin .tour-fab:hover {
    box-shadow: 0 6px 25px rgba(105, 108, 255, 0.5);
}

.tour-theme-admin .tour-welcome-icon,
.tour-theme-admin .tour-welcome-btn-primary {
    background: linear-gradient(135deg, #696cff 0%, #8b8eff 100%);
}

.tour-theme-admin .tour-progress-fill {
    background: linear-gradient(135deg, #696cff 0%, #8b8eff 100%);
}

/* Employer Theme */
.tour-theme-employer .shepherd-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
}

.tour-theme-employer .shepherd-button-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
}

.tour-theme-employer .tour-fab {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .shepherd-content {
        background: #2b2c40;
    }

    .shepherd-text {
        color: #d5d7e3;
    }

    .shepherd-footer {
        border-top-color: #444564;
    }

    .shepherd-button-secondary {
        background: #444564;
        color: #d5d7e3;
        border-color: #5a5c7c;
    }

    .shepherd-arrow:before {
        background: #2b2c40;
    }

    .tour-fab-menu {
        background: #2b2c40;
    }

    .tour-fab-menu-header {
        color: #d5d7e3;
        border-bottom-color: #444564;
    }

    .tour-fab-menu-item {
        color: #b4b7c9;
    }

    .tour-fab-menu-item:hover {
        background: #444564;
    }

    .tour-welcome-content {
        background: #2b2c40;
    }

    .tour-welcome-title {
        color: #d5d7e3;
    }

    .tour-welcome-text {
        color: #b4b7c9;
    }
}
