/* Business Onboarding Tour Custom Styles */

/* Override Shepherd.js default styles to match app theme */
.shepherd-element {
    z-index: 10000 !important;
    max-width: 550px;
    width: auto;
    min-width: 300px;
}

/* Welcome step modal - wider and more flexible */
.shepherd-element.nok-tour-welcome-step {
    max-width: 600px;
    width: auto;
    min-width: 320px;
}

/* Center the header title on welcome step */
.nok-tour-welcome-step .shepherd-header {
    justify-content: center;
}

.nok-tour-welcome-step .shepherd-title {
    text-align: center;
    padding-right: 0;
}

.shepherd-element.shepherd-theme-mobile {
    max-width: 90vw;
}

/* Wider modal for steps with multiple buttons */
.shepherd-element.shepherd-wide-buttons {
    max-width: 600px;
    width: auto;
}

.shepherd-element.shepherd-wide-buttons.shepherd-theme-mobile {
    max-width: 90vw;
}

.shepherd-header {
    background: #ddf2f4 !important;
    color: #1D2324 !important;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Position X button to the right */
.shepherd-header .shepherd-cancel-icon {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: auto !important;
    order: 2 !important;
}

.shepherd-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #1D2324 !important;
    padding-right: 30px; /* Space for X button */
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.shepherd-text {
    padding: 1.25rem;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.shepherd-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shepherd-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

.shepherd-button-primary {
    background: #1B84FF;
    color: white;
}

.shepherd-button-primary:hover {
    background: #0d6efd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 132, 255, 0.4);
}

.shepherd-button-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.shepherd-button-secondary:hover {
    background: #edf2f7;
}

.shepherd-cancel-icon {
    color: #1D2324;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.shepherd-cancel-icon:hover {
    opacity: 1;
}

/* Welcome modal custom styles */
#onboardingWelcomeModal .modal-header {
    background: #ddf2f4 !important;
    color: #1D2324 !important;
    border-radius: 8px 8px 0 0;
}

#onboardingWelcomeModal .modal-title {
    font-weight: 600;
    font-size: 14px;
    color: #1D2324 !important;
}

#onboardingWelcomeModal .modal-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    margin: 1rem 0;
}

#onboardingWelcomeModal .modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

/* Highlighted element styles */
.shepherd-target-highlighted {
    box-shadow: 0 0 0 4px rgba(27, 132, 255, 0.3) !important;
    transition: box-shadow 0.3s ease;
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .shepherd-element {
        margin: 0.5rem;
        margin-bottom: 80px !important;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        max-width: 90vw !important;
        width: auto !important;
    }
    
    .shepherd-element.shepherd-wide-buttons,
    .shepherd-element.nok-tour-welcome-step {
        max-width: 90vw !important;
        width: auto !important;
    }
    
    /* Extra margin for steps that attach to bottom elements */
    .shepherd-element[data-popper-placement^="bottom"] {
        margin-bottom: 100px !important;
    }
    
    .shepherd-text {
        font-size: 14px;
        padding: 1rem;
    }
    
    .shepherd-button {
        padding: 0.5rem 1rem;
        font-size: 13px;
        white-space: normal;
    }
    
    .shepherd-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .shepherd-button {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    /* Stack buttons on mobile for welcome modal */
    .nok-tour-welcome-step .shepherd-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nok-tour-welcome-step .shepherd-footer .shepherd-button {
        width: 100%;
        flex: none;
        text-align: center;
    }
}

/* Dummy data indicator */
input[style*="background-color: rgb(255, 250, 205)"],
input[style*="background-color:#fffacd"] {
    border-left: 3px solid #f59e0b !important;
}

/* Animation for tour elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shepherd-element {
    animation: fadeInUp 0.3s ease-out;
}

/* Arrow styles */
.shepherd-arrow:before {
    background: white;
}

/* Make sure tooltips are readable on dark backgrounds */
.shepherd-element {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 1px rgba(255, 255, 255, 0.5);
}

.shepherd-header {
    background: #ddf2f4 !important;
    color: #1D2324 !important;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Pulse animation for important buttons during tour */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(27, 132, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(27, 132, 255, 0);
    }
}

.shepherd-target-highlighted {
    animation: pulse 2s infinite;
}

/* Tour skip popup styling */
.tour-skip-popup .swal2-header {
    background: #ddf2f4 !important;
    border-radius: 8px 8px 0 0;
}

.tour-skip-popup .swal2-title {
    color: #1D2324 !important;
}

.tour-skip-popup .swal2-icon.swal2-info {
    border-color: #1B84FF !important;
    color: #1B84FF !important;
}

/* ============================================
   Announcement Type Selection Modal Styles
   ============================================ */

/* Make the announcement type step large like a modal */
.shepherd-element.nok-tour-announcement-type-step {
    max-width: 800px;
    width: 90vw;
    min-width: 320px;
}

/* Center the header title on announcement type step */
.nok-tour-announcement-type-step .shepherd-header {
    justify-content: center;
}

.nok-tour-announcement-type-step .shepherd-title {
    text-align: center;
    padding-right: 0;
}

/* Container for the two options */
.nok-announcement-type-modal {
    padding: 1rem 0;
}

.announcement-options-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;
}

/* Individual option card */
.announcement-option {
    flex: 1;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 350px;
}

.announcement-option:hover {
    border-color: #3699ff;
    box-shadow: 0 8px 25px rgba(54, 153, 255, 0.15);
    transform: translateY(-4px);
}

/* Option icon */
.announcement-option .option-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e6f2ff 0%, #d1e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.announcement-option .option-icon i {
    font-size: 32px;
    color: #3699ff;
}

/* Option 2 (Full) special styling */
#option-full .option-icon {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe0e0 100%);
}

#option-full .option-icon i {
    color: #e84c88;
}

/* Option title */
.announcement-option .option-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

/* Option text */
.announcement-option .option-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6c757d;
    flex-grow: 1;
    margin-bottom: 0;
}

/* Deceased avatar image */
.announcement-option .deceased-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Deceased name display */
.announcement-option .deceased-display-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

/* Deceased full name (shown below AKA name if different) */
.announcement-option .deceased-full-name {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* Deceased dates display */
.announcement-option .deceased-dates {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Personalise title (second title in option-full) */
.announcement-option .option-title-personalise {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

/* FREE label */
.announcement-option .option-free-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

/* Ready to Share option - align text at bottom */
#option-basic {
    justify-content: flex-start;
}

#option-basic .option-text {
    margin-top: auto;
    flex-grow: 0;
}

/* Mobile: Stack options vertically and full screen */
@media (max-width: 767px) {
    .shepherd-element.nok-tour-announcement-type-step {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .shepherd-element.nok-tour-announcement-type-step .shepherd-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .shepherd-element.nok-tour-announcement-type-step .shepherd-text {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }
    
    .announcement-options-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0;
    }
    
    .announcement-option {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .announcement-option .option-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .announcement-option .option-icon i {
        font-size: 24px;
    }
    
    .announcement-option .option-title {
        font-size: 1.1rem;
    }
    
    .announcement-option .option-text {
        font-size: 0.9rem;
    }
}

/* Modal-anchored tour step - appears next to open modal */
.shepherd-element.nok-tour-modal-anchored-step {
    z-index: 1070 !important; /* Above Bootstrap modal backdrop (1050) and modal (1055) */
    max-width: 400px !important;
}

.shepherd-element.nok-tour-modal-anchored-step .shepherd-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.shepherd-element.nok-tour-modal-anchored-step .shepherd-header {
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.shepherd-element.nok-tour-modal-anchored-step .shepherd-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.shepherd-element.nok-tour-modal-anchored-step .shepherd-text {
    padding: 1.5rem;
    line-height: 1.6;
    color: #555;
}

.shepherd-element.nok-tour-modal-anchored-step .shepherd-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
}

/* Ensure shepherd elements appear above Bootstrap modal */
.modal.show ~ .shepherd-element,
.modal-backdrop.show ~ .shepherd-element {
    z-index: 1070 !important;
}

/* Hide shepherd's own modal overlay when Bootstrap modal is open */
.modal.show ~ .shepherd-modal-overlay-container {
    display: none !important;
}

/* Mobile: Position below or overlay the modal */
@media (max-width: 768px) {
    .shepherd-element.nok-tour-modal-anchored-step {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        transform: none !important;
    }
    
    .shepherd-element.nok-tour-modal-anchored-step .shepherd-content {
        border-radius: 20px 20px 0 0;
    }
    
    .shepherd-element.nok-tour-modal-anchored-step .shepherd-header {
        border-radius: 20px 20px 0 0;
    }
    
    .shepherd-element.nok-tour-modal-anchored-step .shepherd-arrow {
        display: none !important;
    }
}

/* Mini tour steps inside modals (relationship/photo prompts) */
.shepherd-element.nok-modal-mini-tour {
    z-index: 1070 !important; /* Above Bootstrap modal (1055) */
}

.shepherd-element.nok-modal-mini-tour .shepherd-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    max-width: 320px;
}

.shepherd-element.nok-modal-mini-tour .shepherd-header {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    padding: 0.75rem 1rem;
}

.shepherd-element.nok-modal-mini-tour .shepherd-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.shepherd-element.nok-modal-mini-tour .shepherd-text {
    padding: 1rem;
    line-height: 1.5;
    color: #555;
    font-size: 0.9rem;
}

.shepherd-element.nok-modal-mini-tour .shepherd-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
}

/* Section Help Icon - ? button for triggering single tour steps */
.section-help-btn {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-weight: bold;
    vertical-align: middle;
}
.section-help-btn:hover {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}
