/**
 * GRAPHIC VIEW — Smart Feature Guidance (ⓘ Info Icon) Stylesheet
 * Feature 06: Contextual Tooltips, High-Contrast Cards, Mobile Touch Targets, Accessible States
 */

/* 1. Circular Info Icon Button */
.gv-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-left: 6px;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.08);
    color: #0284C7;
    border: 1px solid rgba(2, 132, 199, 0.25);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Touch accessibility hit-area expander (44x44px target) */
.gv-info-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    pointer-events: auto;
}

.gv-info-btn:hover {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #0284C7;
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.gv-info-btn:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
    background: #0284C7;
    color: #FFFFFF;
}

.gv-info-btn.active {
    background: #0B1B3D;
    color: #FCD34D;
    border-color: #0B1B3D;
    box-shadow: 0 4px 14px rgba(11, 27, 61, 0.25);
}

/* Dark mode variant when placed inside dark banners */
.gv-info-btn-light,
.text-white .gv-info-btn,
.bg-dark .gv-info-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #FCD34D;
    border-color: rgba(255, 255, 255, 0.3);
}

.gv-info-btn-light:hover,
.text-white .gv-info-btn:hover,
.bg-dark .gv-info-btn:hover {
    background: #FCD34D;
    color: #0B1B3D;
    border-color: #FCD34D;
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.4);
}

.gv-info-btn-sm {
    width: 18px;
    height: 18px;
    font-size: 11px;
}

/* 2. Popover Container */
.gv-guidance-popover {
    position: fixed;
    z-index: 999999;
    width: 360px;
    max-width: calc(100% - 24px);
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(11, 27, 61, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.2s;
    pointer-events: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    text-align: left;
}

.gv-guidance-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Subtle Popover Arrow */
.gv-guidance-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    transform: rotate(45deg);
    z-index: -1;
}

.gv-guidance-popover[data-popper-placement^="bottom"] .gv-guidance-arrow {
    top: -6px;
    border-bottom: none;
    border-right: none;
}

.gv-guidance-popover[data-popper-placement^="top"] .gv-guidance-arrow {
    bottom: -6px;
    border-top: none;
    border-left: none;
}

.gv-guidance-popover[data-popper-placement^="right"] .gv-guidance-arrow {
    left: -6px;
    border-top: none;
    border-right: none;
}

.gv-guidance-popover[data-popper-placement^="left"] .gv-guidance-arrow {
    right: -6px;
    border-bottom: none;
    border-left: none;
}

/* 3. Popover Header */
.gv-guidance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.gv-guidance-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gv-guidance-title i {
    color: #0284C7;
    font-size: 15px;
}

.gv-guidance-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Bilingual Language Switcher Pill */
.gv-lang-toggle-wrap {
    display: inline-flex;
    align-items: center;
    background: #E2E8F0;
    border-radius: 999px;
    padding: 2px;
}

.gv-lang-btn {
    border: none;
    background: transparent;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.gv-lang-btn.active {
    background: #0284C7;
    color: #FFFFFF;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.3);
}

/* Close Button */
.gv-guidance-close {
    border: none;
    background: transparent;
    color: #64748B;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.gv-guidance-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* 4. Popover Body */
.gv-guidance-body {
    padding: 16px;
    max-height: 380px;
    overflow-y: auto;
}

.gv-guidance-section {
    margin-bottom: 12px;
}

.gv-guidance-section:last-child {
    margin-bottom: 0;
}

.gv-guidance-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gv-guidance-text {
    font-size: 13px;
    color: #334155;
    margin: 0;
    line-height: 1.5;
}

/* Step-by-step formatting */
.gv-guidance-steps {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 12.5px;
    color: #334155;
}

.gv-guidance-steps li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 5px;
    line-height: 1.45;
}

.gv-guidance-steps li:last-child {
    margin-bottom: 0;
}

.gv-guidance-steps li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: #0284C7;
    font-weight: 800;
    font-size: 15px;
    line-height: 1;
}

/* Important Note Callout */
.gv-guidance-note {
    background: #FEF3C7;
    border-left: 3px solid #F59E0B;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #92400E;
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.45;
}

.gv-guidance-note i {
    font-size: 14px;
    margin-top: 1px;
    color: #D97706;
}

/* Learn More Link */
.gv-guidance-footer {
    padding: 10px 16px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gv-guidance-link {
    color: #0284C7;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gv-guidance-link:hover {
    text-decoration: underline;
    color: #0369A1;
}

/* 5. Mobile Backdrop for touch mode */
.gv-guidance-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: rgba(11, 27, 61, 0.25);
    backdrop-filter: blur(2px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gv-guidance-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Screen Adjustments (< 576px) */
@media (max-width: 575.98px) {
    .gv-guidance-popover {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        bottom: 20px !important;
        top: auto !important;
        transform: translateY(20px) scale(0.95);
        border-radius: 20px;
    }

    .gv-guidance-popover.show {
        transform: translateY(0) scale(1);
    }

    .gv-guidance-arrow {
        display: none !important;
    }
}
