/*
 * NemAbo - Clean Professional Theme 2025
 * Optimized for simplicity and readability
 * NO !important declarations - using proper CSS specificity
 */

/* ==========================================================================
   THEME VARIABLES
   ========================================================================== */

:root {
    --app-border-radius: 8px;
    --app-transition: all 0.2s ease;
    --app-primary: #1565C0;
    --app-primary-dark: #0D47A1;
    --app-primary-light: #42A5F5;
    --app-secondary: #F57C00;
    --app-text-primary: rgba(0,0,0,0.87);
    --app-text-secondary: rgba(0,0,0,0.60);
    --app-text-disabled: rgba(0,0,0,0.38);
    --app-surface: #ffffff;
    --app-background: #f5f5f5;
    --app-divider: rgba(0,0,0,0.12);
}

/* ==========================================================================
   GLOBAL FIXES
   ========================================================================== */

html body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==========================================================================
   LIGHT THEME FOR PUBLIC PAGES - Using CSS Variables & High Specificity
   ========================================================================== */

/* Override MudBlazor CSS variables globally for public pages */
div.checkout-layout,
div.login-container,
div.register-container,
div.homepage-container {
    background-color: var(--app-background);

    --mud-palette-primary: var(--app-primary);
    --mud-palette-primary-text: var(--app-primary);
    --mud-palette-primary-darken: var(--app-primary-dark);
    --mud-palette-primary-lighten: var(--app-primary-light);

    --mud-palette-secondary: var(--app-secondary);
    --mud-palette-secondary-text: var(--app-secondary);

    --mud-palette-text-primary: var(--app-text-primary);
    --mud-palette-text-secondary: var(--app-text-secondary);
    --mud-palette-text-disabled: var(--app-text-disabled);

    --mud-palette-surface: var(--app-surface);
    --mud-palette-background: var(--app-background);
    --mud-palette-background-grey: #fafafa;
    --mud-palette-drawer-background: var(--app-surface);
    --mud-palette-appbar-background: var(--app-surface);

    --mud-palette-action-default: rgba(0,0,0,0.54);
    --mud-palette-action-disabled: rgba(0,0,0,0.26);

    --mud-palette-divider: var(--app-divider);
    --mud-palette-lines-default: var(--app-divider);
    --mud-palette-lines-inputs: rgba(0,0,0,0.42);
}

/* Cards - white with high specificity */
div.checkout-layout .mud-paper.mud-elevation-1,
div.checkout-layout .mud-paper.mud-elevation-2,
div.checkout-layout .mud-paper.mud-elevation-3,
div.login-container .mud-paper,
div.register-container .mud-paper,
div.homepage-container .mud-paper {
    background-color: var(--app-surface);
    color: var(--app-text-primary);
}

/* All text - dark with high specificity */
div.checkout-layout .mud-typography.mud-text-primary,
div.login-container .mud-typography.mud-text-primary,
div.register-container .mud-typography.mud-text-primary,
div.homepage-container .mud-typography.mud-text-primary {
    color: var(--app-text-primary);
}

div.checkout-layout .mud-typography.mud-text-secondary,
div.login-container .mud-typography.mud-text-secondary,
div.register-container .mud-typography.mud-text-secondary,
div.homepage-container .mud-typography.mud-text-secondary {
    color: var(--app-text-secondary);
}

/* Input fields with high specificity */
div.checkout-layout .mud-input-outlined.mud-input,
div.login-container .mud-input-outlined.mud-input,
div.register-container .mud-input-outlined.mud-input,
div.homepage-container .mud-input-outlined.mud-input {
    background-color: var(--app-surface);
}

div.checkout-layout .mud-input-slot.mud-input-root,
div.login-container .mud-input-slot.mud-input-root,
div.register-container .mud-input-slot.mud-input-root,
div.homepage-container .mud-input-slot.mud-input-root,
div.checkout-layout input.mud-input-slot,
div.login-container input.mud-input-slot,
div.register-container input.mud-input-slot,
div.homepage-container input.mud-input-slot {
    background-color: var(--app-surface);
    color: var(--app-text-primary);
}

/* Labels with high specificity */
div.checkout-layout label.mud-input-label,
div.login-container label.mud-input-label,
div.register-container label.mud-input-label,
div.homepage-container label.mud-input-label {
    color: var(--app-text-secondary);
}

/* Focused label */
div.checkout-layout .mud-input.mud-focused label.mud-input-label,
div.login-container .mud-input.mud-focused label.mud-input-label,
div.register-container .mud-input.mud-focused label.mud-input-label,
div.homepage-container .mud-input.mud-focused label.mud-input-label {
    color: var(--app-primary);
}

/* Icons with high specificity */
div.checkout-layout .mud-input-adornment.mud-input-adornment-start,
div.checkout-layout .mud-input-adornment.mud-input-adornment-end,
div.login-container .mud-input-adornment,
div.register-container .mud-input-adornment,
div.homepage-container .mud-input-adornment {
    color: rgba(0, 0, 0, 0.54);
}

/* Buttons with high specificity */
div.checkout-layout button.mud-button-filled.mud-button-filled-primary,
div.login-container button.mud-button-filled.mud-button-filled-primary,
div.register-container button.mud-button-filled.mud-button-filled-primary,
div.homepage-container button.mud-button-filled.mud-button-filled-primary {
    background-color: var(--app-primary);
    color: #ffffff;
}

/* Links with high specificity */
div.checkout-layout a.mud-link,
div.login-container a.mud-link,
div.register-container a.mud-link,
div.homepage-container a.mud-link {
    color: var(--app-primary);
}

/* Alerts with high specificity */
div.checkout-layout .mud-alert.mud-alert-standard,
div.login-container .mud-alert.mud-alert-standard,
div.register-container .mud-alert.mud-alert-standard,
div.homepage-container .mud-alert.mud-alert-standard {
    background-color: #e3f2fd;
    color: var(--app-text-primary);
}

/* Dividers with high specificity */
div.checkout-layout .mud-divider.mud-divider-fullwidth,
div.login-container .mud-divider,
div.register-container .mud-divider,
div.homepage-container .mud-divider {
    background-color: var(--app-divider);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.mud-nav-link {
    border-radius: var(--app-border-radius);
    margin: 4px 8px;
    transition: var(--app-transition);
}

.mud-nav-link.active {
    font-weight: 600;
}

/* ==========================================================================
   CARDS & PAPERS
   ========================================================================== */

.mud-paper {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Stat cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-card-icon.mud-icon-root {
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0.1;
    font-size: 56px;
}

/* Highlight cards (blue background) */
.highlight-card.mud-paper {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
}

.highlight-card.mud-paper .mud-input-slot {
    background-color: rgba(255,255,255,0.95);
    border-radius: var(--app-border-radius);
    color: #212121;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */

.mud-table .mud-table-head th.mud-table-cell {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mud-table .mud-table-row {
    transition: background-color 0.15s ease;
}

/* ==========================================================================
   FORM INPUTS - Browser autofill fix
   ========================================================================== */

input.mud-input-slot:-webkit-autofill,
input.mud-input-slot:-webkit-autofill:hover,
input.mud-input-slot:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--mud-palette-surface) inset;
    -webkit-text-fill-color: var(--mud-palette-text-primary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.mud-button-root {
    border-radius: var(--app-border-radius);
    transition: var(--app-transition);
}

.mud-button-filled:hover {
    transform: translateY(-1px);
}

/* ==========================================================================
   CHIPS & BADGES
   ========================================================================== */

.mud-chip {
    border-radius: 16px;
    font-weight: 500;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.mud-alert {
    border-radius: var(--app-border-radius);
}

/* ==========================================================================
   DIALOGS
   ========================================================================== */

.mud-dialog.mud-dialog-default {
    border-radius: 12px;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.text-bold { font-weight: 600; }
.text-medium { font-weight: 500; }

.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

*:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   ADMIN LAYOUT - Modern FinTech Design
   ========================================================================== */

/* App Bar - Clean and professional */
.mud-appbar.mud-appbar-fixed-top {
    backdrop-filter: blur(10px);
    background: rgba(var(--mud-palette-primary-rgb), 0.95);
}

/* Drawer/Sidebar - Modern look */
.mud-drawer {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-drawer .mud-navmenu {
    padding: 8px;
}

.mud-drawer .mud-nav-link {
    border-radius: 10px;
    margin: 2px 0;
    padding: 12px 16px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mud-drawer .mud-nav-link:hover {
    background: rgba(21, 101, 192, 0.08);
}

.mud-drawer .mud-nav-link.active {
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.12) 0%, rgba(21, 101, 192, 0.06) 100%);
    color: var(--app-primary);
    font-weight: 600;
}

.mud-drawer .mud-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--app-primary);
    border-radius: 0 3px 3px 0;
}

/* ==========================================================================
   ADMIN CARDS - Modern FinTech Style
   ========================================================================== */

/* Base card improvements */
.mud-paper.mud-elevation-1 {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mud-paper.mud-elevation-2 {
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.mud-paper.mud-elevation-3 {
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Stat cards - Premium look */
.stat-card.mud-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.stat-card.mud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
}

.stat-card .mud-card-content {
    padding: 24px;
}

.stat-card .stat-card-icon.mud-icon-root {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.08;
    font-size: 64px;
    color: var(--app-primary);
}

/* Highlight card - Gradient primary */
.highlight-card.mud-paper {
    border-radius: 20px;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 50%, #0A3A7D 100%);
    color: white;
    border: none;
    box-shadow: 0 20px 40px -10px rgba(21, 101, 192, 0.35);
    overflow: hidden;
    position: relative;
}

.highlight-card.mud-paper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.highlight-card .mud-input-filled {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
}

/* Quick Actions Card */
.mud-card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-card-header .mud-typography-h6 {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

/* ==========================================================================
   ADMIN BUTTONS - Modern styling
   ========================================================================== */

/* Primary button - Gradient */
.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    border-radius: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px -3px rgba(21, 101, 192, 0.4);
    transition: all 0.2s ease;
}

.mud-button-filled.mud-button-filled-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -3px rgba(21, 101, 192, 0.5);
}

/* Text buttons */
.mud-button-text.mud-button-text-primary {
    border-radius: 10px;
    font-weight: 500;
    text-transform: none;
}

/* ==========================================================================
   ADMIN TABLES - Clean modern look
   ========================================================================== */

.mud-table {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-table .mud-table-head {
    background: #f8fafc;
}

.mud-table .mud-table-head th.mud-table-cell {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.mud-table .mud-table-body td.mud-table-cell {
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mud-table .mud-table-row:hover {
    background: rgba(21, 101, 192, 0.02);
}

.mud-table .mud-table-row:last-child td.mud-table-cell {
    border-bottom: none;
}

/* ==========================================================================
   ADMIN CHIPS & BADGES
   ========================================================================== */

.mud-chip {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.8125rem;
}

.mud-chip.mud-chip-color-success {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.mud-chip.mud-chip-color-error {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.mud-chip.mud-chip-color-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.mud-chip.mud-chip-color-info {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* ==========================================================================
   ADMIN ALERTS
   ========================================================================== */

.mud-alert {
    border-radius: 12px;
}

.mud-alert.mud-alert-filled-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.mud-alert.mud-alert-filled-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.mud-alert.mud-alert-filled-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.mud-alert.mud-alert-filled-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ==========================================================================
   ADMIN DIALOGS
   ========================================================================== */

.mud-dialog {
    border-radius: 20px;
    overflow: hidden;
}

.mud-dialog .mud-dialog-title {
    font-weight: 600;
    font-size: 1.25rem;
    padding: 24px 24px 16px;
}

.mud-dialog .mud-dialog-content {
    padding: 0 24px 16px;
}

.mud-dialog .mud-dialog-actions {
    padding: 16px 24px 24px;
    gap: 12px;
}

/* ==========================================================================
   ADMIN PROGRESS INDICATORS
   ========================================================================== */

.mud-progress-linear {
    border-radius: 4px;
    overflow: hidden;
}

.mud-progress-linear .mud-progress-linear-bar {
    background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-primary-light) 100%);
}

/* ==========================================================================
   ADMIN TEXT & TYPOGRAPHY
   ========================================================================== */

.grey-text-lighten-1 {
    color: #64748b;
}

.success-text {
    color: #16a34a;
    font-weight: 500;
}

.error-text {
    color: #dc2626;
    font-weight: 500;
}

.warning-text {
    color: #d97706;
    font-weight: 500;
}

/* Page titles */
.mud-typography.mud-typography-h5 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   ADMIN FORM INPUTS
   ========================================================================== */

.mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px;
    border-color: #e2e8f0;
    transition: all 0.2s ease;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #cbd5e1;
}

.mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

/* ==========================================================================
   ADMIN SELECT/DROPDOWN
   ========================================================================== */

.mud-popover-paper {
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mud-list-item {
    border-radius: 8px;
    margin: 2px 4px;
}

/* ==========================================================================
   ADMIN DARK MODE ADJUSTMENTS
   ========================================================================== */

.mud-theme-dark .stat-card.mud-card {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .stat-card.mud-card::before {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

.mud-theme-dark .mud-paper {
    border-color: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .mud-table .mud-table-head {
    background: #1e293b;
}

.mud-theme-dark .mud-table .mud-table-head th.mud-table-cell {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .mud-table .mud-table-body td.mud-table-cell {
    border-color: rgba(255, 255, 255, 0.04);
}

.mud-theme-dark .mud-card-header {
    border-color: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .mud-typography.mud-typography-h5 {
    color: #f1f5f9;
}

.mud-theme-dark .grey-text-lighten-1 {
    color: #94a3b8;
}
