/* ===== BOOKMARKS PAGE — EduFlame Theme ===== */

/* ---- Hero ---- */
.bk-hero {
    background: linear-gradient(140deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-light) 100%);
    padding: 56px 32px 72px;
    position: relative;
    overflow: hidden;
}

.bk-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.18;
}

.bk-blob-1 {
    width: 380px;
    height: 380px;
    background: var(--accent);
    top: -100px;
    right: 60px;
}

.bk-blob-2 {
    width: 240px;
    height: 240px;
    background: var(--teal);
    bottom: -70px;
    left: -40px;
}

.bk-hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 22px;
}

.bk-hero-icon {
    width: 58px;
    height: 58px;
    background: var(--accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--navy);
}

.bk-hero-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 38px);
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.bk-hero-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ---- Breadcrumb ---- */
.bk-breadcrumb-wrap {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 32px;
}

.bk-breadcrumb {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.bk-breadcrumb a {
    color: var(--text-muted);
    transition: color 0.15s;
}

.bk-breadcrumb a:hover {
    color: var(--accent);
}

.bk-breadcrumb span {
    color: var(--text);
    font-weight: 600;
}

/* ---- Main ---- */
.bk-main {
    flex: 1;
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px 80px;
}

/* ---- Stats bar ---- */
.bk-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.bk-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

/* ---- Toolbar ---- */
.bk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.bk-filter-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    padding: 4px;
    border-radius: 12px;
}

.bk-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-body);
}

.bk-tab.active {
    background: var(--navy);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.bk-tab:not(.active):hover {
    background: var(--bg);
    color: var(--text);
}

.bk-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1.5px solid var(--border-card);
    background: var(--bg-card);
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s, border-color 0.15s;
    box-shadow: var(--shadow-sm);
}

.bk-clear-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ---- Search ---- */
.bk-search-wrap {
    margin-bottom: 20px;
}

.bk-search-inner {
    position: relative;
}

.bk-search-inner svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.bk-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: var(--radius);
    border: 2px solid var(--border-card);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.bk-search-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.bk-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 160, 32, 0.13);
}

/* ---- Grid ---- */
.bk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

/* ---- Card ---- */
.bk-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: bkFadeUp 0.3s ease both;
    position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: var(--shadow-sm);
}

.bk-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.bk-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(232, 160, 32, 0.3);
}

.bk-card:hover::after {
    transform: scaleX(1);
}

/* Card header strip */
.bk-card-strip {
    height: 4px;
    flex-shrink: 0;
}

.bk-strip-video {
    background: linear-gradient(90deg, #1e3a5f, #60a5fa);
}

.bk-strip-pdf {
    background: linear-gradient(90deg, #5a1500, #fb923c);
}

.bk-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.bk-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bk-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bk-icon-video {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

.bk-icon-pdf {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
}

.bk-card-info {
    flex: 1;
    min-width: 0;
}

.bk-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bk-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 0;
}

.bk-meta-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bk-pill-video {
    background: rgba(96, 165, 250, 0.1);
    color: #1d4ed8;
}

.bk-pill-pdf {
    background: rgba(251, 146, 60, 0.1);
    color: #c2410c;
}

.bk-pill-subj {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.bk-card-chapter {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bk-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-card);
    margin-top: auto;
}

.bk-card-date {
    font-size: 11px;
    color: var(--text-light);
}

.bk-card-actions {
    display: flex;
    gap: 6px;
}

.bk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
    border: 1.5px solid transparent;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.bk-btn-open {
    background: var(--accent);
    color: var(--navy);
    border-color: var(--accent);
}

.bk-btn-open:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.bk-btn-remove {
    background: var(--bg-card);
    color: var(--text-light);
    border-color: var(--border-card);
}

.bk-btn-remove:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* ---- Skeleton ---- */
.bk-skeleton {
    height: 190px;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes bkFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Empty state ---- */
.bk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 72px 24px;
    gap: 14px;
}

.bk-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.bk-empty h2 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text);
    margin: 0;
}

.bk-empty p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    max-width: 300px;
}

/* ---- Modal ---- */
.bk-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.bk-modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: bkFadeUp 0.22s ease both;
}

.bk-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bk-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.bk-modal-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.bk-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

.bk-modal-cancel {
    padding: 9px 20px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
}

.bk-modal-cancel:hover {
    background: var(--bg);
}

.bk-modal-confirm {
    padding: 9px 20px;
    border-radius: var(--radius);
    border: none;
    background: #ef4444;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s;
}

.bk-modal-confirm:hover {
    background: #dc2626;
}

/* ---- Toast ---- */
.bk-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--navy);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 13px 22px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.bk-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .bk-hero {
        padding: 44px 20px 56px;
    }

    .bk-breadcrumb-wrap {
        padding: 10px 20px;
    }

    .bk-main {
        padding: 24px 16px 60px;
    }
}

@media (max-width: 480px) {
    .bk-hero {
        padding: 36px 16px 48px;
    }

    .bk-hero-icon {
        width: 48px;
        height: 48px;
    }

    .bk-grid {
        grid-template-columns: 1fr;
    }

    .bk-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bk-filter-tabs {
        width: 100%;
    }

    .bk-tab {
        flex: 1;
        justify-content: center;
    }

    .bk-clear-btn {
        width: 100%;
        justify-content: center;
    }
}