/**
 * Bootstrap-compatible utility replacements for scrolldaddy-html5.
 * Provides every Bootstrap utility class used in the plugin templates
 * so Bootstrap itself is not needed as a dependency.
 * v5
 */

/* --- Global resets Bootstrap provides --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Bootstrap CSS variable defaults --- */
:root {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
}

/* ============================================================
   CONTAINER
   Canvas CSS handles max-width at 1300px+; we provide the base.
   ============================================================ */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    margin-right: auto;
    margin-left: auto;
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* ============================================================
   GRID  (row / columns)
   ============================================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-left:  calc(-0.5 * var(--bs-gutter-x));
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(0.5 * var(--bs-gutter-x));
    padding-left:  calc(0.5 * var(--bs-gutter-x));
    margin-top: var(--bs-gutter-y);
    box-sizing: border-box;
}

/* Gutter overrides */
.gx-0 { --bs-gutter-x: 0; }
.gy-4 { --bs-gutter-y: 1.5rem; }
.gy-5 { --bs-gutter-y: 3rem; }

/* Auto-width column */
.col-auto { flex: 0 0 auto; width: auto; }

/* xs (all sizes) */
.col-12 { flex: 0 0 auto; width: 100%; }

/* md breakpoint (768px) */
@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
}

/* lg breakpoint (992px) */
@media (min-width: 992px) {
    .col-lg-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
}

/* xl breakpoint (1200px) */
@media (min-width: 1200px) {
    .col-xl-3   { flex: 0 0 auto; width: 25%; }
    .col-xl-4   { flex: 0 0 auto; width: 33.3333%; }
    .col-xl-5   { flex: 0 0 auto; width: 41.6667%; }
    .col-xl-6   { flex: 0 0 auto; width: 50%; }
    .col-xl-7   { flex: 0 0 auto; width: 58.3333%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; }
}

/* xxl breakpoint (1400px) */
@media (min-width: 1400px) {
    .col-xxl-3 { flex: 0 0 auto; width: 25%; }
    .col-xxl-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-xxl-8 { flex: 0 0 auto; width: 66.6667%; }
}

/* ============================================================
   DISPLAY UTILITIES
   ============================================================ */
.d-none         { display: none !important; }
.d-block        { display: block !important; }
.d-flex         { display: flex !important; }
.d-inline-block { display: inline-block !important; }

@media (min-width: 992px) {
    .d-lg-none         { display: none !important; }
    .d-lg-block        { display: block !important; }
    .d-lg-flex         { display: flex !important; }
    .d-lg-inline-block { display: inline-block !important; }
}
@media (min-width: 1200px) {
    .d-xl-block { display: block !important; }
}

/* ============================================================
   FLEXBOX UTILITIES
   ============================================================ */
.align-items-center    { align-items: center !important; }
.align-self-center     { align-self: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-between         { justify-content: space-between !important; }
.flex-col          { flex-direction: column !important; }
.flex-row-reverse  { flex-direction: row-reverse !important; }
.flex-1            { flex: 1 1 0% !important; }

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.text-center  { text-align: center !important; }

/* ============================================================
   POSITION / OVERFLOW
   ============================================================ */
.position-relative { position: relative !important; }
.overflow-hidden   { overflow: hidden !important; }

/* ============================================================
   SIZING
   ============================================================ */
.w-full { width: 100% !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* ============================================================
   SPACING — Bootstrap scale: 1=.25rem 2=.5rem 3=1rem 4=1.5rem 5=3rem
   ============================================================ */

/* margin-bottom */
.mb-0  { margin-bottom: 0 !important; }
.mb-2  { margin-bottom: 0.5rem !important; }
.mb-3  { margin-bottom: 1rem !important; }
.mb-4  { margin-bottom: 1.5rem !important; }
.mb-6  { margin-bottom: 1.5rem !important; }   /* Tailwind-compat */
.mb-10 { margin-bottom: 2.5rem !important; }
.mb-20 { margin-bottom: 5rem !important; }

/* margin-top */
.mt-2  { margin-top: 0.5rem !important; }
.mt-3  { margin-top: 1rem !important; }
.mt-4  { margin-top: 1.5rem !important; }
.mt-6  { margin-top: 1.5rem !important; }      /* Tailwind-compat */
.mt-40 { margin-top: 40px !important; }
.mt-n1 { margin-top: -0.25rem !important; }
.mt-n2 { margin-top: -0.5rem !important; }

/* margin-end (right) */
.me-2 { margin-right: 0.5rem !important; }

/* margin-start (left) */
.ms-0 { margin-left: 0 !important; }

/* padding-start (left) */
.ps-3 { padding-left: 1rem !important; }

/* padding-x */
.px-4 { padding-right: 1.5rem !important; padding-left: 1.5rem !important; }

/* padding-y */
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Responsive spacing overrides */
@media (min-width: 576px) {
    .mb-sm-0 { margin-bottom: 0 !important; }
}
@media (min-width: 1200px) {
    .mb-xl-0  { margin-bottom: 0 !important; }
    .me-xl-3  { margin-right: 1rem !important; }
    .ps-xl-5  { padding-left: 3rem !important; }
}
@media (min-width: 1400px) {
    .pe-xxl-4 { padding-right: 1.5rem !important; }
}

/* ============================================================
   TAILWIND ALIASES  (view templates use both naming conventions)
   ============================================================ */
.flex         { display: flex !important; }
.inline-flex  { display: inline-flex !important; }
.items-center { align-items: center !important; }
.justify-center  { justify-content: center !important; }
.justify-between { justify-content: space-between !important; } /* also .justify-between above */
.hidden       { display: none !important; }

/* ============================================================
   BORDER / ROUNDED / SHADOW  (Bootstrap utilities)
   ============================================================ */
.border       { border: 1px solid rgba(0, 0, 0, .125) !important; }
.border-top   { border-top: 1px solid rgba(0, 0, 0, .125) !important; }
.rounded      { border-radius: 0.375rem !important; }
.rounded-md   { border-radius: 0.375rem !important; }
.rounded-lg   { border-radius: 0.5rem !important; }
.shadow       { box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important; }
.shadow-sm    { box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important; }

/* ============================================================
   FULL PADDING UTILITIES  (Bootstrap scale)
   ============================================================ */
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.text-sm     { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base   { font-size: 1rem !important; }
.font-medium { font-weight: 500 !important; }
.underline   { text-decoration: underline !important; }

/* ============================================================
   BUTTON BASE + VARIANTS  (replaces Bootstrap .btn .btn-primary)
   ============================================================ */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn-primary {
    color: #fff;
    background-color: var(--theme-color, #6B61FC);
    border-color: var(--theme-color, #6B61FC);
}
.btn-primary:hover, .btn-primary:focus {
    color: #fff;
    background-color: color-mix(in srgb, var(--theme-color, #6B61FC) 85%, #000);
    border-color: color-mix(in srgb, var(--theme-color, #6B61FC) 80%, #000);
}
.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover, .btn-secondary:focus {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}
