/**
 * VMPFence Onboarding Overlay Styles
 *
 * Styles for the guided tour system that displays overlay cards
 * anchored to specific UI sections on plugin pages.
 *
 * @package VMPFence
 * @since 2.2.4
 */

/* ============================================
   Backdrop Overlay
   ============================================ */
.vmpfence-onboarding-backdrop {
    position: fixed;
    /* top, left, right, bottom set by JS to scope to #wpcontent */
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    animation: vmpfence-fadeIn 0.3s ease;
}

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

/* ============================================
   Highlighted Target Element - DISABLED
   ============================================ */
/* No highlighting - card arrow will point to target instead */

/* ============================================
   Onboarding Card
   ============================================ */
.vmpfence-onboarding-card {
    position: absolute;
    background: #ffffff;
    box-shadow: 1px 1px 2px 0px rgba(50,50,50,0.75);
    padding: 0;
    max-width: 750px;
    width: calc(100% - 40px);
    z-index: 100001;
    animation: vmpfence-slideIn 0.4s ease;
    /* Position will be set by JS */
}

@keyframes vmpfence-slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Header */
.vmpfence-onboarding-header {
    position: relative;
    text-align: center;
}

/* Close Button */
.vmpfence-onboarding-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-weight: 300;
}

.vmpfence-onboarding-close:hover {
    background: #f0f0f0;
    color: #666;
}

.vmpfence-onboarding-close:focus {
    outline: 1px solid #0073aa;
    outline-offset: 1px;
}

/* Title */
.vmpfence-onboarding-title {
    margin: 0 0 5px;
    font-size: 22px;
    font-weight: 300;
    color: #2d2d2d;
    background: #ffffff;
    line-height: 1.4;
    text-align: center;
    padding: 1.5rem 1rem 0 1rem;
    border: 0;
}

/* Icon - appears below title */
.vmpfence-onboarding-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #2eaadc 0%, #1e88b8 100%);
    border-radius: 50%;
    margin: 0 auto;
    padding-top: 20px;
}

.vmpfence-onboarding-icon::before {
    font-size: 24px;
    color: #ffffff;
}

/* SVG Icon Styling */
.vmpfence-onboarding-icon-svg {
    background: transparent;
}

.vmpfence-onboarding-icon-svg svg {
    width: 52px;
    height: 52px;
    fill: #9f9fa0;
    margin-top: 20px;
}

/* Card Body */
.vmpfence-onboarding-body {
    text-align: center;
}

/* Description */
.vmpfence-onboarding-desc {
    margin: 1rem 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #3c434a;
    text-align: left;
    padding: 0 3rem;
}

/* Card Footer */
.vmpfence-onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-top: 1px solid #d9d9d9;
    background: #f1f1f1;
    border-radius: 0 0 5px 5px;
    gap: 16px;
    position: relative;
}

/* Progress Dots */
.vmpfence-onboarding-dots {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.vmpfence-onboarding-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s ease;
}

.vmpfence-onboarding-dot.active {
    background: #191970;
    width: 7px;
    border-radius: 50%;
}

/* Buttons */
.vmpfence-onboarding-btn {
    display: inline-block;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.vmpfence-onboarding-btn-prev {
    background: transparent;
    color: #191970;
    border: 1px solid #191970;
    font-weight: 400;
    margin-right: auto;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.3125;
}

.vmpfence-onboarding-btn-prev:hover {
    background: #f7f7f7;
    border-color: #191970;
    color: #191970;
}

.vmpfence-onboarding-btn-next,
.vmpfence-onboarding-btn-gotit {
    background: #191970;
    color: #ffffff;
    border: 1px solid #191970;
    margin-left: auto;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3125;
}

.vmpfence-onboarding-btn-next:hover,
.vmpfence-onboarding-btn-gotit:hover {
    background: #222292;
    border-color: #222292;
    transform: none;
}

.vmpfence-onboarding-btn-next:active,
.vmpfence-onboarding-btn-gotit:active {
    transform: translateY(0);
}

.vmpfence-onboarding-btn-next:focus,
.vmpfence-onboarding-btn-gotit:focus {
    outline: none;
}

/* ============================================
   Arrow Pointer to Target
   ============================================ */

/* Arrow element pointing to the target card */
.vmpfence-onboarding-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 100002;
    transition: all 0.3s ease;
}

/* Arrow pointing up - seamless with modal top */
.vmpfence-onboarding-arrow.arrow-up {
    border-width: 0 18px 18px 18px;
    border-color: transparent transparent #ffffff transparent;
    /* filter: drop-shadow(0 -3px 6px rgba(0, 0, 0, 0.15)); */
    top: -18px;
    /* left set by JS */
}

/* Arrow pointing down */
.vmpfence-onboarding-arrow.arrow-down {
    border-width: 18px 18px 0 18px;
    border-color: #ffffff transparent transparent transparent;
    /* filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15)); */
    bottom: -18px;
    left: 50%;
}

/* Arrow pointing left */
.vmpfence-onboarding-arrow.arrow-left {
    border-width: 18px 18px 18px 0;
    border-color: transparent #ffffff transparent transparent;
    /* filter: drop-shadow(-3px 0 6px rgba(0, 0, 0, 0.15)); */
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
}

/* Arrow pointing right */
.vmpfence-onboarding-arrow.arrow-right {
    border-width: 18px 0 18px 18px;
    border-color: transparent transparent transparent #ffffff;
    /* filter: drop-shadow(3px 0 6px rgba(0, 0, 0, 0.15)); */
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media screen and (max-width: 782px) {
    .vmpfence-onboarding-card {
        max-width: 90%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .vmpfence-onboarding-arrow {
        display: none;
    }

    .vmpfence-onboarding-header {
        padding: 24px 20px 16px;
    }

    .vmpfence-onboarding-body {
        padding: 0 20px 20px;
    }

    .vmpfence-onboarding-footer {
        padding: 16px 20px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .vmpfence-onboarding-dots {
        order: 1;
        width: 100%;
        justify-content: center;
    }

    .vmpfence-onboarding-btn-prev {
        order: 2;
        flex: 1;
        min-width: auto;
    }

    .vmpfence-onboarding-btn-next,
    .vmpfence-onboarding-btn-gotit {
        order: 3;
        flex: 1;
        min-width: auto;
    }

    .vmpfence-onboarding-title {
        font-size: 18px;
    }

    .vmpfence-onboarding-desc {
        font-size: 14px;
    }

    .vmpfence-onboarding-icon {
        width: 44px;
        height: 44px;
    }

    .vmpfence-onboarding-icon::before {
        font-size: 22px;
    }
}

/* ============================================
   Dark Mode Support (if WordPress admin uses dark mode)
   ============================================ */

@media (prefers-color-scheme: dark) {
    body.admin-color-midnight .vmpfence-onboarding-card,
    body.admin-color-modern .vmpfence-onboarding-card {
        background: #1e293b;
        border: 1px solid #334155;
    }

    body.admin-color-midnight .vmpfence-onboarding-header,
    body.admin-color-modern .vmpfence-onboarding-header {
        border-bottom-color: #334155;
    }

    body.admin-color-midnight .vmpfence-onboarding-title,
    body.admin-color-modern .vmpfence-onboarding-title {
        color: #f1f5f9;
    }

    body.admin-color-midnight .vmpfence-onboarding-desc,
    body.admin-color-modern .vmpfence-onboarding-desc {
        color: #cbd5e1;
    }

    body.admin-color-midnight .vmpfence-onboarding-footer,
    body.admin-color-modern .vmpfence-onboarding-footer {
        background: #0f172a;
        border-top-color: #334155;
    }

    body.admin-color-midnight .vmpfence-onboarding-close,
    body.admin-color-modern .vmpfence-onboarding-close {
        color: #94a3b8;
    }

    body.admin-color-midnight .vmpfence-onboarding-close:hover,
    body.admin-color-modern .vmpfence-onboarding-close:hover {
        background: #334155;
        color: #f1f5f9;
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

.vmpfence-onboarding-card:focus-within {
    outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .vmpfence-onboarding-backdrop,
    .vmpfence-onboarding-card,
    .vmpfence-onboarding-highlight,
    .vmpfence-onboarding-dot,
    .vmpfence-onboarding-btn {
        animation: none;
        transition: none;
    }
}
