/* ============================================
   RetireMe RetireMe - Professional Theme
   Financial Planning UX Design
   ============================================ */

/* Color Palette - Based on RetireMe Branding */
:root {
    /* Primary Brand Colors */
    --retire-me-blue: #2E5C8A;
    --retire-me-teal: #4FB3D9;
    --retire-me-blue-dark: #1a3d5c;
    --retire-me-teal-light: #7CCDE8;

    /* Functional Colors */
    --success-green: #2E7D32;
    --success-green-light: #4CAF50;
    --warning-orange: #ED6C02;
    --warning-orange-light: #FF9800;
    --error-red: #C62828;
    --error-red-light: #F44336;

    /* Neutral Colors */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --background-light: #F9FAFB;
    --background-white: #FFFFFF;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* Base Styles */
html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--background-light);
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #FFF3CD;
    border-top: 2px solid var(--warning-orange);
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    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;
}

/* ============================================
   Category Styling - Bold Text with Color
   ============================================ */

.category-label {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.category-label:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* System Categories */
.category-system {
    color: var(--retire-me-blue);
    font-weight: 700;
}

/* ============================================
   Financial Data Display
   ============================================ */

.amount-positive {
    color: var(--success-green);
    font-weight: 600;
}

.amount-negative {
    color: var(--error-red);
    font-weight: 600;
}

.amount-neutral {
    color: var(--text-primary);
    font-weight: 500;
}

/* Confidence Indicators */
.confidence-high {
    color: var(--success-green);
    font-weight: 600;
}

.confidence-medium {
    color: var(--warning-orange);
    font-weight: 600;
}

.confidence-low {
    color: var(--error-red);
    font-weight: 600;
}

.confidence-user {
    color: var(--retire-me-blue);
    font-weight: 700;
}

/* ============================================
   Table Enhancements
   ============================================ */

.mud-table {
    background-color: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mud-table-cell {
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.mud-table-row:hover {
    background-color: rgba(47, 92, 138, 0.02) !important;
}

.mud-table-head {
    background-color: var(--background-light);
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* ============================================
   Card Styling
   ============================================ */

.mud-card {
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--border-color);
}

.mud-card-header {
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Button Styling
   ============================================ */

.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--retire-me-blue) 0%, var(--retire-me-teal) 100%) !important;
    box-shadow: 0 2px 4px rgba(46, 92, 138, 0.2) !important;
}

.mud-button-filled-primary:hover {
    box-shadow: 0 4px 8px rgba(46, 92, 138, 0.3) !important;
    transform: translateY(-1px);
}

/* ============================================
   Navigation & AppBar
   ============================================ */

.mud-appbar {
    background: var(--background-white) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid var(--border-color);
}

.mud-appbar .mud-icon-button {
    color: var(--retire-me-blue) !important;
}

.mud-appbar .mud-text {
    color: var(--text-primary) !important;
}

.mud-drawer {
    border-right: 1px solid var(--border-color) !important;
}

.mud-navmenu .mud-nav-link {
    border-radius: 8px;
    margin: 4px 8px;
    transition: all 0.2s ease;
}

.mud-navmenu .mud-nav-link:hover {
    background-color: rgba(46, 92, 138, 0.08) !important;
}

.mud-navmenu .mud-nav-link-selected {
    background-color: rgba(46, 92, 138, 0.12) !important;
    color: var(--retire-me-blue) !important;
    font-weight: 600;
}

/* ============================================
   Form Controls
   ============================================ */

.mud-input-outlined {
    border-radius: 6px;
}

.mud-input-outlined:hover {
    border-color: var(--retire-me-teal);
}

.mud-input-outlined.mud-input-focused {
    border-color: var(--retire-me-blue);
}

/* ============================================
   Alerts & Notifications
   ============================================ */

.mud-alert-info {
    background-color: rgba(79, 179, 217, 0.1);
    border-left: 4px solid var(--retire-me-teal);
}

.mud-alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-green);
}

.mud-alert-warning {
    background-color: rgba(255, 152, 0, 0.1);
    border-left: 4px solid var(--warning-orange);
}

.mud-alert-error {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error-red);
}

/* ============================================
   Progress Indicators
   ============================================ */

.mud-progress-linear-bar {
    background: linear-gradient(90deg, var(--retire-me-blue) 0%, var(--retire-me-teal) 100%) !important;
}

/* ============================================
   Chips (Minimal Use)
   ============================================ */

.mud-chip {
    margin: 2px;
    font-weight: 500;
    border-radius: 6px;
}

/* ============================================
   Transaction Reasoning
   ============================================ */

.transaction-reasoning {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
    padding-left: 20px;
    border-left: 2px solid var(--retire-me-teal);
}

/* ============================================
   Dashboard & Reports
   ============================================ */

.stat-card {
    background: linear-gradient(135deg, var(--retire-me-blue) 0%, var(--retire-me-teal) 100%);
    color: white;
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(46, 92, 138, 0.15);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-primary-brand {
    color: var(--retire-me-blue);
}

.text-accent-brand {
    color: var(--retire-me-teal);
}

.bg-brand-gradient {
    background: linear-gradient(135deg, var(--retire-me-blue) 0%, var(--retire-me-teal) 100%);
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rounded-lg {
    border-radius: 12px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .mud-table-cell {
        padding: 8px 12px !important;
        font-size: 0.875rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid var(--retire-me-teal);
    outline-offset: 2px;
}

/* ============================================
   UI Density Overrides - Compact Mode
   ============================================ */

/* Reduce MudBlazor input field sizes */
.mud-input-root {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.mud-input-label {
    font-size: 0.875rem !important;
}

/* Tighter button padding */
.mud-button-root {
    padding: 6px 14px !important;
}

.mud-button-root.mud-button-small {
    padding: 4px 10px !important;
}

/* Reduce card content padding */
.mud-card-content {
    padding: 12px 16px !important;
}

.mud-card-header {
    padding: 10px 16px !important;
}

/* Tighter table cells */
.mud-table-cell {
    padding: 8px 12px !important;
}

/* Reduce select/dropdown padding */
.mud-select .mud-input-slot {
    padding: 6px 8px !important;
}

/* Tighter form spacing */
.mud-form > .mud-input-control {
    margin-bottom: 12px !important;
}

/* Reduce alert padding */
.mud-alert {
    padding: 8px 12px !important;
}

/* Tighter grid spacing */
.mud-grid-spacing-xs-3 > .mud-grid-item {
    padding: 8px !important;
}

/* Reduce nav menu item size */
.mud-navmenu .mud-nav-link {
    padding: 8px 12px !important;
    margin: 2px 8px !important;
}

/* Compact dialog content */
.mud-dialog-content {
    padding: 16px !important;
}

/* Reduce chip size */
.mud-chip {
    padding: 2px 8px !important;
    font-size: 0.8rem !important;
}
