/* ── Summarize It! v1.0.0 ────────────────────────────────────────────────────
   Combines NativeMetrics official overlay/button CSS with feed button presets.
   Color variables are set inline by PHP from admin settings.
──────────────────────────────────────────────────────────────────────────── */

:root {
    --smit-feed-color:   #49aff6;
    --smit-feed-text:    #0a3a70;
    --smit-article-color: #49aff6;
    --nm-launcher-primary:   #49aff6;
    --nm-launcher-secondary: #49aff6;
    --nm-launcher-text:      #7ec8f0;
    --nm-launcher-badge-text: #7da4cf;
    --nm-launcher-dark-bg:   #0d1f38;
    --nm-launcher-dark-border: #1a4068;
    --nm-launcher-dark-hover-bg: #112540;
    --nm-launcher-dark-hover-text: #a8d8f8;
    --nm-launcher-light-bg:  #ffffff;
    --nm-launcher-light-border: #a0c0e0;
    --nm-launcher-light-text: #0a3a70;
    --nm-launcher-light-hover-bg: #f0f7ff;
    --nm-launcher-light-hover-text: #082e58;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FEED BUTTON PRESETS
═══════════════════════════════════════════════════════════════════════════ */

.smit-feed-wrap {
    display: block;
    margin: 0.6em 0 0.2em;
    clear: both;
}

.smit-feed-wrap--inline {
    display: inline;
    margin: 0 0 0 8px;
    vertical-align: middle;
}

.smit-feed-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    text-decoration: none;
    animation: none !important;
    box-shadow: none;
}

/* Inline (headline) mode — smaller */
.smit-feed-wrap--inline .smit-feed-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    border-radius: 3px;
    vertical-align: middle;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* Card mode */
.smit-feed-wrap:not(.smit-feed-wrap--inline) .smit-feed-btn {
    font-size: 12px !important;
    padding: 5px 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* ── Minimal Light (Yahoo Finance style) ── */
.smit-style-minimal-light {
    background: #fff !important;
    color: var(--smit-feed-text) !important;
    border: 1px solid #c8d8e8 !important;
}
.smit-style-minimal-light:hover {
    background: #f0f7ff !important;
    border-color: var(--smit-feed-color) !important;
}

/* ── Minimal Dark ── */
.smit-style-minimal-dark {
    background: #1a1a2e !important;
    color: #fff !important;
    border: 1px solid #334 !important;
}
.smit-style-minimal-dark:hover {
    background: #222240 !important;
}

/* ── Pill Light ── */
.smit-style-pill-light {
    background: #fff !important;
    color: var(--smit-feed-text) !important;
    border: 1.5px solid var(--smit-feed-color) !important;
    border-radius: 999px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}
.smit-style-pill-light:hover {
    background: var(--smit-feed-color) !important;
    color: #fff !important;
}

/* ── Pill Dark ── */
.smit-style-pill-dark {
    background: var(--smit-feed-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-shadow: 0 2px 8px rgba(73,175,246,.3) !important;
}
.smit-style-pill-dark:hover {
    filter: brightness(1.1);
}

/* ── Ghost ── */
.smit-style-ghost {
    background: transparent !important;
    color: var(--smit-feed-color) !important;
    border: 1px solid var(--smit-feed-color) !important;
    border-radius: 3px !important;
}
.smit-style-ghost:hover {
    background: rgba(73,175,246,.08) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE FLOATING BUTTON
   Source: NativeMetrics official CSS (center-wrap + btn-animated variants)
═══════════════════════════════════════════════════════════════════════════ */

.nativemetrics-summarybot-center-wrap {
    position: fixed;
    bottom: 28px;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.nativemetrics-summarybot-center-wrap > * {
    pointer-events: auto;
}

@property --nm-launcher-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes nm-summarybot-launcher-spin {
    to { --nm-launcher-angle: 360deg; }
}

.nativemetrics-summarybot-btn-animated {
    display: inline-block;
    width: auto !important;
    max-width: calc(100vw - 28px);
    height: auto !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    isolation: isolate;
    box-shadow: none !important;
    cursor: pointer;
    position: relative;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.nativemetrics-summarybot-btn-animated:hover,
.nativemetrics-summarybot-btn-animated:focus {
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
    outline: none !important;
}

/* Hide halo/ring by default */
.nativemetrics-summarybot-btn-halo,
.nativemetrics-summarybot-btn-ring {
    display: none !important;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Dark variant re-enables them */
.nativemetrics-summarybot-btn-animated-dark .nativemetrics-summarybot-btn-halo,
.nativemetrics-summarybot-btn-animated-dark .nativemetrics-summarybot-btn-ring {
    display: block !important;
}

.nativemetrics-summarybot-btn-inner {
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 50px;
    padding: 0 28px;
    box-sizing: border-box;
    border-radius: 25px;
    overflow: hidden;
    background: none !important; /* variant sets this */
    border: none !important;
    box-shadow: none !important;
}

/* Dark inner */
.nativemetrics-summarybot-btn-animated-dark .nativemetrics-summarybot-btn-inner {
    background: var(--nm-launcher-dark-bg) !important;
    color: var(--nm-launcher-text, #7ec8f0) !important;
    border: 1.5px solid var(--nm-launcher-dark-border) !important;
    min-width: 260px;
}
.nativemetrics-summarybot-btn-animated-dark:hover .nativemetrics-summarybot-btn-inner {
    background: var(--nm-launcher-dark-hover-bg) !important;
    color: var(--nm-launcher-dark-hover-text) !important;
}

/* Light inner */
.nativemetrics-summarybot-btn-animated-light .nativemetrics-summarybot-btn-inner {
    background: var(--nm-launcher-light-bg) !important;
    color: var(--nm-launcher-light-text) !important;
    border: 1.5px solid var(--nm-launcher-light-border) !important;
    min-width: 260px;
}
.nativemetrics-summarybot-btn-animated-light:hover .nativemetrics-summarybot-btn-inner {
    background: var(--nm-launcher-light-hover-bg) !important;
    color: var(--nm-launcher-light-hover-text) !important;
}

.nativemetrics-summarybot-btn-halo {
    inset: -5px;
    border-radius: 30px;
    z-index: 0;
    animation: nm-summarybot-launcher-spin 2.2s linear infinite;
    filter: blur(9px);
    opacity: 0.75;
    background: conic-gradient(from var(--nm-launcher-angle),
        transparent 0deg, transparent 148deg,
        #000c20 162deg, #001e60 178deg,
        #004aaa 196deg, #007fd0 213deg,
        #00aaee 228deg, var(--nm-launcher-primary) 240deg,
        #a8f0ff 249deg, #ffffff 255deg,
        transparent 262deg, transparent 360deg
    );
}

.nativemetrics-summarybot-btn-halo-b {
    animation-delay: -1.1s;
}

.nativemetrics-summarybot-btn-ring {
    inset: -1px;
    border-radius: 27px;
    z-index: 1;
    animation: nm-summarybot-launcher-spin 2.2s linear infinite;
    background: conic-gradient(from var(--nm-launcher-angle),
        transparent 0deg, transparent 148deg,
        #000c20 162deg, #001e60 178deg,
        #004aaa 196deg, #007fd0 213deg,
        #00aaee 228deg, var(--nm-launcher-primary) 240deg,
        #a8f0ff 249deg, #ffffff 255deg,
        transparent 262deg, transparent 360deg
    );
}

.nativemetrics-summarybot-btn-ring-b {
    animation-delay: -1.1s;
}

.nativemetrics-summarybot-btn-label {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.022em;
    white-space: nowrap;
    text-align: center;
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERLAY — NativeMetrics official CSS
═══════════════════════════════════════════════════════════════════════════ */

.nativemetrics-summarybot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(83, 88, 100, 0.26);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nativemetrics-summarybot-overlay.smit-open {
    opacity: 1;
    visibility: visible;
}

.nativemetrics-summarybot-overlay[hidden] {
    display: none !important;
}

.nativemetrics-summarybot-panel {
    position: relative;
    width: min(100%, 640px);
    min-width: 0;
    max-width: 640px;
    min-height: 400px;
    max-height: calc(100vh - 56px);
    background: #fff;
    border: 1px solid rgba(73, 175, 246, 0.18);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(83, 88, 100, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nativemetrics-summarybot-close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 10;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    color: #8fa0b2;
    background: rgba(255,255,255,0.96);
    border: 1px solid #dbe8f3;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(83,88,100,.12);
    animation: none !important;
}

.nativemetrics-summarybot-close:hover {
    background: #fff;
    color: #535864;
}

.nativemetrics-summarybot-iframe {
    width: 100%;
    min-width: 0;
    border: none;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    height: 0; /* flex:1 overrides this, forces iframe to fill remaining space */
}

@media (min-width: 769px) {
    .nativemetrics-summarybot-iframe {
        height: 0; /* let flex handle it */
    }
}

/* ── Mobile overlay — full screen ─────────────────────────────────────────── */

@media (max-width: 640px) {
    .nativemetrics-summarybot-overlay {
        padding: 0;
    }
    .nativemetrics-summarybot-panel {
        width: 100vw;
        max-width: 100vw;
        min-height: 100vh;
        max-height: 100vh;
        min-width: 0;
        border-radius: 0;
    }
    .nativemetrics-summarybot-iframe {
        height: 100vh;
        min-height: 100vh;
        min-width: 0;
    }
    .nativemetrics-summarybot-close {
        top: max(12px, env(safe-area-inset-top, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .nativemetrics-summarybot-btn-halo,
    .nativemetrics-summarybot-btn-ring {
        animation: none;
    }
}
