/* ========================================
   Global Styles — Products WebUI
   ======================================== */

/* ---------- Base ---------- */

html, body {
    height: 100%;
    margin: 0;
    background-color: var(--rr-bg);
    font-family: var(--rr-font);
    color: var(--rr-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

#app {
    min-height: 100%;
    background-color: var(--rr-bg);
}

.mud-layout {
    min-height: 100%;
    background-color: var(--rr-bg);
}

.mud-main-content {
    background-color: var(--rr-bg);
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

/* ---------- MudBlazor Global Overrides ---------- */

/* Cards */
.mud-card {
    border-radius: var(--rr-radius-lg) !important;
    box-shadow: var(--rr-shadow-sm) !important;
    border: 1px solid var(--rr-border);
    background: var(--rr-surface);
}

/* Buttons */
.mud-button-root {
    border-radius: var(--rr-radius-md) !important;
    font-weight: 600;
    text-transform: none !important;
    letter-spacing: 0.2px;
    box-shadow: none !important;
    transition: all var(--rr-transition);
}

.mud-button-filled.mud-button-filled-primary {
    background-color: var(--rr-primary) !important;
    color: var(--rr-on-primary) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background-color: var(--rr-primary-hover) !important;
}

/* Inputs */
.mud-input-root {
    border-radius: var(--rr-radius-md) !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--rr-radius-md) !important;
}

/* Chips */
.mud-chip {
    border-radius: var(--rr-radius-sm) !important;
    font-weight: 600;
    transition: all var(--rr-transition);
}

/* Tabs */
.mud-tab {
    text-transform: none !important;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: color var(--rr-transition);
}

/* Alerts */
.mud-alert {
    border-radius: var(--rr-radius-md) !important;
}

/* Dialogs */
.mud-dialog {
    border-radius: var(--rr-radius-lg) !important;
}

/* Tables */
.mud-table {
    border-radius: var(--rr-radius-lg) !important;
    overflow: hidden;
}

.mud-table-head th {
    font-weight: 700;
    color: var(--rr-text-strong);
}

/* AppBar */
.mud-appbar {
    background: var(--rr-surface) !important;
    border-bottom: 1px solid var(--rr-border);
    color: var(--rr-text) !important;
}

/* Paper */
.mud-paper {
    border-radius: var(--rr-radius-lg);
}

/* ---------- Common Reusable Classes ---------- */

/* Card */
.rr-card {
    border: 1px solid var(--rr-border);
    border-radius: var(--rr-radius-lg);
    background: var(--rr-surface);
    transition: box-shadow var(--rr-transition), transform var(--rr-transition);
    overflow: hidden;
}

.rr-card:hover {
    box-shadow: var(--rr-shadow-hover);
    transform: translateY(-1px);
}

.rr-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Typography */
.rr-title {
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--rr-text-strong);
    margin-bottom: 2px;
}

.rr-subtitle {
    color: var(--rr-text-secondary);
    margin-bottom: 10px;
}

.rr-muted {
    color: var(--rr-text-secondary);
    line-height: 1.4;
}

.rr-section-title {
    font-weight: 800;
    color: var(--rr-text-strong);
    letter-spacing: 0.25px;
}

.rr-value {
    font-weight: 800;
    color: var(--rr-text-strong);
}

/* Clickable */
.clickable {
    cursor: pointer;
}

/* Fade-in animation */
.rr-fade-in {
    animation: rrFadeIn 250ms ease-out;
}

@keyframes rrFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 404 Not Found ---------- */

.rr-notfound {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--rr-space-xl);
}

.rr-notfound-code {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--rr-text-strong);
    margin-bottom: var(--rr-space-md);
}

.rr-notfound-title {
    font-weight: 700;
    color: var(--rr-text-strong);
    margin-bottom: var(--rr-space-sm);
}

.rr-notfound-text {
    color: var(--rr-text-secondary);
    max-width: 480px;
    margin-bottom: var(--rr-space-lg);
    line-height: 1.6;
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--rr-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ---------- Blazor Error UI ---------- */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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