/* Biznopedia site styles */

/* Header */
.cdl-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.cdl-header .navbar-brand {
    font-size: 1.1rem;
    color: #212b37;
}

.cdl-header .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.15s;
}

.cdl-header .nav-link:hover,
.cdl-header .nav-link.active {
    color: var(--cdl-brand);
    background: color-mix(in srgb, var(--cdl-brand) 5%, transparent);
}

/* Footer */
.cdl-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Main content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Hero */
.cdl-hero {
    background: linear-gradient(135deg, var(--cdl-hero-grad-start) 0%, var(--cdl-hero-grad-mid) 55%, var(--cdl-hero-grad-end) 100%);
    color: #fff;
    border-radius: 0.75rem;
}

.cdl-hero .hero-sub {
    color: rgba(255, 255, 255, 0.85);
    max-width: 640px;
}

.cdl-hero .form-control {
    border: none;
    height: 3rem;
}

/* Translucent stat boxes inside the hero (Bootstrap build lacks bg-opacity utilities) */
.hero-stat {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 0.5rem;
    padding: 1rem;
}

.hero-stat .hero-stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.8);
}

.hero-stat .hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* Stat tiles */
.stat-tile {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    height: 100%;
}

.stat-tile .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stat-tile .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212b37;
    line-height: 1.2;
}

.stat-tile .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: color-mix(in srgb, var(--cdl-brand) 10%, transparent);
    color: var(--cdl-brand);
}

/* Cards */
.custom-card {
    border-radius: 0.5rem;
    transition: box-shadow 0.15s;
}

.custom-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08) !important;
}

a.custom-card:hover {
    text-decoration: none;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.75rem 1rem;
}

/* Grade badges (A-F) */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.grade-a { background: rgba(31, 169, 126, 0.12); color: #157f5e; }
.grade-b { background: color-mix(in srgb, var(--cdl-brand) 12%, transparent); color: var(--cdl-brand); }
.grade-c { background: rgba(232, 147, 12, 0.14); color: #b26f04; }
.grade-d { background: rgba(232, 147, 12, 0.22); color: #8f5903; }
.grade-e { background: rgba(251, 66, 66, 0.12); color: #cf2626; }
.grade-f { background: rgba(251, 66, 66, 0.2); color: #a61b1b; }
.grade-none { background: rgba(108, 117, 125, 0.1); color: #6c757d; }

/* Percentile bar */
.percentile-bar {
    height: 8px;
    border-radius: 4px;
    background: #eef0f3;
    overflow: hidden;
}

.percentile-bar .percentile-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--cdl-brand);
}

/* Badge variants with transparency */
.bg-primary-transparent {
    background-color: color-mix(in srgb, var(--cdl-brand) 10%, transparent) !important;
    color: var(--cdl-brand) !important;
}

.bg-success-transparent {
    background-color: rgba(33, 206, 158, 0.1) !important;
    color: #1aa67d !important;
}

.bg-warning-transparent {
    background-color: rgba(255, 198, 136, 0.15) !important;
    color: #d4860a !important;
}

.bg-danger-transparent {
    background-color: rgba(251, 66, 66, 0.1) !important;
    color: #e63030 !important;
}

.bg-info-transparent {
    background-color: rgba(23, 162, 184, 0.1) !important;
    color: #138496 !important;
}

.bg-secondary-transparent {
    background-color: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d !important;
}

/* Font size utility */
.fs-11 {
    font-size: 0.6875rem !important;
}

/* Primary light button */
.btn-primary-light {
    background: color-mix(in srgb, var(--cdl-brand) 10%, transparent);
    color: var(--cdl-brand);
    border: none;
}

.btn-primary-light:hover {
    background: color-mix(in srgb, var(--cdl-brand) 20%, transparent);
    color: var(--cdl-brand-deep);
}

/* Table styling */
.table > thead > tr > th {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6c757d;
    padding: 0.625rem 0.75rem;
}

.table > tbody > tr > td {
    padding: 0.625rem 0.75rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

.table > tbody > tr:hover {
    background-color: color-mix(in srgb, var(--cdl-brand) 2%, transparent);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--cdl-brand);
}

/* Pagination */
.page-link {
    color: var(--cdl-brand);
    border-color: #e9ecef;
    font-size: 0.875rem;
}

.page-item.active .page-link {
    background-color: var(--cdl-brand);
    border-color: var(--cdl-brand);
}

/* Scroll to top */
.scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--cdl-brand);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--cdl-brand) 30%, transparent);
    z-index: 999;
    transition: opacity 0.2s;
}

.scrollToTop.visible {
    display: flex;
}

/* Section headings */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212b37;
}

.section-sub {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Horizontal-scroll affordance on responsive tables: right-edge fade + slim scrollbar
   so clipped columns clearly read as "swipe to see more", not broken. */
.table-responsive {
    position: relative;
    scrollbar-width: thin;
    background-image: linear-gradient(to left, rgba(33, 43, 55, 0.10), rgba(33, 43, 55, 0) 24px);
    background-position: right center;
    background-repeat: no-repeat;
    background-size: 24px 100%;
    background-attachment: scroll;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--cdl-brand) 35%, transparent);
    border-radius: 3px;
}

/* Center short auth/utility cards in the viewport instead of top-anchoring them */
.auth-wrap {
    min-height: calc(100vh - 340px);
    display: flex;
    align-items: center;
}

.auth-wrap > .row,
.auth-wrap > div {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-header h5,
    .card-header h6 {
        font-size: 0.9rem;
    }

    .container-xl {
        padding-left: 12px;
        padding-right: 12px;
    }

    .cdl-hero {
        border-radius: 0;
    }
}
