﻿/* ==========================================================================
   ebay-avis.css
   Scoped, theme-aware replacement for the Bootstrap 5 classes used by the
   eBay Zahlungsavis page, ConfirmDialog and ToastComponent.
 
   USAGE
   Wrap the whole page (including <ToastComponent> and the dialog) in:
       <div class="ebay-avis"> ... </div>
   Every rule below only matches inside that wrapper, so other pages of the
   host application are not affected.
 
   THEMING
   The variables are mapped to the host's theme variables (--color-*,
   --btn-primary-*). They are declared on the wrapper, not on :root, so they
   resolve inside the host's .theme-dark / [data-theme="dark"] container.
   The value after each comma is the fallback if the host variable is missing.
   ========================================================================== */

.ebay-avis {
    --bs-primary: var(--btn-primary-bg, #0d6efd);
    --bs-body-bg: var(--color-bg, #ffffff);
    --bs-body-color: var(--color-text, #212529);
    --bs-border-color: var(--color-border, #dee2e6);
    --bs-secondary-color: var(--color-text-muted, #6c757d);
    --bs-surface: var(--color-surface, #e9ecef);
    --bs-surface-2: var(--color-bg-secondary, #f8f9fa);
    --bs-focus-ring: rgba(222, 91, 41, .35);

    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-secondary: #6c757d;
}

/* ---------- Mini reboot (what Bootstrap's reboot gave the page) ---------- */
.ebay-avis *,
.ebay-avis *::before,
.ebay-avis *::after {
    box-sizing: border-box;
}

.ebay-avis h1 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-size: calc(1.375rem + 1.5vw);
    font-weight: 500;
    line-height: 1.2;
}
@media (min-width: 1200px) {
    .ebay-avis h1 { font-size: 2.5rem; }
}

/* ---------- Utilities ---------- */
.ebay-avis .d-flex { display: flex !important; }
.ebay-avis .d-none { display: none !important; }
@media (min-width: 576px) {
    .ebay-avis .d-sm-block { display: block !important; }
    .ebay-avis .d-sm-none  { display: none !important; }
}

.ebay-avis .text-center { text-align: center !important; }
.ebay-avis .text-white  { color: #fff !important; }
.ebay-avis .text-muted  { color: var(--bs-secondary-color) !important; }

.ebay-avis .justify-content-center  { justify-content: center !important; }
.ebay-avis .justify-content-between { justify-content: space-between !important; }
.ebay-avis .align-items-center      { align-items: center !important; }
.ebay-avis .align-middle            { vertical-align: middle !important; }

.ebay-avis .gap-2 { gap: .5rem !important; }
.ebay-avis .mt-0  { margin-top: 0 !important; }
.ebay-avis .mb-3  { margin-bottom: 1rem !important; }
.ebay-avis .me-auto { margin-right: auto !important; }
.ebay-avis .ms-auto { margin-left: auto !important; }
.ebay-avis .p-2 { padding: .5rem !important; }
.ebay-avis .p-3 { padding: 1rem !important; }
.ebay-avis .m-3 { margin: 1rem !important; }
.ebay-avis .w-100 { width: 100% !important; }

.ebay-avis .fw-bold  { font-weight: 700 !important; }
.ebay-avis .fw-light { font-weight: 300 !important; }

.ebay-avis .position-fixed { position: fixed !important; }
.ebay-avis .top-0    { top: 0 !important; }
.ebay-avis .bottom-0 { bottom: 0 !important; }
.ebay-avis .start-0  { left: 0 !important; }
.ebay-avis .end-0    { right: 0 !important; }

.ebay-avis .border-0 { border: 0 !important; }

.ebay-avis .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- Colour helpers (also used by toasts) ---------- */
.ebay-avis .bg-success,   .ebay-avis .text-bg-success   { background-color: var(--bs-success) !important;   color: #fff !important; }
.ebay-avis .bg-danger,    .ebay-avis .text-bg-danger    { background-color: var(--bs-danger) !important;    color: #fff !important; }
.ebay-avis .bg-warning,   .ebay-avis .text-bg-warning   { background-color: var(--bs-warning) !important;   color: #000 !important; }
.ebay-avis .bg-info,      .ebay-avis .text-bg-info      { background-color: var(--bs-info) !important;      color: #000 !important; }
.ebay-avis .bg-primary,   .ebay-avis .text-bg-primary   { background-color: var(--bs-primary) !important;   color: #fff !important; }
.ebay-avis .bg-secondary, .ebay-avis .text-bg-secondary { background-color: var(--bs-secondary) !important; color: #fff !important; }

/* ---------- Grid (only what the page uses) ---------- */
.ebay-avis .row     { display: flex; flex-wrap: wrap; }
.ebay-avis .col-auto { flex: 0 0 auto; width: auto; }

/* ---------- Buttons ---------- */
.ebay-avis .btn {
    display: inline-block;
    padding: .375rem .75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: .375rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
    border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.ebay-avis .btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .25rem var(--bs-focus-ring);
}
.ebay-avis .btn:disabled,
.ebay-avis .btn[disabled] {
    opacity: .65;
    pointer-events: none;
}
.ebay-avis .btn-sm {
    padding: .25rem .5rem;
    font-size: .875rem;
    border-radius: .25rem;
}

.ebay-avis .btn-primary {
    color: #fff;
    background-color: var(--btn-primary-bg, #0d6efd);
    border-color: var(--btn-primary-bg, #0d6efd);
}
.ebay-avis .btn-primary:hover {
    color: #fff;
    background-color: var(--btn-primary-hover, #0b5ed7);
    border-color: var(--btn-primary-hover, #0a58ca);
}

.ebay-avis .btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.ebay-avis .btn-secondary:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

.ebay-avis .btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}
.ebay-avis .btn-group > .btn { position: relative; flex: 1 1 auto; }
.ebay-avis .btn-group > .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.ebay-avis .btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.ebay-avis .btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
    border: 0;
    border-radius: .375rem;
    opacity: .5;
    cursor: pointer;
}
.ebay-avis .btn-close:hover { opacity: .75; }
.ebay-avis .btn-close:focus-visible { outline: 0; box-shadow: 0 0 0 .25rem var(--bs-focus-ring); opacity: 1; }
.ebay-avis .btn-close-white,
.theme-dark .ebay-avis .btn-close,
[data-theme="dark"] .ebay-avis .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---------- Forms ---------- */
.ebay-avis .form-control,
.ebay-avis .form-select {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.ebay-avis .form-control::placeholder { color: var(--bs-secondary-color); opacity: 1; }
.ebay-avis .form-control:focus,
.ebay-avis .form-select:focus {
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 .25rem var(--bs-focus-ring);
}

.ebay-avis .form-select {
    padding-right: 2.25rem;
    appearance: none;
    /* mid-grey chevron: readable on light and dark backgrounds */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23888888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

.ebay-avis .form-control.is-valid   { border-color: var(--bs-success); }
.ebay-avis .form-control.is-invalid { border-color: var(--bs-danger); }
.ebay-avis .form-control.is-valid:focus   { box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .25); }
.ebay-avis .form-control.is-invalid:focus { box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25); }

.ebay-avis .invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: .875em;
    color: var(--bs-danger);
}
.ebay-avis .is-invalid ~ .invalid-feedback { display: block; }

.ebay-avis .form-check-input {
    width: 1em;
    height: 1em;
    cursor: pointer;
    accent-color: var(--bs-primary);
}
.ebay-avis .form-check-label { cursor: pointer; }

.ebay-avis .input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}
.ebay-avis .input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.ebay-avis .input-group-text {
    display: flex;
    align-items: center;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--bs-body-color);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ---------- Tables ---------- */
.ebay-avis .table {
    width: 100%;
    margin-bottom: 1rem;
    vertical-align: top;
    border-color: var(--bs-border-color);
    border-collapse: collapse;
}
.ebay-avis .table > :not(caption) > * > * {
    padding: .5rem;
    background-color: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    /* stripes/hover are painted via box-shadow so that page-level
       background-color rules (sticky cells) don't hide them */
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg, transparent);
}
.ebay-avis .table th { text-align: inherit; }
.ebay-avis .table > thead { vertical-align: bottom; }
.ebay-avis .table > :not(:first-child) { border-top: 2px solid currentColor; }

/* neutral grey overlay: works in light and dark theme */
.ebay-avis .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: rgba(128, 128, 128, .12); }
.ebay-avis .table > tbody > tr.group-even > * { --bs-table-accent-bg: rgba(128, 128, 128, .12); }
.ebay-avis .table-hover   > tbody > tr:hover > *            { --bs-table-accent-bg: rgba(128, 128, 128, .2); }

.ebay-avis .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Toast ---------- */
.ebay-avis .fade { transition: opacity .15s linear; }
.ebay-avis .fade:not(.show) { opacity: 0; }

.ebay-avis .toast-container {
    position: fixed;
    z-index: 1090;
    width: max-content;
    max-width: 100%;
    pointer-events: none;
}
.ebay-avis .toast-container > :not(:last-child) { margin-bottom: 1rem; }

.ebay-avis .toast {
    width: 350px;
    max-width: 100%;
    font-size: .875rem;
    color: var(--bs-body-color);
    pointer-events: auto;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}
.ebay-avis .toast:not(.show) { display: none; }
.ebay-avis .toast.showing { opacity: 0; }

.ebay-avis .toast-header {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    color: var(--bs-secondary-color);
    background-color: var(--bs-surface-2);
    border-bottom: 1px solid var(--bs-border-color);
    border-top-left-radius: calc(.375rem - 1px);
    border-top-right-radius: calc(.375rem - 1px);
}
.ebay-avis .toast-header .btn-close { margin-right: -.375rem; margin-left: .75rem; }
.ebay-avis .toast-body { padding: .75rem; word-wrap: break-word; }
