/* ==========================================================================
   WarrantyGuard - application styles (Task 10).

   Loaded after Bootstrap 5.3, so everything here only fills small gaps:
   - the page fills the viewport and keeps the footer at the bottom,
   - brand colour and a few reusable card/table touches,
   - nothing that needs an inline <style> block (the CSP allows 'self' only).

   Colours use Bootstrap's CSS variables, so light and dark mode both work
   without a second rule set.
   ========================================================================== */

:root {
    --wg-brand: #1a56db;
    --wg-brand-subtle: #e8f0fe;
}

[data-bs-theme="dark"] {
    --wg-brand: #7ea6ff;
    --wg-brand-subtle: #16233c;
}

body {
    /* Keeps the sticky navbar from covering an anchor target. */
    scroll-padding-top: 5rem;
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.navbar-brand .bi {
    color: var(--wg-brand);
}

.navbar .nav-link.active {
    font-weight: 600;
}

.wg-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background-color: var(--bs-body-bg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.wg-card-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.wg-card-label {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.wg-brand-badge {
    background-color: var(--wg-brand-subtle);
    color: var(--wg-brand);
}

.wg-recovery-codes code {
    font-size: 1rem;
    letter-spacing: .08em;
}

.wg-secret {
    word-break: break-all;
}

/* Tables: allow them to scroll inside their wrapper instead of the page. */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Make the second-factor QR code scale with small screens. */
.wg-qr svg {
    width: 100%;
    max-width: 220px;
    height: auto;
}

/* ==========================================================================
   Receipt capture (Task 14)

   Drop zone and preview of views/warranties/capture.php. The "active" state is
   toggled by public/js/receipt-ocr.js through a class, never through an inline
   style attribute (the CSP allows 'self' only).
   ========================================================================== */

.wg-dropzone {
    border: 2px dashed var(--bs-border-color);
    border-radius: .75rem;
    background-color: var(--bs-tertiary-bg);
    cursor: pointer;
    transition: border-color .15s ease-in-out, background-color .15s ease-in-out;
}

.wg-dropzone-active {
    border-color: var(--wg-brand);
    background-color: var(--wg-brand-subtle);
}

.wg-dropzone:focus-visible {
    outline: 2px solid var(--wg-brand);
    outline-offset: 2px;
}

.wg-dropzone-icon {
    font-size: 2rem;
    color: var(--wg-brand);
}

.wg-ocr-preview {
    max-height: 240px;
    object-fit: contain;
}

/* ==========================================================================
   Warranty detail (Task 19, extended by Task 21)

   Preview and enlarged view of the receipt and the product photo. The overlay
   is switched by `:target`, so it needs no JavaScript and no inline style
   attribute (the CSP allows 'self' only).
   ========================================================================== */

.wg-zoom-link {
    cursor: zoom-in;
}

.wg-lightbox {
    display: none;
}

.wg-lightbox:target {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1080;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: rgba(15, 23, 42, .88);
}

/* The backdrop fills the overlay and closes it; the figure sits above it. */
.wg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.wg-lightbox-figure {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 100%;
    text-align: center;
}

.wg-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: .5rem;
    background-color: #fff;
}

.wg-lightbox-caption {
    margin-top: .5rem;
    color: #fff;
}

