/* Custom Fonts */
@font-face {
    font-family: 'DBHeaventRegular';
    src: url('fonts/DB Heavent v3.2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {
    font-size: 17.5px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga" 1, "dlig" 1;
}

/* Base Body Styles */
body {
    background-color: #0c0518;
    background-image: url('images/background_d.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: center bottom;
    font-family: 'DBHeaventRegular', 'Prompt', 'Sarabun', sans-serif !important;
    font-size: 1.35rem;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga" 1, "dlig" 1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

@media (max-width: 768px) {
    body {
        background-image: url('images/background_m.jpg');
    }
}

/* Glassmorphism Panel styles for modern UI */
.glass-panel {
    background: linear-gradient(135deg, rgba(17, 0, 42, 0.8) 0%, rgba(41, 18, 80, 0.8) 100%) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px;
    color: white !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-panel-light {
    background: rgba(234, 244, 253, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px;
    color: #1a1a1a !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

/* Custom layout container helper */
.app-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

/* Sizing Utilities */
.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

.min-vh-100 {
    min-height: 100vh !important;
}

/* Normalized actions buttons container for consistent layout across all pages */
.action-row-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.action-row-container .mud-button {
    flex: 1;
    max-width: 280px;
    min-width: 120px;
    height: 52px !important;
    border-radius: 26px !important;
    font-weight: 600 !important;
    font-size: 1.3rem !important;
    text-transform: none !important;
    transition: all 0.2s ease-in-out;
}

/* Hover micro-interactions */
.action-row-container .mud-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Responsiveness adjustments for smaller devices */
@media (max-width: 576px) {
    .action-row-container {
        gap: 12px;
    }

    .action-row-container .mud-button {
        font-size: 1.15rem !important;
        height: 48px !important;
        padding: 6px 12px !important;
    }
}

/* Consistent labels in glass panels */
.glass-label {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.glass-accent-label {
    color: #ffde21 !important;
    font-weight: 600 !important;
}

/* Font updates for MudBlazor elements to ensure consistency */
.mud-typography,
.mud-button,
.mud-button-label,
.mud-input,
.mud-input-control,
.mud-input-label,
.mud-select,
.mud-dialog,
.mud-dialog-title,
.mud-dialog-content,
.mud-dialog-actions,
.mud-checkbox,
.mud-list-item,
.mud-list-item-text,
.mud-table-cell {
    font-family: 'DBHeaventRegular', 'Prompt', 'Sarabun', sans-serif !important;
}

.mud-button-label {
    font-size: 1.4rem !important;
    font-weight: 500 !important;
}

.mud-input {
    font-size: 1.35rem !important;
}

/* Ensure check-boxes, list items, dropdown lists and tables scale properly */
.mud-checkbox-label,
.mud-checkbox {
    font-size: 1.35rem !important;
}

.mud-list-item,
.mud-list-item-text {
    font-size: 1.35rem !important;
}

.mud-table-cell {
    font-size: 1.25rem !important;
}

.mud-table-cell-header {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
}

/* Error boundary and standard Blazor styles */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

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

.validation-message {
    color: #e50000;
    font-size: 1.2rem;
    font-weight: 500;
}

.blazor-error-boundary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I2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC51NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAz) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Align Radio Icon to the first line of multi-line text */
.align-start-radio,
.align-start-radio-group .mud-radio {
    align-items: flex-start !important;
}

.align-start-radio .mud-radio-button,
.align-start-radio-group .mud-radio .mud-radio-button,
.align-start-radio-group .mud-radio>span:first-child {
    align-self: flex-start !important;
    margin-top: -4px !important;
    /* Offset standard padding to align with first text line center */
}

/* Fix outlined floating labels overlapping with input text due to typography scaling */
.mud-input-label-outlined.mud-shrink,
.mud-input-label-outlined.mud-input-label-margin-dense.mud-shrink,
.glass-panel .mud-input-outlined~.mud-input-label-outlined,
.glass-panel-light .mud-input-outlined~.mud-input-label-outlined {
    transform: translate(14px, -11px) scale(0.75) !important;
    background-color: white !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    border-radius: 4px;
}

/* Login Error Alert Banner Styling */
@keyframes loginErrorPop {
    0% { transform: scale(0.92); opacity: 0; }
    50% { transform: scale(1.02); }
    70% { transform: scale(0.98); }
    100% { transform: scale(1); opacity: 1; }
}

.login-error-banner {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(153, 27, 27, 0.95) 100%) !important;
    border: 2px solid #fca5a5 !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.55), 0 0 15px rgba(252, 165, 165, 0.3) !important;
    animation: loginErrorPop 0.35s ease-out forwards;
    padding: 12px 18px !important;
    margin-top: 12px !important;
}

.login-error-banner .mud-alert-icon {
    font-size: 1.8rem !important;
    color: #ffffff !important;
}

.login-error-text {
    color: #ffffff !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    line-height: 1.4 !important;
}