/* ═══════════════════════════════════════════════════════════════
   ehr_fauxstrap.css — Bootstrap class replacements
   Load order: 2 (after ehr_base.css, before everything else)
   Only includes classes actually used in the eHR codebase.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Collapse ─── */
/* Bootstrap collapse: hidden by default, shown with .show or JS */
.collapse:not(.show) {
    display: none;
}
.collapse.show {
    display: block;
}
.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* ─── List Unstyled ─── */
.list-unstyled {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-info {
    color: #fff;
    background-color: #0c420c;
    border-color: #0c420c;
}

.btn-info:hover {
    background-color: #1a5e1a;
    border-color: #1a5e1a;
}

.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:hover {
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-primary {
    color: #fff;
    background-color: #0c420c;
    border-color: #0c420c;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-lg {
    padding: 10px 16px;
    font-size: 18px;
    border-radius: 6px;
}

/* ─── Dropdown Toggle ─── */
.dropdown-toggle {
    position: relative;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.3em;
    vertical-align: 0.15em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* ─── Flex Utilities ─── */
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }

.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

/* ─── Spacing Utilities ─── */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }

/* ─── Text Utilities ─── */
.text-center { text-align: center; }
.text-left, .text-start { text-align: left; }
.text-right, .text-end { text-align: right; }
.fw-bold, .font-weight-bold { font-weight: 700; }
.text-muted { color: #6c757d; }

/* ─── Width ─── */
.w-100 { width: 100%; }
.w-50 { width: 50%; }
.w-auto { width: auto; }

/* ─── Table ─── */
.table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    vertical-align: middle;
}

.table th,
.table td {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ─── Card ─── */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 4px;
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* ─── Popover ─── */
.popover {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1070;
    max-width: 276px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.popover-header {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ebebeb;
    border-radius: 4px 4px 0 0;
}

.popover-body {
    padding: 0.5rem 0.75rem;
    color: #212529;
}

/* ─── Alert ─── */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* ─── Form Controls ─── */
.form-control {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: #0c420c;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(12, 66, 12, 0.2);
}

/* ─── Visibility ─── */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ─── Float ─── */
.float-left, .float-start { float: left; }
.float-right, .float-end { float: right; }
.clearfix::after {
    display: block;
    clear: both;
    content: "";
}

/* ─── Container ─── */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* ─── Row / Col (minimal grid) ─── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ─── Badge ─── */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}
