/**
 * Title: CSS Utility Classes
 * 
 * Purpose:
 * - Provide atomic, reusable layout and spacing classes (flexbox, margins, paddings, sizing).
 * 
 * Why / Why this design:
 * - DRY Principle (Don't Repeat Yourself): Prevents duplicating common layout logic across multiple component stylesheets.
 * - Promotes composition: Developers can assemble complex layouts in HTML without writing custom CSS.
 * 
 * Teaching notes:
 * - Always check this file for an existing utility class before creating custom layout rules in other CSS files.
 */
.display-flex {
    display: flex;
}
.justify-content-center {
    justify-content: center;
}
.align-items-center {
    align-items: center;
}
.align-items-start {
    align-items: flex-start;
}
.align-items-end {
    align-items: flex-end;
}
.flex-wrap {
    flex-wrap: wrap !important;
}
.min-height-100dvh {
    min-height: 100vh;
    min-height: 100dvh;
}
.margin-none { margin: 0 !important; }
.padding-none { padding: 0 !important; }
.margin-top-none { margin-top: 0 !important; }
.margin-bottom-none { margin-bottom: 0 !important; }
.padding-top-5vh { padding-top: 5vh; }
.padding-top-10vh { padding-top: 10vh; }
.padding-top-15vh { padding-top: 15vh; }
.margin-top-large { margin-top: 1.5rem; }
.margin-top-xlarge { margin-top: 3rem; }
.margin-bottom-medium { margin-bottom: 1rem; }
.margin-bottom-large { margin-bottom: 1.5rem; }
.margin-bottom-xlarge { margin-bottom: 2.5rem; }
.margin-right-small { margin-right: 0.5rem !important; }
.flex-direction-column { flex-direction: column; }
.position-absolute { position: absolute !important; }
.position-relative { position: relative !important; }
.position-fixed { position: fixed !important; }
.z-index-modal { z-index: 9999 !important; }
.position-top-none { top: 0; }
.position-bottom-none { bottom: 0; }
.position-right-none { right: 0; }
.position-left-none { left: 0; }
.width-full { width: 100% !important; }
.max-width-600px { max-width: 600px; }
.padding-small { padding: 0.5rem; }
.padding-vertical-small { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.padding-medium { padding: 1rem; }
.padding-large { padding: 1.5rem; }
.padding-horizontal-medium { padding-left: 1rem; padding-right: 1rem; }
.text-decoration-none { text-decoration: none !important; }
.flex-grow-1 { flex: 1 !important; }
.text-align-right { text-align: right; }
.text-align-left { text-align: left; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.cursor-pointer { cursor: pointer; }
.margin-top-auto { margin-top: auto !important; }

/* Brand Colors */
.text-neutral-500 { color: var(--neutral-500) !important; }
.text-neutral-600 { color: var(--neutral-600) !important; }
.text-neutral-700 { color: var(--neutral-700) !important; }
.text-neutral-800 { color: var(--neutral-800) !important; }
.text-neutral-900 { color: var(--neutral-900) !important; }
.text-brand-primary { color: var(--brand-primary) !important; }
.background-brand-primary { background-color: var(--brand-primary) !important; }
.text-brand-cream { color: var(--brand-cream) !important; }
.background-brand-cream { background-color: var(--brand-cream) !important; }
.text-brand-grey { color: var(--brand-grey) !important; }
.text-brand-highlight { color: var(--brand-highlight) !important; }
.text-brand-accent { color: var(--brand-accent) !important; }
.background-brand-highlight { background-color: var(--brand-highlight) !important; }
.display-none { display: none !important; }
.hidden { display: none !important; }
.background-transparent { background-color: transparent !important; }
.border-none { border: none !important; }

/* Shorthand utility aliases */
.bg-neutral-200 { background-color: var(--neutral-200) !important; }
.bg-neutral-100 { background-color: var(--neutral-100) !important; }
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.padding-x-md, .padding-x-medium { padding-left: 1rem !important; padding-right: 1rem !important; }
.padding-y-sm, .padding-y-small { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.padding-y-md, .padding-y-medium { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.padding-y-large { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.hover-bg-neutral-100:hover { background-color: var(--neutral-100) !important; }
.hover-bg-neutral-200:hover { background-color: var(--neutral-200) !important; }

/* Layout Gap */
.layout-gap-small { gap: 0.5rem; }
.layout-gap-medium { gap: 1rem; }
.layout-gap-large { gap: 2rem; }

/* Widths */
.width-quarter { width: calc(25% - 1rem); }
.width-third { width: calc(33.333% - 1rem); }
.width-half { width: calc(50% - 0.5rem); }
.width-two-thirds { width: calc(66.666% - 1rem); }
.width-three-quarters { width: calc(75% - 1rem); }

/* Mobile-first width utility */
.width-mobile-full { width: 100% !important; margin-bottom: 1rem; }

@media (min-width: 769px) {
    .width-mobile-full { width: auto !important; margin-bottom: 0; }
}

/* Extended spacing scale */
.padding-extra-small { padding: 0.25rem; }
.padding-extra-large { padding: 2rem; }

.margin-extra-small { margin: 0.25rem; }
.margin-small { margin: 0.5rem; }
.margin-medium { margin: 1rem; }
.margin-large { margin: 1.5rem; }
.margin-extra-large { margin: 2rem; }

.margin-bottom-extra-small { margin-bottom: 0.25rem; }
.margin-bottom-small { margin-bottom: 0.5rem; }
.margin-bottom-extra-large { margin-bottom: 2rem; }

.margin-top-extra-small { margin-top: 0.25rem; }
.margin-top-small { margin-top: 0.5rem; }
.margin-top-medium { margin-top: 1rem; }
.margin-top-large { margin-top: 1.5rem; }
.margin-top-extra-large { margin-top: 2rem; }
.margin-bottom-auto { margin-bottom: auto !important; }
.margin-y-auto { margin-top: auto !important; margin-bottom: auto !important; }
.margin-x-auto { margin-left: auto; margin-right: auto; }

.gap-extra-small { gap: 0.25rem; }
.gap-small { gap: 0.5rem; }
.gap-medium { gap: 1rem; }
.gap-large { gap: 1.5rem; }
.gap-extra-large { gap: 2rem; }

.background-white { background-color: var(--neutral-100); }
.background-neutral-50 { background-color: #f8f9fa; }
.background-neutral-100 { background-color: #f1f3f5; }

.border-radius-small { border-radius: 0.125rem; }
.border-radius-medium { border-radius: 0.375rem; }
.border-radius-large { border-radius: 0.5rem; }

.box-shadow-small { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.box-shadow-medium { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

.text-small { font-size: 0.875rem; }
.text-medium { font-size: 1rem; }
.text-large { font-size: 1.125rem; }
.text-extra-large { font-size: 1.25rem; }
.text-extra-extra-large { font-size: 1.5rem; }

.font-weight-medium { font-weight: 500; }
.font-weight-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.display-block { display: block; }
.display-inline-block { display: inline-block; }

.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-2 { flex-grow: 2; }

.min-width-100px { min-width: 100px; }
.width-100px { width: 100px; }
.max-width-extra-large { max-width: 1140px; }
.max-width-large { max-width: 960px; }
.max-width-medium { max-width: 768px; }

.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }
.white-space-pre-wrap { white-space: pre-wrap; }

.border-bottom-neutral-100 { border-bottom: 1px solid #f1f3f5; }
.border-bottom-neutral-200 { border-bottom: 1px solid #e9ecef; }
.border-bottom-neutral-300 { border-bottom: 1px solid #dee2e6; }
.border-top-neutral-200 { border-top: 1px solid #e9ecef; }
.border-neutral-200 { border: 1px solid #e9ecef; }

.table { width: 100%; border-collapse: collapse; }
.table-responsive { overflow-x: auto; }












/* Grid utilities */
.display-grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-column-full { grid-column: 1 / -1 !important; }
@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.padding-top-extra-small { padding-top: 0.25rem !important; }
.padding-top-small { padding-top: 0.5rem !important; }
.padding-top-medium { padding-top: 1rem !important; }
.padding-top-large { padding-top: 1.5rem !important; }
.padding-top-extra-large { padding-top: 2rem !important; }

.padding-bottom-extra-small { padding-bottom: 0.25rem !important; }
.padding-bottom-small { padding-bottom: 0.5rem !important; }
.padding-bottom-medium { padding-bottom: 1rem !important; }
.padding-bottom-large { padding-bottom: 1.5rem !important; }
.padding-bottom-extra-large { padding-bottom: 2rem !important; }

.border-dashed { border-style: dashed !important; }
.border-width-2 { border-width: 2px !important; }
.margin-left-extra-large { margin-left: 2rem !important; }
.margin-left-large { margin-left: 1.5rem !important; }

.list-style-none { list-style: none !important; }

.margin-left-extra-small { margin-left: 0.25rem !important; }
.margin-left-small { margin-left: 0.5rem !important; }
.margin-left-medium { margin-left: 1rem !important; }
.margin-right-extra-small { margin-right: 0.25rem !important; }
.margin-right-small { margin-right: 0.5rem !important; }
.margin-right-medium { margin-right: 1rem !important; }
.margin-right-large { margin-right: 1.5rem !important; }
.margin-right-extra-large { margin-right: 2rem !important; }
.max-width-extra-extra-large { max-width: 1440px; }
.border-top-brand-thick { border-top: 4px solid var(--brand-primary) !important; }
.text-danger { color: var(--brand-danger) !important; }
.max-width-200px { max-width: 200px !important; }
.max-width-150px { max-width: 150px !important; }
.max-width-100px { max-width: 100px !important; }

.max-width-250px { max-width: 250px !important; }
.max-width-450px { max-width: 450px !important; }
.border-brand-primary { border: 1px solid var(--brand-primary) !important; }
.border-brand-cream { border: 1px solid var(--brand-cream) !important; }
.visibility-hidden { visibility: hidden !important; }



.text-base { font-size: 0.95rem; }
.opacity-50 { opacity: 0.5; }
.display-inline-flex { display: inline-flex !important; }
.vertical-align-middle { vertical-align: middle !important; }



.text-brand-grey-dark { color: var(--brand-grey-dark) !important; }
.text-brand-dark { color: var(--brand-dark) !important; }
.border-bottom-brand-primary { border-bottom: 2px solid var(--brand-primary) !important; }
.background-brand-dark { background-color: var(--brand-dark) !important; }
.text-white { color: var(--neutral-100) !important; }
.background-brand-grey { background-color: var(--brand-grey) !important; }
.background-danger { background-color: var(--brand-danger) !important; }
.width-120px { width: 120px; }

.min-width-0 {
    min-width: 0 !important;
}

.background-overlay-dark {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Modal Backdrop & Cards */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-card {
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-card-scrollable {
    max-height: 90vh;
    overflow-y: auto;
}

.text-stack p {
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}
.text-stack p:last-child {
    margin-bottom: 0;
}
