/*
 * MyPassLMS Dashboard Components CSS
 * Shared styling for dashboard stats banners, tables, and components
 */

/* ── Global breadcrumbs (rendered by /js/breadcrumbs.js) ───────────── */
.mp-breadcrumbs {
    display: flex; align-items: center; flex-wrap: wrap;
    padding: .55rem 1.125rem;
    margin: 0 0 .5rem 0;
    background: linear-gradient(to bottom, #fafbfc, #ffffff);
    border-bottom: 1px solid #eef0f3;
    font-size: .8125rem;
    color: #6b7280;
    gap: .35rem;
    line-height: 1.2;
}
.mp-breadcrumbs:empty { display: none; }

/* Clickable intermediate node */
.mp-breadcrumbs .mpbc-link {
    color: var(--mp-primary, var(--primary-color, #667eea));
    text-decoration: none;
    cursor: pointer;
    padding: .15rem .4rem;
    border-radius: 4px;
    transition: background-color .15s ease, color .15s ease;
    display: inline-flex; align-items: center;
}
.mp-breadcrumbs .mpbc-link:hover {
    background: rgba(99, 102, 241, .08);
    color: var(--mp-accent, var(--mp-primary, #4f46e5));
    text-decoration: none;
}

/* Non-clickable intermediate node (category label like "Setup", "Compliance Hub") */
.mp-breadcrumbs .mpbc-cat {
    color: #9aa3b2;
    padding: .15rem .15rem;
    display: inline-flex; align-items: center;
}

/* Current page (last segment) */
.mp-breadcrumbs .mpbc-cur {
    color: #111827;
    font-weight: 600;
    padding: .15rem .15rem;
    display: inline-flex; align-items: center;
}

/* Separator */
.mp-breadcrumbs .mpbc-sep {
    color: #d4d7dd;
    font-weight: 300;
    user-select: none;
    margin: 0 .1rem;
}

/* Inline icon (e.g., home icon on root) */
.mp-breadcrumbs .mpbc-icon {
    font-size: .95rem;
    margin-right: .35rem;
    opacity: .85;
}


:root {
    --primary-color: #06b6d4;
    --primary-dark: #0891b2;
    --primary-light: #22d3ee;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-bg: #fafafa;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Banner Stats Layout - 2026-04-23 refinement
   Design cues from the reference Admin Dashboard:
   - Connected KPI strip feel (tighter internal padding, thinner dividers)
   - More refined typography: smaller uppercase labels, tabular numerics
   - Subtle hover state per metric
   - Lower visual weight (lighter shadow) */
.banner-stats {
    background: white;
    padding: 0;
    border-radius: 12px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 1.25rem;
    border: 1px solid #e5e9f0;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.03);
}

.banner-metric {
    text-align: left;
    flex: 1;
    position: relative;
    padding: 0.875rem 1rem;
    min-width: 0;
    transition: background-color 0.15s ease;
}

.banner-metric:hover {
    background-color: #f7f8fb;
}

.banner-metric:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: #eef1f6;
}

.banner-metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    line-height: 1.1;
    color: #0f172a;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.banner-metric-label {
    font-size: 0.625rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.banner-metric-label i {
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.banner-metric-change {
    font-size: 0.625rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    flex-wrap: nowrap;
}

.banner-metric-change > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.banner-metric-change .trend-up {
    color: #059669;
    background: color-mix(in srgb, #10b981 12%, transparent);
    font-weight: 500;
    font-size: 0.625rem;
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 1px 5px 1px 4px;
    border-radius: 99px;
    flex-shrink: 0;
    line-height: 1.4;
}

.banner-metric-change .trend-down {
    color: #dc2626;
    background: color-mix(in srgb, #ef4444 12%, transparent);
    font-weight: 500;
    font-size: 0.625rem;
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 1px 5px 1px 4px;
    border-radius: 99px;
    flex-shrink: 0;
    line-height: 1.4;
}

.banner-metric-change .trend-up i,
.banner-metric-change .trend-down i {
    font-size: 0.75rem;
}

.banner-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 0.875rem;
}

.banner-actions .dropdown-toggle {
    background: rgb(var(--bs-primary-rgb));
    border: 1px solid rgb(var(--bs-primary-rgb));
    color: #ffffff;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: -0.005em;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
    backdrop-filter: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.banner-actions .dropdown-toggle i {
    font-size: 0.875rem;
    color: #ffffff;
    opacity: 0.9;
}

.banner-actions .dropdown-toggle:hover,
.banner-actions .dropdown-toggle.show {
    background: rgb(var(--bs-primary-rgb));
    border-color: rgb(var(--bs-primary-rgb));
    color: #ffffff;
    filter: brightness(0.92);
    transform: none;
    box-shadow: none;
}

.banner-actions .dropdown-toggle:focus,
.banner-actions .dropdown-toggle:focus-visible {
    background: rgb(var(--bs-primary-rgb));
    border-color: rgb(var(--bs-primary-rgb));
    color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25);
}

.banner-actions .dropdown-toggle::after {
    margin-left: 0.375rem;
    border-top-color: #ffffff;
    opacity: 0.7;
    vertical-align: 0.15em;
}

.banner-actions .dropdown-menu {
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    padding: 0.375rem;
    margin-top: 0.375rem;
    background: #ffffff;
    backdrop-filter: none;
    min-width: 200px;
}

.banner-actions .dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease;
    color: #334155;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.banner-actions .dropdown-item:hover,
.banner-actions .dropdown-item:focus {
    background: #f1f3f8;
    color: #0f172a;
    transform: none;
}

.banner-actions .dropdown-item i {
    width: 16px;
    font-size: 0.875rem;
    color: #64748b;
    transition: color 0.12s ease;
    flex-shrink: 0;
}

.banner-actions .dropdown-item:hover i,
.banner-actions .dropdown-item:focus i {
    color: rgb(var(--bs-primary-rgb));
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .banner-stats {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .banner-metric::after {
        display: none;
    }
    
    .banner-metric-value {
        font-size: 1.75rem;
    }
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: visible;
    margin-top: 1rem;
}

/* Fix for dropdown cutoff in responsive tables */
.table-container .table-responsive {
    overflow: visible;
}

.table-container .dataTables_wrapper {
    overflow: visible;
}

/* Table Styling */
.table {
    margin: 0;
}

.table thead th {
    background: #f8fafc;
    border: none;
    font-weight: 600;
    color: #374151;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

.table tbody td {
    padding: 1rem 1.5rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Course ID Badge */
.course-id {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Course Type Badge */
.course-type {
    background: #e0f2fe;
    color: #0277bd;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Progress Bar */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-container {
    position: relative;
    background: #d1d5db;
    height: 24px;
    border-radius: 6px;
    flex: 1;
    overflow: hidden;
    min-width: 120px;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.progress-started {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    transition: all 0.3s ease;
}

.progress-label {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.progress-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 45px;
    text-align: left;
}

.progress-icon {
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 2px;
}

.progress-icon:hover {
    color: #4f46e5;
}

/* Action Dropdown */
.action-dropdown .dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.125rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.action-dropdown .dropdown-toggle:hover {
    background: #f0fdfa;
    color: var(--primary-color);
}

.action-dropdown .dropdown-toggle::after {
    display: none;
}

.action-dropdown .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    position: absolute;
    z-index: 1050;
}

.action-dropdown .dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.action-dropdown .dropdown-item:hover {
    background: #f0fdfa;
    color: var(--primary-color);
}

.action-dropdown .dropdown-item i {
    width: 16px;
}

/* Custom DataTables Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border-color: var(--border-color);
}

.dataTables_wrapper .dataTables_filter {
    display: block;
}

.dataTables_wrapper .dataTables_length {
    display: block;
}

/* Mobile Table Adjustments */
@media (max-width: 768px) {
    .table-container {
        border-radius: 8px;
    }
}

/* Compliance Hub fix (2026-05-24): the page-content is flex with sidebar +
 * content-inner; content-inner was sized to 1300px which left a ~350px empty
 * right strip on wide screens. Make it flex-fill so compliance dashboards
 * use the full available width.
 */
.content-inner { flex: 1 1 auto !important; min-width: 0 !important; }
