/* ==========================================================================
   HER GÜN KİTAP - DÜNYANIN OKUMA ARŞİVİ (GLOBAL READING PULSE)
   Modern Luxury White Theme, Alternating Directional Marquee & Typographic Tag Cloud
   ========================================================================== */

.global-archive-slot {
    width: 100%;
    margin: clamp(40px, 5vw, 72px) 0 0;
}

/* Master Container - Clean Luxury White */
.global-archive-fallback,
.global-reading-pulse {
    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(24px, 4vw, 48px);
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 28px;
    box-shadow: 0 16px 48px -12px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(241, 90, 36, 0.04);
    color: #0f172a;
    overflow: visible; /* Popovers must never be clipped */
}

/* Subtle Ambient Glow Background */
.global-archive-fallback::before,
.global-reading-pulse::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: 
        radial-gradient(circle at 92% 10%, rgba(241, 90, 36, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 8% 90%, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
    z-index: 0;
}

.global-archive-fallback > *,
.global-reading-pulse > * {
    position: relative;
    z-index: 1;
}

/* Top Accent Line */
.global-archive-fallback::after,
.global-reading-pulse::after {
    content: "";
    position: absolute;
    top: 0;
    left: 36px;
    right: 36px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #f15a24 30%, #ff8a50 70%, transparent 100%);
    border-radius: 999px;
}

/* Header Section */
.pulse-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.pulse-heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #ea580c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.pulse-heading h2 {
    max-width: 680px;
    margin: 6px 0 10px;
    color: #0f172a !important;
    font-size: clamp(1.9rem, 3.4vw, 2.9rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.pulse-heading h2 em {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
    background: linear-gradient(135deg, #f15a24 0%, #c2410c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 4px;
}

.pulse-heading p {
    max-width: 620px;
    margin: 0;
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Live Pulse Badge */
.pulse-live {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    border-radius: 999px;
    color: #c2410c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pulse-live::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    animation: pulse-dot-glow 2s infinite ease-in-out;
}

@keyframes pulse-dot-glow {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.75;
    }
}

/* Metric Cards Grid */
.pulse-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.pulse-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pulse-metric:hover {
    transform: translateY(-2px);
    border-color: #f15a24;
    box-shadow: 0 10px 24px -4px rgba(241, 90, 36, 0.12);
}

.pulse-metric > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 1.15rem;
    flex: none;
}

.pulse-metric strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.pulse-metric small {
    display: block;
    margin-top: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Containers */
.pulse-full-section {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 24px;
    padding: 24px 28px;
    margin-top: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: visible;
}

.pulse-section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f8fafc;
}

.pulse-cloud-label {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* List Toggle Button */
.pulse-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pulse-view-toggle:hover {
    background: #fff7ed;
    border-color: #f15a24;
    color: #ea580c;
    transform: translateY(-1px);
}

.pulse-view-toggle.is-active {
    background: #f15a24;
    border-color: #ea580c;
    color: #ffffff;
}

/* ==========================================================================
   ACTIVE WORD INSPECTOR BAR (High-contrast definition panel above cloud)
   ========================================================================== */

.pulse-word-inspector {
    margin-bottom: 22px;
}

.inspector-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fffaf5;
    border: 1.5px dashed #fbd5c0;
    border-radius: 14px;
    color: #9a3412;
    font-size: 0.88rem;
    font-weight: 500;
}

.inspector-icon {
    font-size: 1.15rem;
    color: #ea580c;
}

.inspector-card {
    padding: 18px 22px;
    background: #ffffff;
    border: 2px solid #f15a24;
    border-radius: 16px;
    box-shadow: 0 10px 30px -5px rgba(241, 90, 36, 0.14);
    animation: inspector-fade-in 0.22s ease-out;
}

@keyframes inspector-fade-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inspector-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.inspector-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff7ed;
    border-radius: 999px;
    color: #ea580c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.inspector-close {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}

.inspector-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.inspector-card-body strong.inspector-word {
    display: block;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.inspector-card-body p.inspector-meaning {
    margin: 0;
    color: #334155;
    font-size: 1rem;
    line-height: 1.6;
}

/* ==========================================================================
   ALTERNATING DIRECTIONAL MARQUEE SYSTEM (LEFT <-> RIGHT ROWS)
   ========================================================================== */

@keyframes marquee-glide-left {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes marquee-glide-right {
    0% { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.pulse-visual-wrap {
    position: relative;
    width: 100%;
    overflow: visible;
}

.pulse-marquee-row {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 10px 0;
    margin: 2px 0;
}

.pulse-marquee-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 26px;
    width: 100%;
}

.pulse-marquee-row.direction-left .pulse-marquee-track {
    animation: none;
}

.pulse-marquee-row.direction-right .pulse-marquee-track {
    animation: none;
}

/* Hover or active pause: user can calmly read and click */
.pulse-marquee-row:hover .pulse-marquee-track,
.pulse-marquee-row.is-paused .pulse-marquee-track,
.pulse-marquee-row:has(.pulse-word-tag.is-expanded) .pulse-marquee-track {
    animation-play-state: paused !important;
}

/* ==========================================================================
   ORGANIC TYPOGRAPHIC TAG CLOUD (JUST LIKE REFERENCE IMAGE, ON WHITE)
   ========================================================================== */

.pulse-word-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    outline: none;
}

.pulse-word-tag:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(241, 90, 36, 0.12);
    z-index: 50;
}

.pulse-word-tag:focus-visible {
    outline: 2px solid #f15a24;
    outline-offset: 2px;
}

/* Hierarchy Tiers */
.pulse-word-tag.tier-hero .pulse-word-text {
    font-size: clamp(1.8rem, 2.5vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.pulse-word-tag.tier-major .pulse-word-text {
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.pulse-word-tag.tier-medium .pulse-word-text {
    font-size: clamp(1.05rem, 1.35vw, 1.3rem);
    font-weight: 600;
    line-height: 1.2;
}

.pulse-word-tag.tier-small .pulse-word-text {
    font-size: clamp(0.9rem, 1.05vw, 1.05rem);
    font-weight: 500;
    line-height: 1.2;
}

.pulse-word-tag.tier-xs .pulse-word-text {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Typographic Colors on White Background */
.pulse-word-tag.color-orange .pulse-word-text {
    color: #ea580c;
}
.pulse-word-tag.color-ink .pulse-word-text {
    color: #0f172a;
}
.pulse-word-tag.color-slate .pulse-word-text {
    color: #334155;
}
.pulse-word-tag.color-muted .pulse-word-text {
    color: #64748b;
}
.pulse-word-tag.color-purple .pulse-word-text {
    color: #7c3aed;
}

/* ==========================================================================
   CRYSTAL-CLEAR FLOATING DEFINITION POPOVER
   ========================================================================== */

.pulse-word-meaning {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 250px;
    max-width: 320px;
    padding: 14px 18px;
    background: #ffffff !important;
    border: 2px solid #f15a24 !important;
    border-radius: 16px;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(241, 90, 36, 0.15) !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 99999;
    white-space: normal;
    text-shadow: none !important;
    box-sizing: border-box;
}

/* Upward pointer arrow */
.pulse-word-meaning::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-right: 2px solid #f15a24;
    border-bottom: 2px solid #f15a24;
}

/* Downward opening when tag is near top of screen */
.pulse-word-meaning.open-down {
    bottom: auto;
    top: calc(100% + 14px);
    transform: translateX(-50%) translateY(-6px);
}

.pulse-word-meaning.open-down::after {
    bottom: auto;
    top: -7px;
    border-right: none;
    border-bottom: none;
    border-left: 2px solid #f15a24;
    border-top: 2px solid #f15a24;
}

.pulse-word-tag.is-expanded .pulse-word-meaning {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.popover-tag {
    display: inline-block;
    padding: 2px 7px;
    margin-bottom: 6px;
    background: #fff7ed;
    color: #ea580c;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.popover-word {
    display: block;
    color: #0f172a !important;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.popover-desc {
    display: block;
    color: #334155 !important;
    font-size: 13.5px;
    line-height: 1.5;
}

/* ==========================================================================
   BOOKS & AUTHORS PILL CARDS IN MULTI-ROW MARQUEE
   ========================================================================== */

.pulse-flight-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.pulse-flight-tag.book {
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.pulse-flight-tag.book::before {
    content: "▤";
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    background: #fff7ed;
    color: #ea580c;
    border-radius: 50%;
    font-size: 0.85rem;
    flex: none;
}

.pulse-flight-tag.book:hover {
    transform: translateY(-2px);
    border-color: #f15a24;
    box-shadow: 0 8px 20px rgba(241, 90, 36, 0.12);
}

.pulse-flight-tag.author {
    padding: 9px 18px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 999px;
    color: #581c87;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.pulse-flight-tag.author::before {
    content: "✒";
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    background: #f3e8ff;
    color: #9333ea;
    border-radius: 50%;
    font-size: 0.8rem;
    flex: none;
}

.pulse-flight-tag.author:hover {
    transform: translateY(-2px);
    border-color: #a855f7;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.15);
}

/* ==========================================================================
   QUOTES TABLE
   ========================================================================== */

.pulse-quote-table-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.pulse-quote-table {
    width: 100%;
    border-collapse: collapse;
}

.pulse-quote-table th {
    background: #f8fafc;
    padding: 14px 20px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.pulse-quote-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
    font-size: 0.92rem;
}

.pulse-quote-table tr:last-child td {
    border-bottom: none;
}

.pulse-quote-text {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: #1e293b;
    font-size: 1.05rem;
    line-height: 1.6;
}

.pulse-quote-time {
    color: #64748b;
    font-size: 0.85rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   LIST VIEW & BULLETPROOF TOGGLE SYSTEM (OVERRIDE SPECIFICITY)
   ========================================================================== */

[hidden],
.pulse-visual-wrap[hidden],
.pulse-list-view[hidden],
.pulse-word-cloud[hidden],
.pulse-marquee[hidden],
.pulse-quote-table-wrap[hidden] {
    display: none !important;
}

.pulse-visual-wrap:not([hidden]) {
    display: block !important;
}

.pulse-list-view:not([hidden]) {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.pulse-list-row {
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    color: #0f172a;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pulse-list-row:hover {
    transform: translateY(-2px);
    border-color: #f15a24;
    box-shadow: 0 8px 20px rgba(241, 90, 36, 0.1);
}

.pulse-list-row strong {
    display: block;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
}

.pulse-list-row small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Empty state */
.pulse-empty {
    padding: 32px;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

/* ==========================================================================
   RESPONSIVE ADAPTATIONS
   ========================================================================== */

@media (max-width: 900px) {
    .pulse-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pulse-heading {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .global-archive-fallback,
    .global-reading-pulse {
        padding: 20px 16px;
        border-radius: 20px;
    }
    .pulse-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .pulse-metric {
        padding: 12px 16px;
    }
    .pulse-metric strong {
        font-size: 1.35rem;
    }
    .pulse-full-section {
        padding: 18px 14px;
        border-radius: 18px;
    }
    .pulse-list-view:not([hidden]) {
        grid-template-columns: 1fr;
    }
}

/* Keep archive view switching deterministic even when other styles set display. */
.pulse-full-section:not(.is-list) [data-pulse-list] {
    display: none !important;
}

.pulse-full-section.is-list [data-pulse-visual] {
    display: none !important;
}

.pulse-full-section.is-list [data-pulse-list]:not([hidden]) {
    display: grid !important;
}
