/* ==========================================================
   ŞİFA AKADEMİ — UI COMPONENTS (CARDS, BUTTONS, FORMS, PROGRESS)
   ========================================================== */

/* ==========================================================
   AVATARS & INITIALS FALLBACK
   ========================================================== */
.user-avatar-wrap {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #fdf3f2);
    vertical-align: middle;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #fdf3f2);
    color: var(--primary, #8E1616);
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
}

/* ==========================================================
   CARDS
   ========================================================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-normal);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    background-color: var(--bg-surface-secondary);
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled, .btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(156, 26, 21, 0.3);
}

.btn-secondary {
    background-color: var(--bg-surface-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-tertiary);
    color: var(--text-primary);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
    border-color: var(--success);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ==========================================================
   FORM CONTROLS
   ========================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-control, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-focus);
}

.form-control::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox-label input[type="checkbox"],
.form-checkbox-label input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-file-input {
    display: block;
    width: 100%;
    padding: 0.45rem 0.65rem;
    background-color: var(--bg-surface-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-file-input:hover {
    border-color: var(--primary);
    background-color: var(--bg-surface-tertiary);
}

.form-file-input::file-selector-button {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background-color var(--transition-fast);
}

.form-file-input::file-selector-button:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ==========================================================
   PROGRESS BARS (Chapter Based)
   ========================================================== */
.progress-container {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 10px;
    background-color: var(--bg-surface-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #d93830);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* ==========================================================
   BADGES & CHIPS
   ========================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-neutral {
    background-color: var(--bg-surface-tertiary);
    color: var(--text-secondary);
}

/* ==========================================================
   ALERTS / FLASH NOTIFICATIONS
   ========================================================== */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    color: #14532d;
    border-color: var(--success-border);
}

.alert-error, .alert-danger {
    background-color: var(--danger-bg);
    color: #7f1d1d;
    border-color: var(--danger-border);
}

.alert-info {
    background-color: var(--info-bg);
    color: #1e3a8a;
    border-color: var(--info-border);
}

[data-theme="dark"] .alert-success { color: #86efac; }
[data-theme="dark"] .alert-error, [data-theme="dark"] .alert-danger { color: #fca5a5; }
[data-theme="dark"] .alert-info { color: #93c5fd; }

/* ==========================================================
   EMPTY STATES
   ========================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    stroke: var(--text-muted);
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 1.25rem;
}

/* ==========================================================
   RESPONSIVE TABLE
   ========================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    background-color: var(--bg-surface-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tbody tr:hover {
    background-color: var(--bg-surface-secondary);
}

/* ==========================================================
   RESPONSIVE DISPLAY UTILITIES & MOBILE CHAPTER CARDS
   ========================================================== */
.desktop-only {
    display: inherit;
}
.mobile-only {
    display: none !important;
}

@media (max-width: 767.98px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
    .mobile-only.d-flex {
        display: flex !important;
    }
    .mobile-only.d-grid {
        display: grid !important;
    }
}

.mobile-chapters-list {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

.mobile-chapter-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: background-color var(--transition-fast);
}

.mobile-chapter-card.completed {
    background-color: var(--bg-surface-secondary);
}

.mobile-chapter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-chapter-no {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
}

.mobile-chapter-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.mobile-chapter-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mobile-chapter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   PAGE HEADER & TOOLBAR (Consistent Desktop Typography)
   ========================================================== */
.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-content {
    flex: 1;
    min-width: 260px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
    line-height: 1.45;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ==========================================================
   PROGRAM KİTAPLARI KATALOĞU (Masaüstü / Mobil 2 Sütun)
   ========================================================== */
.books-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.book-catalog-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.book-catalog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.book-catalog-cover-wrap {
    height: 200px;
    background-color: var(--bg-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.book-catalog-cover-img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform var(--transition-normal);
}

.book-catalog-card:hover .book-catalog-cover-img {
    transform: scale(1.03);
}

.book-catalog-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
}

.book-catalog-body {
    padding: 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.book-catalog-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em;
}

.book-catalog-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-catalog-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.book-catalog-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* MOBİL GÖRÜNÜM: 360px ve üzeri ekranlarda 2 DENGELİ SÜTUN */
@media (max-width: 767.98px) {
    .books-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .book-catalog-cover-wrap {
        height: 140px;
    }

    .book-catalog-body {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .book-catalog-title {
        font-size: 0.875rem;
        margin-bottom: 0.15rem;
        height: 2.6em;
    }

    .book-catalog-author {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    /* Mobilde kart dengesini korumak için uzun tanıtım metni gizlenir */
    .book-catalog-desc {
        display: none;
    }

    .book-catalog-btn {
        font-size: 0.75rem;
        padding: 0.45rem 0.5rem;
        min-height: 38px;
        width: 100%;
    }
}

/* ÇOK DAR MOBİL EKRANLAR (<360px): Tek sütun fallback */
@media (max-width: 359.98px) {
    .books-catalog-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .book-catalog-cover-wrap {
        height: 180px;
    }

    .book-catalog-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
    }
}

/* ==========================================================
   OKUMA MERKEZİ & DUOLINGO BÖLÜM YOLU & HAFTALIK SERİ STİLLERİ
   ========================================================== */

/* 1. Haftalık Seri (Streak) */
.streak-bar-container {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.03) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.streak-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.streak-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #b45309;
}

.streak-flames-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    scrollbar-width: thin;
}

.streak-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 48px;
    flex: 1;
}

.streak-flame-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.streak-node.completed .streak-flame-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
    animation: flameBounce 1.8s infinite ease-in-out;
}

.streak-node.current .streak-flame-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.streak-node.missed .streak-flame-icon {
    background: var(--bg-surface-secondary);
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.streak-week-label {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-secondary);
}

@keyframes flameBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    .streak-node.completed .streak-flame-icon,
    .duolingo-node.active {
        animation: none !important;
    }
}

/* ==========================================================
   COMPACT FUTURE UI — ortak, tema uyumlu yüzey sistemi
   ========================================================== */
.content-container {
    --future-cyan: #0891b2;
    --future-emerald: #059669;
    --future-amber: #d97706;
}

.content-container .card {
    border-color: color-mix(in srgb, var(--future-cyan) 16%, var(--border));
    box-shadow:
        0 10px 28px -26px color-mix(in srgb, var(--future-cyan) 70%, transparent),
        inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent);
}

.content-container .card:nth-of-type(3n + 2) {
    border-color: color-mix(in srgb, var(--future-emerald) 17%, var(--border));
}

.content-container .card:nth-of-type(3n) {
    border-color: color-mix(in srgb, var(--future-amber) 15%, var(--border));
}

.content-container .card-header {
    padding: .72rem 1rem;
    min-height: 46px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--future-cyan) 5%, var(--bg-surface)),
        var(--bg-surface) 72%);
}

.content-container .card-body { padding: .9rem 1rem; }
.content-container .card-footer { padding: .65rem 1rem; }

.profile-container {
    gap: .85rem !important;
    max-width: 1000px !important;
}

.profile-container > .card:first-child > div:first-child {
    height: 118px !important;
}

.profile-container > .card:first-child > .card-body {
    padding: 1rem 1.25rem !important;
}

.profile-container > div[style*="display: grid"] {
    gap: .65rem !important;
}

.profile-container > div[style*="display: grid"] .card {
    padding: .78rem .9rem !important;
    min-height: 0 !important;
}

.role-workspace-active .follower-stats-grid {
    gap: .5rem !important;
    margin-bottom: .8rem !important;
}

.role-workspace-active .follower-stat-card {
    min-height: 0 !important;
    padding: .62rem .78rem !important;
    gap: .15rem !important;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--future-cyan) 6%, var(--bg-surface)),
        var(--bg-surface)) !important;
}

.role-workspace-active .follower-stat-card:nth-child(3n + 2) {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--future-amber) 7%, var(--bg-surface)),
        var(--bg-surface)) !important;
}

.role-workspace-active .follower-stat-card:nth-child(3n) {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--future-emerald) 7%, var(--bg-surface)),
        var(--bg-surface)) !important;
}

.role-workspace-active .follower-stat-label {
    font-size: .72rem !important;
    line-height: 1.25;
}
.role-workspace-active .follower-stat-value {
    font-size: 1.3rem !important;
    line-height: 1.1;
}
.role-workspace-active .follower-stat-sub {
    font-size: .72rem !important;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .content-container .card-header { padding: .62rem .78rem; min-height: 42px; }
    .content-container .card-body { padding: .72rem .78rem; }
    .profile-container > .card:first-child > div:first-child { height: 92px !important; }
    .profile-container > .card:first-child > .card-body { padding: .78rem .9rem !important; }
    .role-workspace-active .follower-stat-card { min-height: 82px !important; }
}

/* 2. Duolingo Bölüm Yolu (Chapter Route) */
.duolingo-path-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.25rem;
    padding: 2rem 1rem;
    margin: 1.5rem 0;
}

.duolingo-path-line {
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    width: 6px;
    background: var(--border);
    border-radius: 3px;
    z-index: 1;
}

.duolingo-path-progress-line {
    position: absolute;
    top: 2rem;
    width: 6px;
    background: #10b981;
    border-radius: 3px;
    z-index: 2;
    transition: height 0.4s ease;
}

.duolingo-node-container {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    max-width: 240px;
    text-align: center;
}

.duolingo-node {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.duolingo-node:hover {
    transform: scale(1.1);
}

.duolingo-node.completed {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.duolingo-node.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2), 0 6px 16px rgba(37, 99, 235, 0.4);
    animation: activePulse 2s infinite ease-in-out;
}

.duolingo-node.locked {
    background: var(--bg-surface-secondary);
    color: var(--text-muted);
    border: 2px solid var(--border);
    box-shadow: none;
    cursor: not-allowed;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.25), 0 6px 16px rgba(37, 99, 235, 0.35);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.1), 0 6px 20px rgba(37, 99, 235, 0.45);
    }
}

.duolingo-node-label {
    margin-top: 0.5rem;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duolingo-node-sub {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* 3. Okuma Takvimi */
.calendar-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
    text-align: center;
}

.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: var(--bg-surface-secondary);
    position: relative;
}

.calendar-day-cell.empty {
    background: transparent;
    border: none;
}

.calendar-day-cell.today {
    border: 2px solid var(--primary);
}

.calendar-day-cell.read-day {
    background: #10b981;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* 4. Popover & Modals */
.reading-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.reading-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    padding: 1.5rem;
}

/* ==========================================================
   5. REHBER TAKİPÇİ & KOORDİNATÖR RESPONSIVE BİLEŞENLER
   ========================================================== */

/* Sekme Navigasyonu (Desktop flex, Tablet/Mobil responsive grid) */
.follower-tabs-container {
    display: flex;
    gap: 0.4rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.follower-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    text-decoration: none;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 42px;
}

.follower-tab-item:hover {
    color: var(--text-primary);
    background: var(--bg-surface-secondary);
}

.follower-tab-item.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 991.98px) {
    .follower-tabs-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        border-bottom: none;
        margin-bottom: 1.25rem;
    }

    .follower-tab-item {
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        background: var(--bg-surface);
        padding: 0.65rem 0.5rem;
        min-height: 44px;
        font-size: 0.8rem;
        white-space: normal;
        line-height: 1.25;
    }

    .follower-tab-item.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #ffffff;
        box-shadow: var(--shadow-sm);
    }
}

@media (max-width: 575.98px) {
    .follower-tabs-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Okuyucu Mobil Kartları */
.mobile-readers-cards {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
}

.mobile-reader-card {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
    transition: background var(--transition-fast);
}

.mobile-reader-card:last-child {
    border-bottom: none;
}

.mobile-reader-card:hover {
    background: var(--bg-surface-secondary);
}

/* Genel Mobil Kart / Öğe Yapısı */
.mobile-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mobile-item-card:last-child {
    margin-bottom: 0;
}

.mobile-item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Sıralama Kürsü (Podium) Mobil Desteği */
.ranking-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}

@media (max-width: 640px) {
    .ranking-podium {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ranking-podium .podium-first {
        order: -1;
        transform: none !important;
    }
}




/* ==========================================================
   PROGRAM & TAKİPÇİ KİTAP AKORDEON DÜZENİ (COMPACT ACCORDION)
   ========================================================== */
.book-accordion-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-accordion-card.is-current-book {
    border: 1.5px solid var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.book-accordion-card.is-completed-book {
    border-color: rgba(16, 185, 129, 0.4);
}

.book-accordion-header {
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    background: var(--bg-surface);
    user-select: none;
    transition: background-color 0.15s ease;
}

.book-accordion-header:hover {
    background-color: var(--bg-surface-secondary);
}

.book-accordion-header:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.book-acc-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.book-acc-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.book-accordion-card.is-current-book .book-acc-number {
    background: var(--primary-light, #eff6ff);
    color: var(--primary);
    border-color: var(--primary);
}

.book-accordion-card.is-completed-book .book-acc-number {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: #10b981;
}

.book-acc-meta {
    min-width: 0;
    flex: 1;
}

.book-acc-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.book-acc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-acc-badge {
    font-size: 0.675rem !important;
    padding: 0.15rem 0.45rem !important;
}

.book-acc-weeks-info {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.book-acc-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.book-acc-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.book-acc-progress-bar {
    width: 80px;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border);
    overflow: hidden;
}

.book-acc-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
}

.book-accordion-card.is-completed-book .book-acc-progress-fill {
    background: #10b981;
}

.book-acc-progress-pct {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

.book-acc-chevron {
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-accordion-card.is-open .book-acc-chevron {
    transform: rotate(180deg);
}

.book-accordion-content {
    border-top: 1px solid var(--border);
    background: var(--bg-surface-secondary);
    padding: 0.75rem 1rem;
    animation: fadeIn 0.15s ease-out;
}

.week-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.week-item:last-child {
    margin-bottom: 0;
}

.week-item.week-done {
    background: var(--bg-surface-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .week-item.week-done {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.week-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.week-order-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-light, #eff6ff);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.week-text-info {
    min-width: 0;
    flex: 1;
}

.week-authentic-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.week-pages {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.week-right {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .book-acc-progress-bar {
        display: none;
    }
    .book-accordion-header {
        padding: 0.75rem 0.85rem;
    }
    .week-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }
    .week-right {
        align-self: flex-end;
    }
}


/* ==========================================================
   YÜZEN BİLDİRİM İZNİ ÖNERİ KARTI (NON-INTRUSIVE FLOATING CARD)
   ========================================================== */
.notif-permission-card {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 350px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.15rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.notif-permission-card.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notif-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 640px) {
    .notif-permission-card {
        bottom: 80px; /* Safe above bottom nav */
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
}

/* Rehber ve genel takipçi çalışma alanları: kompakt, katmanlı, yatay taşmasız düzen. */
.role-workspace-active {
    --role-glow: color-mix(in srgb, var(--primary) 14%, transparent);
}
.role-workspace-active > div:first-child h1 {
    letter-spacing: -.025em;
}
.role-workspace-active .card {
    border-radius: 14px !important;
    border-color: color-mix(in srgb, var(--primary) 14%, var(--border));
    box-shadow: 0 8px 24px -20px rgba(15, 118, 110, .55);
    background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 2.5%, var(--bg-surface)), var(--bg-surface));
}
.role-workspace-active .card-header {
    min-height: 48px;
    padding: .72rem 1rem !important;
    background: color-mix(in srgb, var(--primary) 4%, var(--bg-surface)) !important;
}
.role-workspace-active .card-body {
    padding: .9rem 1rem;
}
.role-workspace-active .follower-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
    gap: .65rem !important;
}
.role-workspace-active .follower-stat-card {
    min-height: 104px;
    padding: .85rem 1rem !important;
    position: relative;
    overflow: hidden;
}
.role-workspace-active .follower-stat-card::after {
    content: '';
    position: absolute;
    width: 58px;
    height: 58px;
    right: -25px;
    bottom: -30px;
    border-radius: 50%;
    background: var(--role-glow);
}
.role-workspace-active .follower-stat-value {
    font-size: 1.45rem !important;
}
.role-workspace-active .table th,
.role-workspace-active .table td {
    padding-top: .65rem;
    padding-bottom: .65rem;
}
.role-collapse-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 32px;
    padding: .25rem .55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}
.role-collapsible-card > .card-body {
    display: block;
}
.role-collapsible-card.is-collapsed > .card-body {
    display: none;
}
.message-sender-name {
    color: var(--primary);
    text-decoration: none;
    font-weight: 750;
}
a.message-sender-name:hover { text-decoration: underline; }
@media (max-width: 767px) {
    .role-workspace-active .mobile-readers-cards {
        padding: .55rem;
        gap: .55rem;
        background: transparent;
    }
    .role-workspace-active .mobile-reader-card {
        padding: .85rem !important;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--bg-surface);
        box-shadow: 0 8px 20px -18px rgba(15, 23, 42, .65);
    }
    .role-workspace-active .mobile-reader-card > div {
        margin-bottom: .6rem !important;
    }
    .role-workspace-active .card-body { padding: .7rem !important; }
    .role-workspace-active .follower-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .role-workspace-active .follower-stat-card { min-height: 94px; }
}
@media (prefers-reduced-motion: reduce) {
    .role-workspace-active *, .streak-card-container * { transition: none !important; animation: none !important; }
}

/* Son katman: eski rol stillerinin kompakt ölçüleri geri büyütmesini engeller. */
body {
    background-image:
        radial-gradient(circle at 8% 4%, color-mix(in srgb, #0891b2 7%, transparent) 0, transparent 24rem),
        radial-gradient(circle at 92% 88%, color-mix(in srgb, #059669 6%, transparent) 0, transparent 28rem);
    background-attachment: fixed;
}

.role-workspace-active .follower-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
    gap: .5rem !important;
    margin-bottom: .8rem !important;
}
.role-workspace-active .follower-stat-card {
    min-height: 0 !important;
    padding: .62rem .78rem !important;
    gap: .15rem !important;
}
.role-workspace-active .follower-stat-label {
    font-size: .72rem !important;
    line-height: 1.25 !important;
}
.role-workspace-active .follower-stat-value {
    font-size: 1.3rem !important;
    line-height: 1.1 !important;
}
.role-workspace-active .follower-stat-sub {
    font-size: .72rem !important;
    line-height: 1.3 !important;
}

@media (max-width: 767px) {
    .role-workspace-active .follower-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .role-workspace-active .follower-stat-card {
        min-height: 78px !important;
        padding: .58rem .68rem !important;
    }
}
