﻿/* ==========================================================================
   iOS 26 Glassmorphism for Bootstrap apps
   File: wwwroot/css/glass-ios26.css
   --------------------------------------------------------------------------
   - Soft frosted glass surfaces with backdrop blur
   - Subtle gradients, rounded corners, and gentle shadows
   - Works on light/dark modes via prefers-color-scheme
   - Covers: body, navbar, cards, buttons, forms, inputs, tables, toasts,
             modals, badges, Select2, and utilities used in this project.
   ========================================================================== */

/* ------------------------ */
/* Design Tokens & Resets   */
/* ------------------------ */
:root {
    --glass-bg: rgba(255, 255, 255, 0.28);
    --glass-stroke: rgba(255, 255, 255, 0.55);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    --glass-radius: 18px;
    --glass-blur: 18px;
    --ink: #0f1222;
    --ink-2: #2c2f42;
    --ink-3: #5b5f7a;
    --accent: #007aff; /* iOS blue */
    --accent-2: #34c759; /* iOS green */
    --danger-acc: #ff3b30;
    --warning-acc: #ffcc00;
    --surface: rgba(255, 255, 255, 0.6);
    --surface-strong: rgba(255, 255, 255, 0.75);
    --border-weak: rgba(255, 255, 255, 0.45);
    --border-strong: rgba(255, 255, 255, 0.7);
    --ring: 0 0 0 3px rgba(0, 122, 255, 0.18);
    --focus-outline: 2px solid rgba(0, 122, 255, 0.35);
    --grad-1: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2));
    --grad-accent: linear-gradient(135deg, #0a84ff, #64d2ff);
    --card-padding: 16px;
    --elev-high: 0 20px 50px rgba(0,0,0,0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(20, 22, 34, 0.35);
        --glass-stroke: rgba(255, 255, 255, 0.12);
        --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
        --ink: #e9eaf2;
        --ink-2: #b9bdd1;
        --ink-3: #8e93ab;
        --surface: rgba(30, 32, 48, 0.5);
        --surface-strong: rgba(30,32,48,0.65);
        --border-weak: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.15);
        --grad-1: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
        --grad-accent: linear-gradient(135deg, #64d2ff, #0a84ff);
    }
}

/* Smooth font rendering */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure full viewport height */
    padding-top: 90px;
}

.main-content {
    flex: 1; /* Push footer down when content is short */
}

.footer {
    flex-shrink: 0;
}

/* Gradient background (light) */
body {
    background: radial-gradient(1200px 800px at 10% 0%, rgba(100,210,255,0.20), transparent 60%), radial-gradient(1000px 600px at 90% 20%, rgba(10,132,255,0.20), transparent 60%), radial-gradient(1200px 700px at 50% 100%, rgba(52,199,89,0.18), transparent 60%), linear-gradient(180deg, #eef3ff 0%, #f7f9ff 100%);
    color: var(--ink);
    min-height: 100vh;
    /* 🔑 prevent tiling */
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
    /* 🔑 stretch layers */
    background-size: 1200px 800px, 1000px 600px, 1200px 700px, 100% 100%;
    background-position: 10% 0%, 90% 20%, 50% 100%, 0 0;
}

/* Gradient background (dark) */
@media (prefers-color-scheme: dark) {
    body {
        background: radial-gradient(1200px 800px at 10% 0%, rgba(100,210,255,0.08), transparent 60%), radial-gradient(1000px 600px at 90% 20%, rgba(10,132,255,0.08), transparent 60%), radial-gradient(1200px 700px at 50% 100%, rgba(52,199,89,0.08), transparent 60%), linear-gradient(180deg, #0b0d17 0%, #121525 100%);
        background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
        background-size: 1200px 800px, 1000px 600px, 1200px 700px, 100% 100%;
        background-position: 10% 0%, 90% 20%, 50% 100%, 0 0;
    }
}

/* ------------------------ */
/* Glass Utility            */
/* ------------------------ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-stroke);
    box-shadow: var(--glass-shadow);
    border-radius: var(--glass-radius);
}

/* ------------------------ */
/* Navbar                   */
/* ------------------------ */
.navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-stroke);
    box-shadow: var(--glass-shadow);
}

    .navbar .navbar-brand,
    .navbar .nav-link {
        color: var(--ink) !important;
    }

        .navbar .nav-link.active,
        .navbar .nav-link:hover {
            color: var(--accent) !important;
        }

    .navbar .dropdown-menu {
        background: var(--glass-bg);
        border: 1px solid var(--glass-stroke);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
        border-radius: 14px;
        box-shadow: var(--glass-shadow);
        z-index: 2000 !important;
    }

.dropdown-item {
    color: var(--ink);
    border-radius: 10px;
}

    .dropdown-item:hover {
        background: var(--surface);
    }

/* Cart badge */
#cart-count {
    font-weight: 700;
    border: 1px solid var(--border-strong);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.35);
    color: white;
}

/* ------------------------ */
/* Cards & Product Tiles    */
/* ------------------------ */
.card {
    border: 1px solid var(--glass-stroke);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.card-img-top {
    border-bottom: 1px solid var(--glass-stroke);
}

.card .card-title {
    font-weight: 700;
    color: var(--ink);
}

.card .card-text {
    color: var(--ink-3);
}

/* ------------------------ */
/* Buttons                  */
/* ------------------------ */
.btn {
    border-radius: 14px;
    border: 1px solid var(--border-weak);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform .06s ease, box-shadow .2s ease, background-color .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

    .btn:active {
        transform: translateY(0);
    }

.btn-primary {
    color: #fff;
    background: var(--grad-accent);
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(10,132,255,0.35);
}

.btn-success {
    background: linear-gradient(135deg, #34c759, #6ee68e);
    border-color: transparent;
    color: #0b3d21;
    box-shadow: 0 10px 25px rgba(52,199,89,0.35);
}

.btn-outline-danger {
    border-color: rgba(255, 59, 48, .55);
    color: #ff3b30;
}

    .btn-outline-danger:hover {
        background: rgba(255,59,48,.1);
        color: #ff3b30;
    }

/* ------------------------ */
/* Forms & Inputs           */
/* ------------------------ */
.form-control, .form-select, .select2-selection--single {
    background: var(--surface);
    border: 1px solid var(--glass-stroke);
    color: var(--ink);
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

    .form-control:focus, .form-select:focus {
        border-color: transparent;
        box-shadow: var(--ring);
        outline: var(--focus-outline);
    }

.input-group .btn {
    border-radius: 12px !important;
}

/* Labels & help text */
.form-label {
    color: var(--ink-2);
    font-weight: 600;
}

.text-muted {
    color: var(--ink-3) !important;
}

/* Validation */
.field-validation-error, .text-danger {
    color: #ff3b30 !important;
}

.input-validation-error {
    border-color: rgba(255, 59, 48, .6) !important;
}

/* ------------------------ */
/* Tables                   */
/* ------------------------ */
.table {
    --bs-table-bg: transparent;
    color: var(--ink);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
}

    .table thead th {
        background: var(--surface-strong);
        color: var(--ink);
        font-weight: 700;
        border-bottom: 1px solid var(--glass-stroke) !important;
    }

    .table tbody tr {
        background: var(--glass-bg);
        backdrop-filter: blur(8px);
    }

        .table tbody tr + tr td {
            border-top: 1px solid var(--glass-stroke);
        }

    .table tfoot td {
        background: var(--surface-strong);
        font-weight: 700;
    }

/* ------------------------ */
/* Toasts                   */
/* ------------------------ */
.toast {
    border: 1px solid var(--glass-stroke);
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: var(--elev-high);
}

    .toast .toast-body {
        font-weight: 600;
        color: black;
        line-height: 70px;
    }

/* ------------------------ */
/* Modals                   */
/* ------------------------ */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-stroke);
    border-radius: 18px;
    box-shadow: var(--elev-high);
}

.modal-header, .modal-footer {
    border-color: var(--glass-stroke);
    background: var(--surface);
}

.modal-title {
    color: var(--ink);
}

/* ------------------------ */
/* Alerts                   */
/* ------------------------ */
.alert {
    border-radius: 14px;
    border: 1px solid var(--glass-stroke);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--ink);
}

.alert-success {
    border-color: rgba(52,199,89,.35);
}

.alert-danger {
    border-color: rgba(255,59,48,.35);
}

/* ------------------------ */
/* Badges & Pills           */
/* ------------------------ */
.badge {
    border: 1px solid var(--glass-stroke);
    background: var(--surface-strong);
    color: var(--ink);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    box-shadow: var(--glass-shadow);
}

/* ------------------------ */
/* Select2 (single)         */
/* ------------------------ */
.select2-container .select2-selection--single {
    height: 38px !important;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--glass-stroke);
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--ink) transparent transparent transparent !important;
}

.select2-dropdown {
    background: var(--glass-bg);
    border: 1px solid var(--glass-stroke);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.select2-results__option--highlighted {
    background: var(--surface) !important;
    color: var(--ink) !important;
}

/* ------------------------ */
/* Links & Small UI         */
/* ------------------------ */
a {
    color: var(--accent);
}

    a:hover {
        opacity: .9;
    }

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-stroke), transparent);
    margin: 18px 0;
}

/* ------------------------ */
/* Helpers                  */
/* ------------------------ */
.rounded-2xl {
    border-radius: 20px;
}

.shadow-glass {
    box-shadow: var(--glass-shadow);
}

.bg-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.border-glass {
    border: 1px solid var(--glass-stroke);
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .navbar .navbar-brand {
        font-size: 1rem;
    }

    .card {
        border-radius: 16px;
    }

    .lead {
        font-size: 1.25rem;
        font-weight: 400;
        text-shadow: 1px 1px 0px #fff, -1px -1px 0px #fff, 1px -1px 10px #fff, -1px 1px 0px #fff !important;
    }
}

/* Small entrance animation for cards/toasts */
@keyframes glass-pop {
    from {
        transform: translateY(6px) scale(.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.card, .toast, .modal-content {
    animation: glass-pop .24s ease both;
}

.cart-link {
    margin-right: 20px;
}

/* ------------------------ */
/* Footer (Glassmorphism)   */
/* ------------------------ */
.glass-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-stroke);
    box-shadow: var(--glass-shadow);
    position: relative;
    width: 100%;
    font-size: 0.9rem;
}

    .glass-footer p {
        color: var(--ink-3);
        margin: 0;
    }

@media (prefers-color-scheme: dark) {
    .glass-footer p {
        color: var(--ink-2);
    }
}

/* Product Image Container with Glass Effect */
.product-img-container {
    width: 100%;
    height: 200px; /* Adjust as needed */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-stroke);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    z-index: 1;
}

.product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .product-img:hover {
        transform: scale(1.05);
    }

/* ==================================================
   FORCE LIGHT THEME (overrides all dark mode rules)
   ================================================== */
:root {
    --glass-bg: rgba(255, 255, 255, 0.28) !important;
    --glass-stroke: rgba(255, 255, 255, 0.55) !important;
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.10) !important;
    --ink: #0f1222 !important;
    --ink-2: #2c2f42 !important;
    --ink-3: #5b5f7a !important;
    --surface: rgba(255, 255, 255, 0.6) !important;
    --surface-strong: rgba(255, 255, 255, 0.75) !important;
    --border-weak: rgba(255, 255, 255, 0.45) !important;
    --border-strong: rgba(255, 255, 255, 0.7) !important;
    --grad-1: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2)) !important;
    --grad-accent: linear-gradient(135deg, #0a84ff, #64d2ff) !important;
}

/* Also force body background back to light */
body {
    background: radial-gradient(40% 30% at 10% 0%, rgba(100,210,255,0.20), transparent 70%), radial-gradient(35% 25% at 90% 20%, rgba(10,132,255,0.20), transparent 70%), radial-gradient(50% 40% at 50% 100%, rgba(52,199,89,0.18), transparent 70%), linear-gradient(180deg, #eef3ff 0%, #f7f9ff 100%);
    background-repeat: no-repeat, no-repeat, no-repeat, repeat-y; /* last one repeats vertically */
    background-size: cover, cover, cover, 100% auto; /* radials stretch, linear gradient tiles */
    background-position: 0 0, 0 0, 0 100%, 0 0;
    background-attachment: fixed; /* makes it seamless when scrolling */
    color: var(--ink);
    min-height: 100vh;
}

/* Force solid background for dropdown submenu */
.navbar .dropdown-menu {
    background: #ffffff !important; /* Solid white */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

    .navbar .dropdown-menu .dropdown-item {
        color: #333 !important;
    }

        .navbar .dropdown-menu .dropdown-item:hover {
            background: #f0f0f0 !important;
        }

.italics {
    font-style: italic;
    font-weight: 100;
}

/* ================================
   Toast Styling (Centered + Bigger)
   ================================ */
/* Allow taller toasts for icon + text layout */
.toast {
    min-width: 320px;
    max-width: 600px;
    min-height: 100px;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    word-wrap: break-word;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    /* Make the body fill full width for centering */
    .toast .toast-body.centered-toast {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center; /* center horizontally */
        justify-content: center; /* center vertically */
        font-size: 1.25rem;
        text-align: center;
        line-height: 1.4;
    }

        /* Bigger icon with spacing */
        .toast .toast-body.centered-toast i {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

    /* Always show toast close button in dark color */
    .toast .btn-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='black'%3e%3cpath d='M.293 1.707a1 1 0 0 1 1.414 0L8 8l6.293-6.293a1 1 0 0 1 1.414 1.414L9.414 9.414l6.293 6.293a1 1 0 0 1-1.414 1.414L8 10.828l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 9.414.293 3.121a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
        filter: none !important; /* remove Bootstrap invert */
        opacity: 0.8 !important;
    }

        .toast .btn-close:hover {
            opacity: 1;
        }

    .toast .toast-body {
        font-size: 1.1rem;
        font-weight: 500;
        line-height: 1.5; /* more vertical space */
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        /* Bigger icon at top */
        .toast .toast-body i {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

    /* Make close button black for visibility */
    .toast .btn-close {
        filter: none !important;
        background: transparent;
        opacity: 1;
    }

/* Black close button for visibility */
.btn-close-black {
    filter: none !important;
    background: transparent !important;
    opacity: 1 !important;
}

/* Backdrop for blocking interaction */
.toast-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0); /* dark overlay */
    z-index: 1099; /* just under toast */
    display: none;
}

/* Ensure toast floats above everything */
#global-toast-container {
    z-index: 1100;
}

/* Toast itself more prominent */
.toast.locked-toast {
    box-shadow: 0 0 30px rgba(0, 0, 0, 1.0);
    border-radius: 16px;
}

.qr-image {
    max-width: 350px;
}

/* Mobile-friendly responsive tables */
@media (max-width: 768px) {
    .responsive-table thead, .responsive-table tfoot {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.5rem;
        background: #fff;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        white-space: normal;
        text-align: end;
    }

        .responsive-table td:last-child {
            border-bottom: none;
        }

        .responsive-table td::before {
            content: attr(data-label);
            font-weight: 600;
            color: #6c757d;
            margin-right: 0.5rem;
        }
}

td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-equal {
    width: 100% !important;
    height: 300px !important; /* fixed uniform height */
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.centered {
    margin-top: 50px;
    text-align: center;
}

.sticky-total {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.cart-photo {
    max-height: 100px;
    max-width: 100px;
    width: auto; /* keeps aspect ratio */
    object-fit: contain; /* ensures no distortion */
}

.badge.text-dark {
    font-size: 0.8rem;
    border-radius: 0.5rem;
    z-index: 2;
}

.wrapped {
    text-wrap: auto;
}

.product-name-td {
    max-width: 400px;
}

.input-group .btn i {
    margin-right: 4px;
}

.price-label {
    margin-bottom: 0;
}

.btn-share {
    font-size: 0.9rem;
    margin-top: 5px !important;
}

.highlighted-product {
    animation: highlight-fade 2s ease;
    background-color: rgba(255, 230, 150, 0.4);
}

@keyframes highlight-fade {
    from {
        background-color: rgba(255, 230, 150, 0.8);
    }

    to {
        background-color: transparent;
    }
}

.product-highlight {
    animation: pulseHighlight 2s ease-out;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.6);
    border-radius: 8px;
}

@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.8);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(255, 193, 7, 0);
    }
}

.glass-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #000;
    transition: all 0.3s ease;
}

    .glass-btn:hover {
        background: rgba(255, 255, 255, 0.35);
        color: #fff;
        transform: scale(1.05);
    }

#backToTop {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

    #backToTop:active {
        transform: scale(0.95);
    }

.max-200 {
            max-width: 200px;
}

@media (max-width: 576px) {
    .max-200 {
        max-width: unset;
    }
}
