/* ==========================================================================
   TERFIUI v5 — Quick Facts (Hap Bilgiler) Page Stylesheet
   ========================================================================== */

/* Kompakt Hap Bilgiler Hero Kartı (Kompakt İnce Görünüm) */
.gd-qf-hero-compact {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

.gd-qf-hero-compact .gd-page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fef3c7;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gd-qf-hero-compact .gd-page-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.gd-qf-hero-compact .gd-page-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Page Body Spacing & Structure (Rule 20) */
.leg-duration-highlight {
    background: #fef9c3;
    border-bottom: 2px solid #eab308;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 700;
    color: #854d0e;
    cursor: help;
    transition: all 0.2s;
}
.leg-duration-highlight:hover {
    background: #fde68a;
}

/* ── Completion Banner (Tüm Maddeleri Okudunuz) ── */
.qf-completion-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 4px 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
    flex-wrap: wrap;
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.qf-completion-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 260px;
}

.qf-completion-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

.qf-completion-title {
    font-size: 15px;
    font-weight: 800;
    color: #065f46;
    margin-bottom: 2px;
}

.qf-completion-desc {
    font-size: 13px;
    color: #166534;
    font-weight: 500;
    line-height: 1.4;
}

.qf-completion-card.info {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.qf-completion-card.info .qf-completion-icon {
    background: #2563eb;
    box-shadow: none;
}

.qf-completion-card.info .qf-completion-title {
    color: #1e3a8a;
}

.qf-completion-card.info .qf-completion-desc {
    color: #475569;
}

/* ── Quick Facts Cards Grid ── */
.qf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.qf-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.qf-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.1);
    border-color: #bfdbfe;
}

.qf-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.qf-card-icon {
    width: 42px;
    height: 42px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.qf-card:hover .qf-card-icon {
    background: #2563eb;
    color: #ffffff;
}

.qf-card-info {
    flex: 1;
    min-width: 0;
}

.qf-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qf-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qf-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qf-tag-blue {
    background: #eff6ff;
    color: #2563eb;
}

.qf-tag-orange {
    background: #fff7ed;
    color: #ea580c;
}

.qf-tag-green {
    background: #ecfdf5;
    color: #10b981;
}

.qf-progress-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qf-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}



.qf-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    transition: all 0.2s ease;
}

.qf-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qf-empty {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    grid-column: 1 / -1;
}

.qf-empty-icon {
    font-size: 36px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.qf-empty-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

/* ── Reading View Specific Cards ── */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.fact-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    padding: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.fact-card.is-known {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.fact-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.fact-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
}

.fact-index-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    margin-right: 8px;
}

.fact-body {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.btn-known-toggle {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-known-toggle.active {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

.btn-known-toggle.active svg {
    stroke: #15803d !important;
    color: #15803d !important;
}

.btn-known-toggle:hover {
    border-color: #94a3b8;
}

/* ── Reading Controls & Navigation Bar ── */
.hub-nav-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.nav-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hub-back-to-hub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.hub-back-to-hub:hover {
    color: #2563eb;
}

.font-controls-compact {
    display: flex;
    gap: 6px;
}

.font-btn-compact {
    width: 32px;
    height: 32px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 11px;
}

.font-btn-compact:hover {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
}

.hub-cat-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.hub-cat-trigger:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ── Reading Progress Container ── */
.progress-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 8px;
}

.progress-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-reading-time-inline {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.progress-card-filters {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.progress-filter-link {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s;
}

.progress-filter-link.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.qf-progress-bar-bg {
    height: 8px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.qf-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #10b981 100%);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.progress-count-text {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* ── Topic Selector Modal ── */
.hub-cat-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.hub-cat-selector-modal {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hub-cat-selector-header {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hub-cat-selector-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.hub-cat-selector-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: 0.2s;
}

.hub-cat-selector-list {
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hub-cat-selector-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
    gap: 10px;
}

.hub-cat-selector-item.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.hub-cat-selector-item:hover:not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #2563eb;
}

.hub-cat-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.active .hub-cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ── Responsive Overrides ── */
@media (max-width: 992px) {
    .qf-grid, .facts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .fact-card, .qf-card {
        padding: 12px;
        border-radius: 10px;
    }
}
