@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* === Dark Theme Base === */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #1a1a1f;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

/* === General Styling === */
h1:focus {
    outline: none;
}

a, .btn-link {
    color: #ffffff;
}

a:hover, .btn-link:hover {
    color: #ddddff;
}

.content {
    padding-top: 1.1rem;
}

/* === Shared controls === */
button,
button[class],
.btn {
    color: #ffffff;
    background-color: #00205b;
    border: 1px solid #001640;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: 500;
}

button:hover,
button[class]:hover,
.btn:hover {
    color: #ffffff;
    background-color: #001640;
    border-color: #001640;
}

button:focus,
button:active:focus,
.btn:focus,
.btn:active:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffffff33; /* subtle white translucent border */
    transition: box-shadow 0.15s ease-in-out;
}

input:not([type=checkbox]):not([type=button]):not([type=submit]):not([type=reset]),
select,
select.form-select,
textarea {
    color: #ffffff;
    background-color: #141418;
    border: 1px solid #141418;
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
}

input:focus,
select:focus,
select.form-select:focus,
textarea:focus {
    outline: none;
    border-color: #00205b;
    box-shadow: 0 0 0 0.2rem rgba(0, 32, 91, 0.25);
}

input[type=number],
input[inputmode=decimal],
input[inputmode=integer] {
    width: 6rem;
    text-align: right;
}

input[type=search] {
    width: 100%;
}

.user-selector input {
    width: 10rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

input[type=checkbox] {
    appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    background-color: #00205b;
    border: 2px solid #001640;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

input[type=checkbox]:checked {
    background-color: #00205b;
    border-color: #001640;
}

input[type=checkbox]::after {
    content: "";
    position: absolute;
    top: 0.1rem;
    left: 0.3rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid #ffffff;
    border-width: 0 0.15rem 0.15rem 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

input[type=checkbox]:checked::after {
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
}

.row-lines td,
.row-lines th {
    border-bottom: 1px solid #ffffff;
}

th,
td {
    padding: 0.5rem 1rem;
    text-align: left;
    color: #ffffff;
    border-bottom: 1px solid #141418;
}

th {
    background-color: #00205b;
    font-weight: bold;
}

tr:hover {
    background-color: #5a5a66;
}

table input[type=text]:not([inputmode=decimal]):not([inputmode=integer]) {
    width: 100%;
}

table input[inputmode=decimal],
table input[inputmode=integer],
table input[type=number] {
    padding: 0.3rem 0.5rem;
}

label {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

small {
    color: #aaaaaa;
    font-size: 0.8em;
}

.col-nr {
    width: 6ch;
}

.col-price,
.col-smallprice {
    width: 8ch;
}

.col-name {
    width: auto;
}

/* === Form Validation === */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #00ffae;
}

.invalid {
    outline: 1px solid #ff6b6b;
}

.validation-message {
    color: #ff6b6b;
}

/* === Error UI === */
#blazor-error-ui {
    background: #5e2a2a;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #ffffff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* === Error Boundary === */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG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A2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNmZmZmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #00205b;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.ingredient-selection {
    margin: 1.5rem 0;
}

.ingredient-selection .ingredient-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
}

.ingredient-option input {
    flex-shrink: 0;
}

.ingredient-option .ingredient-price {
    margin-left: auto;
    white-space: nowrap;
}

.product-ingredient-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-ingredient-row label:not(:has(input[type=checkbox])) {
    display: flex;
    flex-direction: column;
}

.product-option-group {
    border: 1px solid #555563;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.product-option-select {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1rem;
}

/* Order terminal */
.terminal {
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100dvh - 7rem);
    display: flex;
    flex-direction: column;
}

.terminal .terminal-header,
.terminal .terminal-footer,
.terminal .terminal-cart-item,
.terminal .terminal-item-actions,
.terminal .terminal-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.terminal .terminal-header {
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.terminal .terminal-header p {
    color: #c3c6d1;
    margin-bottom: 0;
}

.terminal fieldset {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.terminal .terminal-body {
    flex: 1;
}

.terminal h2 {
    margin: 1.5rem 0;
}

.terminal .terminal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.terminal .terminal-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    min-height: 180px;
    padding: 1.5rem;
    border: 2px solid #555563;
    border-radius: 1rem;
    background: #252530;
    color: #fff;
    text-align: left;
}

.terminal .terminal-card:hover {
    border-color: #93c5fd;
    background: #00205b;
}

.terminal .terminal-card-selected {
    border-color: #93c5fd;
    background: #00205b;
}

.terminal .terminal-option-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #555563;
}

.terminal .terminal-option-summary > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.terminal .terminal-option-summary p {
    margin: .5rem 0 0;
}

.terminal .terminal-option-summary button {
    flex-shrink: 0;
}

.terminal button:focus-visible,
.terminal textarea:focus-visible,
.terminal input:focus-visible,
.terminal a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.terminal .terminal-card strong,
.terminal .terminal-price {
    font-size: 1.3rem;
}

.terminal .terminal-card .terminal-price {
    margin-top: auto;
}

.terminal .terminal-number {
    color: #c3c6d1;
}

.terminal .btn {
    min-height: 48px;
    padding: .65rem 1rem;
}

.terminal button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.terminal .terminal-customization {
    padding-bottom: 2rem;
}

.terminal .terminal-product-heading,
.terminal .terminal-checkout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.terminal .terminal-product-heading h2 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.terminal .terminal-product-heading .terminal-price {
    flex-shrink: 0;
    white-space: nowrap;
}

.terminal .terminal-checkout {
    margin-top: 2rem;
    flex-wrap: wrap;
}

.terminal .terminal-customization > label {
    display: block;
    margin: 1rem 0 .75rem;
}

.terminal .terminal-size-dialog {
    width: min(650px, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 1.5rem;
    color: #fff;
    background: #252530;
    border: 2px solid #93c5fd;
    border-radius: 1rem;
}

.terminal .terminal-size-dialog::backdrop {
    background: #000b;
}

.terminal .terminal-size-dialog .terminal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal .terminal-size-dialog h2 {
    margin-top: 0;
}

.terminal .terminal-customization textarea {
    width: 100%;
    border: 1px solid #77778b;
    resize: vertical;
}

.terminal .terminal-action {
    margin-top: 1.5rem;
}

.terminal .terminal-cart-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #555563;
    flex-wrap: wrap;
}

.terminal .terminal-cart-item h3 {
    font-size: 1.15rem;
}

.terminal .terminal-wishes {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal .terminal-item-actions {
    flex-wrap: wrap;
}

.terminal .terminal-quantity span {
    min-width: 2rem;
    text-align: center;
}

.terminal .terminal-footer {
    position: sticky;
    bottom: 0;
    margin-top: 2rem;
    padding: 1rem;
    background: #252530;
    border: 1px solid #555563;
    border-radius: .75rem;
    flex-wrap: wrap;
}

.terminal .terminal-footer > div:first-child {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.terminal .terminal-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.terminal .terminal-error {
    padding: 1rem;
    background: #5e2a2a;
    border-radius: .5rem;
}

@media (max-width: 600px) {
    .terminal .terminal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .terminal .terminal-card {
        padding: 1rem;
        overflow-wrap: anywhere;
    }

    .terminal .terminal-item-actions {
        width: 100%;
    }
}

/* Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

.page main {
    flex: 1;
}

.sidebar {
    background-color: #141418;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }
}

/* Navigation */
.sidebar .top-row {
    height: 6rem;
    background-color: #00205b;
}

.sidebar .navbar-brand {
    font-size: 1.1rem;
}

.sidebar .oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item a {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.sidebar .nav-item a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.sidebar .nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

@media (min-width: 641px) {
    .sidebar .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        display: block;
    }

    .sidebar .nav-scrollable {
        height: calc(100vh - 6rem);
        overflow-y: auto;
    }
}
