/* ═══════════════════════════════════════════
   AP Courses Manager — Frontend Card Grid
   Identical design to the original widget.
   ═══════════════════════════════════════════ */

:root {
    --csb-navy:  #0f2548;
    --csb-sub:   #6b7280;
    --accent:    #ff7a00;
    --card-bg:   #ffffff;
    --muted:     #f3f4f6;
    --radius:    14px;
    --shadow:    0 8px 30px rgba(17,24,39,0.06);
}

/* ── Wrapper ──────────────────────────────── */
.csb-wrap {
    font-family: 'Poppins', sans-serif;
    max-width: 1260px;
    margin: 20px auto;
    padding: 20px 0;
    box-sizing: border-box;
}

/* ── Heading ──────────────────────────────── */
.csb-head {
    text-align: center;
    margin: 10px 0 18px;
}
.csb-head h2 {
    color: var(--csb-navy);
    font-size: 34px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.05;
}
.csb-head p {
    margin: 0;
    color: var(--csb-sub);
    font-size: 15px;
}

/* ── Grid ─────────────────────────────────── */
.csb-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    margin-top: 18px;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .csb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .csb-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Card ─────────────────────────────────── */
.csb-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.csb-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 36px rgba(17,24,39,0.12);
}

/* Card top — dot + title */
.card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.card-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex: 0 0 16px;
    margin-top: 5px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--csb-navy);
    margin: 0;
    line-height: 1.3;
}

/* Description */
.card-desc {
    margin: 0 0 12px;
    color: #444;
    font-size: 13.5px;
    line-height: 1.45;
    min-height: 52px;
}

/* Badge row */
.card-badges-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.badge-highlight {
    background: var(--muted);
    color: var(--csb-navy);
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-cert {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff4eb;
    color: var(--accent);
    border: 1.5px solid #ffd3a8;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* Footer — duration/rating + CTA */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 8px;
}
.card-duration {
    color: var(--csb-sub);
    font-size: 13px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.card-duration strong {
    color: var(--csb-navy);
    font-weight: 600;
}
.card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Stars */
.card-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 13px;
    line-height: 1;
}
.s-full  { color: #f59e0b; }
.s-empty { color: #d1d5db; }
.s-half {
    position: relative;
    display: inline-block;
    color: #d1d5db;
}
.s-half::before {
    content: '\2605';   /* ★ */
    position: absolute;
    left: 0; top: 0;
    width: 50%;
    overflow: hidden;
    color: #f59e0b;
}

.review-count {
    color: var(--csb-sub);
    font-size: 12px;
}

/* CTA button */
.card-cta {
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 6px 18px rgba(255,122,0,0.18);
    white-space: nowrap;
    display: inline-block;
    transition: background .15s;
}
.card-cta:hover,
.card-cta:focus {
    background: #e86b00;
    color: #fff;
    text-decoration: none;
}
