body {
    margin-top: var(--nav-bar-height);
    margin-bottom: var(--nav-bar-height);
    font-size: 1em;
}

/* safe area for iphone notch in landscape mode) */
@supports(padding:max(0px)) {
    body,
    header,
    footer {
        padding-left: min(0vmin, env(safe-area-inset-left));
        padding-right: min(0vmin, env(safe-area-inset-right));
    }
}

.model-header {
    border-bottom: 0px;
}

a {
    cursor: pointer;
}

svg {
    height: 1rem;
}

.tooltip {
    font-size: 0.75rem;
}

.tooltip-inner {
    max-width: 100%;
}

.td-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.soldout {
    color: darkred;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-main);
        color: var(--text-main);
    }

    .dropdown-menu {
        background-color: var(--dropdown-bg);
        color: var(--dropdown-text);
    }

    .dropdown-menu a:hover {
        color: var(--dropdown-hover-text);
    }

    .dropdown-menu a {
        color: var(--dropdown-text);
    }

    .jumbotron {
        background-color: var(--jumbotron-bg);
    }

    .card {
        background-color: var(--card-bg);
    }

    .card .card-header {
        background-color: var(--card-header-bg);
    }

    .dropdown-dates-menuitem {
        color: silver;
    }

    .category-total {
        color: silver;
    }

    .modal-content {
        background-color: var(--modal-bg);
    }

    a {
        color: lightblue;
    }

    a:hover {
        color: white;
    }

    .row-thead {
        background-color: var(--bg-main);
    }

    .menu-icon {
        fill: silver;
    }

    .soldout {
        color: red;
    }
}

/* Toast Notification Utility */
.toast-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    background-color: rgba(33, 37, 41, 0.95);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Global loading states */
body.loading-location,
body.loading-location * {
    cursor: wait !important;
}

/* Shared Page Hero Header block styling */
.page-hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-main) 100%);
    padding: 30px 15px;
    text-align: center;
}

/* OAuth Sign-In Styles */
.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.oauth-divider:not(:empty)::before {
    margin-right: .5em;
}

.oauth-divider:not(:empty)::after {
    margin-left: .5em;
}

@media (prefers-color-scheme: dark) {
    .oauth-divider::before,
    .oauth-divider::after {
        border-bottom-color: #495057;
    }
    .oauth-divider {
        color: #adb5bd;
    }
}

.oauth-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

/* Base custom Apple Sign-In button designed to look premium and native */
.apple-signin-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    height: 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.apple-signin-btn:hover {
    background-color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.apple-signin-btn svg {
    position: absolute;
    left: 12px;
    height: 16px;
    fill: currentColor;
}

@media (prefers-color-scheme: dark) {
    .apple-signin-btn {
        background-color: #ffffff;
        color: #000000;
    }
    .apple-signin-btn:hover {
        background-color: #f2f2f2;
    }
}

/* Native HTML <dialog> styling */
dialog.custom-dialog {
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    background: transparent;
    overflow: visible;
}

dialog.custom-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

dialog.custom-dialog .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

dialog.custom-dialog .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

dialog.custom-dialog#modalCategories {
    max-width: 800px;
}

/* Modern Date Dialog Styles */
.date-inputs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 576px) {
    .date-inputs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.date-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0;
}
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.modern-date-input {
    height: 48px;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modern-date-input:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Calendar indicator icon for Webkit browsers */
.modern-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(var(--calendar-indicator-invert, 0));
    opacity: 0.6;
    transition: opacity 0.2s;
}
.modern-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
