/* ===== BidSmart BackOffice - Main Styles ===== */

/* ===== Design Tokens ===== */
:root {
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --input-height-sm: 40px;
    --input-height-md: 48px;
    --input-height-lg: 56px;
}


/* Base Styles */
html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

/* ===== Light Mode (default) ===== */
body.light {
    background-color: #F9FAFB;
    color: #1F2937;
}

body.light .mud-appbar {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB;
}

body.light .mud-drawer {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E5E7EB;
}

/* ===== Dark Mode Styles ===== */
body.dark {
    background-color: #121212 !important;
    color: #F9FAFB !important;
}

body.dark .mud-appbar {
    background-color: #1E1E1E !important;
    border-bottom: 1px solid #374151;
}

body.dark .mud-drawer {
    background-color: #1E1E1E !important;
    border-right: 1px solid #374151;
    color: #F9FAFB !important;
}

body.dark .mud-paper,
body.dark .mud-card {
    background-color: #1E1E1E !important;
    color: #F9FAFB !important;
}

body.dark .mud-main-content {
    background-color: #121212 !important;
}

body.dark .mud-table {
    background-color: #1E1E1E !important;
}

body.dark .mud-table-row {
    background-color: #1E1E1E !important;
}

body.dark .mud-table-row:hover {
    background-color: #2D2D2D !important;
}

body.dark .mud-input,
body.dark .mud-input-control {
    color: #F9FAFB !important;
}

body.dark .mud-input-outlined-border {
    border-color: rgba(255,255,255,0.23) !important;
}

body.dark .mud-input-label {
    color: rgba(255,255,255,0.6) !important;
}

body.dark .mud-typography {
    color: #F9FAFB !important;
}

body.dark .mud-navmenu .mud-nav-item .mud-nav-link {
    color: #F9FAFB !important;
}

body.dark .mud-navmenu .mud-nav-item .mud-nav-link:hover {
    background-color: rgba(255,255,255,0.08) !important;
}

body.dark .mud-list-item {
    color: #F9FAFB !important;
}

body.dark .mud-menu-item:hover {
    background-color: rgba(255,255,255,0.08) !important;
}

body.dark .mud-button-text {
    color: #F9FAFB !important;
}

body.dark .mud-checkbox .mud-primary-text {
    color: #F9FAFB !important;
}

body.dark a {
    color: #A78BFA !important;
}

body.dark .mud-link {
    color: #A78BFA !important;
}

body.dark .mud-text-secondary {
    color: #9CA3AF !important;
}

body.dark .mud-nav-group-title {
    color: #F9FAFB !important;
}

body.dark .mud-nav-group .mud-icon-root {
    color: #9CA3AF !important;
}

body.dark .mud-icon-button {
    color: #F9FAFB !important;
}

body.dark .mud-select,
body.dark .mud-select-input {
    color: #F9FAFB !important;
}

body.dark .mud-popover {
    background-color: #1E1E1E !important;
}

body.dark .mud-list {
    background-color: #1E1E1E !important;
}

body.dark .mud-chip {
    background-color: rgba(167, 139, 250, 0.2) !important;
}

body.dark .mud-divider {
    border-color: #374151 !important;
}

body.dark .mud-toolbar {
    background-color: #1E1E1E !important;
}

body.dark .mud-alert {
    background-color: #2D2D2D !important;
}

body.dark .mud-dialog {
    background-color: #1E1E1E !important;
}

body.dark .mud-snackbar {
    background-color: #2D2D2D !important;
}

body.dark .mud-text-primary {
    color: #F9FAFB !important;
}

body.dark .mud-nav-group .mud-collapse-icon {
    color: #9CA3AF !important;
}

body.dark .sidebar-logo {
    border-bottom-color: #374151 !important;
}

body.dark .help-box-gradient {
    background: linear-gradient(135deg, #A78BFA 0%, #F472B6 100%) !important;
}

/* ===== Sidebar Styles ===== */
.sidebar-drawer {
    background-color: var(--mud-palette-drawer-background);
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* ===== Topbar Styles ===== */
.topbar {
    border-bottom: 1px solid var(--mud-palette-divider);
}

.search-field .mud-input-outlined-border {
    border-radius: 8px;
}

.search-field .mud-input {
    background-color: var(--mud-palette-background);
}

/* ===== Footer Styles ===== */
.footer {
    border-top: 1px solid var(--mud-palette-divider);
    background-color: var(--mud-palette-surface);
}

/* ===== Main Content Styles ===== */
.main-content {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

/* ===== Page Header Styles ===== */
.page-header {
    padding: 0;
}

.page-header .mud-breadcrumbs {
    padding: 0;
}

/* ===== MudTextField Label Fix ===== */
.mud-input-control.mud-input-has-value .mud-input-label,
.mud-input-control .mud-input:focus ~ .mud-input-label {
    transform: translate(14px, -9px) scale(0.75) !important;
    padding: 0 4px;
}

body.light .mud-input-control.mud-input-has-value .mud-input-label,
body.light .mud-input-control .mud-input:focus ~ .mud-input-label {
    background-color: #FFFFFF;
}

body.dark .mud-input-control.mud-input-has-value .mud-input-label,
body.dark .mud-input-control .mud-input:focus ~ .mud-input-label {
    background-color: #1E1E1E;
}

/* ===== Native Select Styling ===== */
.mud-input-slot select,
select.mud-input-slot {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    outline: none;
    font-size: 1rem;
    line-height: 1.4375em;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,0.54)' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px !important;
}

body.dark .mud-input-slot select,
body.dark select.mud-input-slot {
    color: #F9FAFB;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.mud-input-slot select option {
    padding: 10px;
}

body.dark .mud-input-slot select option {
    background-color: #1E1E1E;
    color: #F9FAFB;
}

body.light .mud-input-control .mud-input-label-inputcontrol {
    background-color: #FFFFFF;
}

body.dark .mud-input-control .mud-input-label-inputcontrol {
    background-color: #1E1E1E;
}

/* ===== NavMenu Styles ===== */
.mud-nav-group .mud-nav-link {
    padding-left: 2rem;
}

.mud-navmenu .mud-nav-group-title {
    font-weight: 500;
}

/* ===== Card Styles ===== */
.mud-card {
    border-radius: 12px;
    border: 1px solid var(--mud-palette-divider);
}

body.light .mud-card {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

body.dark .mud-card {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
}

/* ===== Button Styles ===== */
.mud-button {
    border-radius: 8px;
    text-transform: none;
}

/* ===== Chip Styles ===== */
.mud-chip {
    border-radius: 6px;
}

/* ===== Table Styles ===== */
.mud-table {
    border-radius: 12px;
    overflow: hidden;
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    background-color: var(--mud-palette-background);
}

/* ===== Dialog Styles ===== */
.mud-dialog {
    border-radius: 16px;
}

/* ===== Drawer Overlay ===== */
.mud-overlay {
    z-index: 1200;
}

/* ===== Scrollbar Styles ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

body.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

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

body.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ===== Blazor Error Boundary ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg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NTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

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

/* ===== Validation Styles ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10B981;
}

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

.validation-message {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 960px) {
    .mud-drawer {
        position: fixed !important;
        z-index: 1300 !important;
    }
}

/* ===== Animation ===== */
.mud-drawer {
    transition: transform 0.3s ease, width 0.3s ease;
}

.mud-main-content {
    transition: margin-left 0.3s ease;
}

/* ===== Help Box Gradient ===== */
.help-box-gradient {
    background: linear-gradient(135deg, var(--mud-palette-primary) 0%, var(--mud-palette-secondary) 100%);
}

/* ===== Auth Layout Styles ===== */
.auth-card {
    max-width: 480px;
    width: 100%;
    border-radius: 16px !important;
}

body.light .auth-card {
    background-color: #FFFFFF !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark .auth-card {
    background-color: #1E1E1E !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Social Login Buttons */
.social-login-btn {
    border-radius: 8px !important;
    border: 1px solid !important;
    transition: all 0.3s ease !important;
}

body.light .social-login-btn {
    border-color: #E5E7EB !important;
    color: #1F2937 !important;
}

body.light .social-login-btn:hover {
    background-color: #F3F4F6 !important;
}

body.dark .social-login-btn {
    border-color: #374151 !important;
    color: #F9FAFB !important;
}

body.dark .social-login-btn:hover {
    background-color: #374151 !important;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
}

body.light .auth-divider-line {
    background-color: rgba(0, 0, 0, 0.1);
}

body.dark .auth-divider-line {
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-divider-text {
    padding: 0 1rem;
    white-space: nowrap;
}

body.light .auth-divider-text {
    color: #6B7280;
}

body.dark .auth-divider-text {
    color: #9CA3AF;
}
