/* MC-239 Sum Drive — bold, colorful library UI. Scoped under #sumDrive / #sumViewerModal. */

/* ---- Degree accent palette ---- */
:root {
    --sum-deg1-a: #2563eb; --sum-deg1-b: #1e40af; --sum-deg1-soft: #e0e7ff;
    --sum-deg2-a: #f59e0b; --sum-deg2-b: #b45309; --sum-deg2-soft: #fef3c7;
    --sum-deg3-a: #14b8a6; --sum-deg3-b: #0f766e; --sum-deg3-soft: #ccfbf1;
    --sum-degx-a: #64748b; --sum-degx-b: #334155; --sum-degx-soft: #e2e8f0;
}

#sumDrive {
    direction: rtl;
    text-align: right;
    padding-bottom: 3rem;
}

/* ---- Hero ---- */
#sumDrive .sum-hero {
    background: linear-gradient(120deg, #4f46e5 0%, #2563eb 45%, #06b6d4 100%);
    border-radius: 24px;
    padding: 2.5rem 1.5rem 2rem;
    margin: 1.5rem 0;
    text-align: center;
    color: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}
#sumDrive .sum-hero h1 { font-weight: 800; font-size: 2.2rem; margin: 0 0 0.4rem; }
#sumDrive .sum-hero-sub { font-size: 1.05rem; opacity: 0.9; margin: 0 0 1.5rem; }
#sumDrive .sum-search-bar { position: relative; max-width: 620px; margin: 0 auto; }
#sumDrive .sum-search-bar .bi {
    position: absolute; top: 50%; transform: translateY(-50%);
    right: 1.1rem; color: #94a3b8; font-size: 1.1rem;
}
#sumDrive .sum-search-bar input {
    border: none; border-radius: 50px; padding: 0.9rem 3rem 0.9rem 1.25rem;
    font-size: 1.05rem; width: 100%; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
#sumDrive .sum-search-bar input:focus { outline: 3px solid rgba(255, 255, 255, 0.5); }

/* ---- Toolbar + filters ---- */
#sumDrive .sum-toolbar {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
    align-items: center; justify-content: flex-end; margin-bottom: 1rem;
}
#sumDrive .sum-filters {
    background: #fff; border-radius: 16px; padding: 1rem 1.25rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); margin-bottom: 1.25rem;
}
#sumDrive .form-select:disabled { background: #f1f5f9; color: #94a3b8; }

/* ---- Active filter chips ---- */
#sumDrive .sum-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
#sumDrive .sum-chip {
    display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
    background: #eef2ff; color: #3730a3; border-radius: 50px;
    padding: 0.3rem 0.8rem; font-size: 0.85rem; font-weight: 600; transition: background 0.15s;
}
#sumDrive .sum-chip:hover { background: #e0e7ff; }
#sumDrive .sum-chip .bi { font-size: 0.8rem; }

#sumDrive .sum-result-count { color: #64748b; font-size: 0.95rem; margin-bottom: 0.75rem; font-weight: 600; }

/* ---- Card grid ---- */
#sumDrive .sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
#sumDrive .sum-card {
    background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#sumDrive .sum-card:hover { transform: translateY(-8px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18); }

/* colorful thumbnail, tinted per degree */
#sumDrive .sum-card-thumb {
    height: 150px; display: flex; align-items: center; justify-content: center; position: relative;
    color: #fff; font-size: 4rem;
    background: linear-gradient(135deg, var(--sum-degx-a), var(--sum-degx-b));
}
#sumDrive .sum-card.deg-1 .sum-card-thumb { background: linear-gradient(135deg, var(--sum-deg1-a), var(--sum-deg1-b)); }
#sumDrive .sum-card.deg-2 .sum-card-thumb { background: linear-gradient(135deg, var(--sum-deg2-a), var(--sum-deg2-b)); }
#sumDrive .sum-card.deg-3 .sum-card-thumb { background: linear-gradient(135deg, var(--sum-deg3-a), var(--sum-deg3-b)); }
#sumDrive .sum-card-thumb::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 60%);
}
#sumDrive .sum-card-thumb .bi { position: relative; z-index: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)); }

#sumDrive .sum-card-save {
    position: absolute; top: 10px; left: 10px; z-index: 2; border: none; border-radius: 50%;
    width: 38px; height: 38px; background: rgba(255, 255, 255, 0.92); color: #2563eb;
    font-size: 1.15rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}
#sumDrive .sum-card-save:hover { transform: scale(1.12); }
#sumDrive .sum-card-save.saved { color: #f59e0b; }
#sumDrive .sum-page-badge {
    position: absolute; bottom: 10px; left: 10px; z-index: 2;
    background: rgba(0, 0, 0, 0.45); color: #fff; border-radius: 50px;
    padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 600;
}

#sumDrive .sum-card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
#sumDrive .sum-card-title {
    font-weight: 700; font-size: 1.05rem; color: #1e293b; margin-bottom: 0.5rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
#sumDrive .sum-degree-pill {
    align-self: flex-start; border-radius: 50px; padding: 0.2rem 0.7rem;
    font-size: 0.75rem; font-weight: 700; margin-bottom: 0.5rem;
    background: var(--sum-degx-soft); color: var(--sum-degx-b);
}
#sumDrive .sum-card.deg-1 .sum-degree-pill { background: var(--sum-deg1-soft); color: var(--sum-deg1-b); }
#sumDrive .sum-card.deg-2 .sum-degree-pill { background: var(--sum-deg2-soft); color: var(--sum-deg2-b); }
#sumDrive .sum-card.deg-3 .sum-degree-pill { background: var(--sum-deg3-soft); color: var(--sum-deg3-b); }
#sumDrive .sum-card-meta { color: #64748b; font-size: 0.85rem; margin-bottom: 0.75rem; }
#sumDrive .sum-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
#sumDrive .sum-open-btn {
    background: linear-gradient(135deg, #2563eb, #4f46e5); border: none; color: #fff;
    border-radius: 50px; padding: 0.4rem 1.1rem; font-size: 0.9rem; font-weight: 600;
    transition: filter 0.15s, transform 0.15s;
}
#sumDrive .sum-open-btn:hover { filter: brightness(1.08); transform: translateX(-2px); color: #fff; }

/* ---- Rating stars (cards) ---- */
#sumDrive .sum-stars { color: #f59e0b; font-size: 0.95rem; white-space: nowrap; direction: ltr; display: inline-flex; align-items: center; gap: 2px; }
#sumDrive .sum-stars .rating-num { color: #1e293b; font-weight: 700; font-size: 0.85rem; margin-inline-start: 4px; }
#sumDrive .sum-stars .count { color: #94a3b8; font-size: 0.78rem; margin-inline-start: 2px; }

/* ---- Skeleton loading ---- */
#sumDrive .sum-skeleton .sum-card-thumb { background: #e2e8f0; }
#sumDrive .sum-skeleton .sum-card-thumb, #sumDrive .sk-line { position: relative; overflow: hidden; }
#sumDrive .sk-line { height: 0.8rem; border-radius: 6px; background: #e2e8f0; margin-bottom: 0.55rem; }
#sumDrive .sk-line.lg { height: 1.1rem; width: 90%; }
#sumDrive .sk-line.sm { width: 55%; }
#sumDrive .sum-skeleton .sum-card-thumb::before, #sumDrive .sk-line::before {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: sumShimmer 1.3s infinite;
}
@keyframes sumShimmer { 100% { transform: translateX(100%); } }

/* ---- Empty / loading states ---- */
#sumDrive .sum-state { text-align: center; padding: 3.5rem 1rem; color: #94a3b8; }
#sumDrive .sum-state .bi { font-size: 3.5rem; display: block; margin-bottom: 1rem; opacity: 0.5; }

/* ---- Viewer modal ---- */
#sumViewerModal .modal-dialog { max-width: 95vw; }
#sumViewerModal .modal-body { display: flex; }
#sumViewerModal .sum-viewer-frame { width: 100%; height: 100%; min-height: 60vh; border: none; background: #525659; }

/* Page is RTL but Bootstrap is loaded LTR, so move the header close button to the physical left. */
#sumViewerModal .modal-header .btn-close { margin-left: 0; margin-right: auto; }

/* Rating widget in the modal (outside #sumDrive scope, so it needs its own styling). */
#sumViewerModal .sum-rate-stars { display: inline-flex; align-items: center; gap: 3px; }
#sumViewerModal .sum-rate-stars i { cursor: pointer; font-size: 1.7rem; color: #f59e0b; transition: transform 0.1s ease; }
#sumViewerModal .sum-rate-stars i:hover { transform: scale(1.15); }
#sumViewerModal .sum-rate-label { color: #2a2b3f; font-weight: 600; font-size: 0.95rem; margin-inline-end: 8px; }
