:root {
    --cbt-primary: #0b78d1;
    --cbt-success: #10b981;
    --cbt-bg-soft: #f8fafc;
    --cbt-text-main: #0f172a;
    --cbt-text-muted: #64748b;
    --cbt-border-light: #e2e8f0;
    --cbt-surface: #ffffff;
}

.cbt-test-series-wrapper {
    --cbt-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --cbt-card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.cbt-test-series-wrapper.ts-full {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.cbt-test-series-wrapper .ts-head {
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--cbt-border-light);
    margin-bottom: 24px;
}

.cbt-test-series-wrapper .ts-breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--cbt-text-muted);
}

.cbt-test-series-wrapper .ts-breadcrumbs a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.cbt-test-series-wrapper .ts-breadcrumbs a:hover {
    color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-breadcrumbs span {
    font-weight: 600;
    color: var(--cbt-text-main);
}

.cbt-test-series-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cbt-text-main);
    letter-spacing: -0.025em;
}

.cbt-test-series-wrapper .ts-count {
    font-weight: 600;
    color: var(--cbt-text-muted);
}

.cbt-test-series-wrapper .ts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.cbt-test-series-wrapper .ts-card {
    border: 1px solid var(--cbt-border-light);
    border-radius: 20px;
    padding: 28px;
    background: var(--cbt-surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--cbt-card-shadow);
    position: relative;
    overflow: hidden;
}

.cbt-test-series-wrapper .ts-card:hover {
    box-shadow: var(--cbt-card-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cbt-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cbt-test-series-wrapper .ts-card:hover::before {
    opacity: 1;
}

.cbt-test-series-wrapper .ts-title {
    font-weight: 800;
    margin: 0;
    font-size: 1.25rem;
    color: var(--cbt-text-main);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.cbt-test-series-wrapper .ts-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cbt-test-series-wrapper .ts-chip {
    background: var(--cbt-bg-soft);
    border: 1px solid var(--cbt-border-light);
    border-radius: 10px;
    padding: 6px 12px;
    font-weight: 700;
    color: var(--cbt-text-muted);
    font-size: 0.85rem;
    display: inline-flex;
    /* FIXED: Was flex, causing full width block behavior */
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

.cbt-test-series-wrapper .ts-chip.primary {
    background: var(--cbt-success, #10b981);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 99px;
}

.cbt-test-series-wrapper .ts-chip.secondary {
    background: var(--cbt-border-light, #e2e8f0);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 99px;
}

.cbt-test-series-wrapper .ts-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    gap: 12px;
    border-top: 1px dashed var(--cbt-border-light);
}

.cbt-test-series-wrapper .ts-attempted {
    color: var(--cbt-success);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* List View Styles (Tests) */
.cbt-test-series-wrapper .ts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cbt-test-series-wrapper .ts-row {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
}

.cbt-test-series-wrapper .ts-row.locked {
    background: #fff5f5;
    border-color: #fee2e2;
}

.cbt-test-series-wrapper .ts-row:hover {
    border-color: var(--cbt-primary);
    background: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cbt-test-series-wrapper .ts-row-info {
    flex: 1;
}

.cbt-test-series-wrapper .ts-row-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
    transition: color 0.2s;
}

.cbt-test-series-wrapper .ts-row:hover .ts-row-title {
    color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-row-title .ts-chip {
    margin-left: 8px;
}

.cbt-test-series-wrapper .ts-row-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    gap: 12px;
    align-items: center;
}

.cbt-test-series-wrapper .ts-row-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cbt-test-series-wrapper .ts-row-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cbt-test-series-wrapper .ts-row .cbt-button {
    pointer-events: auto;
    /* Let the row handle clinical if it's a link */
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 8px;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.cbt-test-series-wrapper .ts-row .ts-view-results {
    pointer-events: auto;
    /* Allow clicking results button separately */
    background: #f1f5f9;
    color: #475569;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cbt-test-series-wrapper .ts-row .ts-view-results:hover {
    background: #e2e8f0;
    color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-row-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--cbt-primary);
    font-size: 1.2rem;
}

.cbt-test-series-wrapper .ts-row:hover .ts-row-arrow {
    opacity: 1;
    transform: translateX(0);
}

.cbt-test-series-wrapper .ts-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}

.cbt-test-series-wrapper .ts-page,
.cbt-test-series-wrapper .page-numbers {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cbt-border-light);
    border-radius: 12px;
    background: var(--cbt-surface);
    text-decoration: none;
    font-weight: 700;
    color: var(--cbt-text-main);
    transition: all 0.2s ease;
}

.cbt-test-series-wrapper .ts-page:hover,
.cbt-test-series-wrapper .page-numbers:hover {
    background: var(--cbt-bg-soft);
    border-color: var(--cbt-primary);
    color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-page.active,
.cbt-test-series-wrapper .page-numbers.current {
    background: var(--cbt-primary);
    color: #fff;
    border-color: var(--cbt-primary);
    box-shadow: 0 4px 12px rgba(11, 120, 209, 0.2);
}

.cbt-test-series-wrapper .cbt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    flex: 1;
}

.cbt-test-series-wrapper .cbt-button.primary {
    background: var(--cbt-primary);
    color: #fff;
}

.cbt-test-series-wrapper .cbt-button.secondary {
    background: var(--cbt-bg-soft);
    border: 1px solid var(--cbt-border-light);
    border-radius: 8px;
    color: var(--cbt-text-main);
}

/* Overview Grid (Categories) Styles */
.cbt-test-series-wrapper .ts-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.cbt-test-series-wrapper .ts-cat-card {
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--cbt-border-light);
    background: var(--cbt-surface);
    padding: 32px 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--cbt-card-shadow);
    position: relative;
}

.cbt-test-series-wrapper .ts-cat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--cbt-card-shadow-hover);
    border-color: var(--cbt-primary);
}

.cbt-test-series-wrapper .ts-cat-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--cbt-primary);
    transition: transform 0.3s ease;
}

.cbt-test-series-wrapper .ts-cat-card:hover .ts-cat-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.cbt-test-series-wrapper .ts-cat-card h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cbt-text-main);
    line-height: 1.3;
}

.cbt-test-series-wrapper .ts-explore-label {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cbt-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.cbt-test-series-wrapper .ts-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--cbt-muted);
}

.cbt-test-series-wrapper .ts-row-performance {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.cbt-test-series-wrapper .ts-perf-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    transition: transform 0.2s ease;
}

.cbt-test-series-wrapper .ts-perf-item:hover {
    transform: translateY(-1px);
}

.cbt-test-series-wrapper .ts-perf-score {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.cbt-test-series-wrapper .ts-perf-correct {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.cbt-test-series-wrapper .ts-perf-wrong {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.cbt-test-series-wrapper .ts-perf-accuracy {
    background: #faf5ff;
    color: #9333ea;
    border: 1px solid #f3e8ff;
}

.cbt-test-series-wrapper .ts-cat-card:hover .ts-explore-label {
    opacity: 1;
}

.cbt-test-series-wrapper .ts-cat-card .ts-arrow {
    transition: transform 0.3s ease;
}

.cbt-test-series-wrapper .ts-cat-card:hover .ts-arrow {
    transform: translateX(4px);
}

/* Added for Test Series Subcategory Meta */
.cbt-test-series-wrapper .ts-cat-meta {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cbt-test-series-wrapper .ts-breadcrumbs .sep {
    margin: 0 4px;
}

.cbt-test-series-wrapper .ts-count {
    margin-bottom: 1rem;
}