/* LactoSync Theme - Matching React Design */

:root {
    /* Primary Colors - Blue Theme */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    /* Status Colors */
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --orange-100: #ffedd5;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-900: #1e3a8a;
    --indigo-100: #e0e7ff;
    --indigo-600: #4f46e5;
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    /* Spacing & Sizing */
    --border-radius: 0.5rem;
    --border-radius-sm: 0.375rem;
    --border-radius-lg: 0.75rem;
    --border-radius-full: 9999px;
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Borders */
    --border-color: var(--gray-200);
    --border-color-light: var(--gray-100);
    --border-color-dark: var(--gray-300);
    --border-width: 1px;
    
    /* Spacing - Extended */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 0.75rem;   /* 12px */
    --spacing-lg: 1rem;      /* 16px */
    --spacing-xl: 1.5rem;    /* 24px */
    --spacing-2xl: 2rem;     /* 32px */
    
    /* Component-specific colors */
    --card-bg: white;
    --card-border: var(--gray-200);
    --filter-bar-bg: white;
    --filter-bar-border: var(--gray-200);
    --bulk-actions-bg: var(--blue-100);
    --bulk-actions-border: var(--blue-400);
    --bulk-actions-text: var(--blue-900);
    
    /* Typography sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Dark theme support */
.mud-theme-dark,
[data-theme="dark"] {
    /* Dark mode color overrides */
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
    
    /* Component colors */
    --card-bg: #1f2937;
    --card-border: #374151;
    --filter-bar-bg: #1f2937;
    --filter-bar-border: #374151;
    --bulk-actions-bg: #1e3a8a;
    --bulk-actions-border: #3b82f6;
    --bulk-actions-text: #dbeafe;
    
    /* Background colors */
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #93c5fd;
}

/* Dark mode body background */
.mud-theme-dark body,
.mud-theme-dark .main-content {
    background-color: #111827 !important;
}

/* Dark mode card styles */
.mud-theme-dark .card-custom {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

/* Dark mode navbar */
.mud-theme-dark .navbar-custom {
    background-color: #1f2937 !important;
    border-bottom-color: #374151 !important;
}

/* Dark mode text colors */
.mud-theme-dark .text-gray-400,
.mud-theme-dark .text-gray-500,
.mud-theme-dark .text-gray-600,
.mud-theme-dark .text-gray-700,
.mud-theme-dark .text-gray-900 {
    color: var(--gray-500) !important;
}

/* Dark mode MudBlazor component overrides */
.mud-theme-dark .mud-paper {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

.mud-theme-dark .mud-table-head {
    background-color: #374151 !important;
}

.mud-theme-dark .mud-table-cell {
    border-bottom-color: #4b5563 !important;
    color: #f9fafb !important;
}

.mud-theme-dark .mud-table-row:hover {
    background-color: #374151 !important;
}

.mud-theme-dark .stat-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Adjustments */
.main-content {
    min-height: 100vh;
    background-color: var(--gray-50);
}

/* Card Styles */
.card-custom {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Badge Styles */
.badge-primary {
    background-color: var(--blue-100);
    color: var(--blue-900);
    padding: 0.125rem 0.625rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
}

.badge-success {
    background-color: var(--green-100);
    color: var(--green-700);
}

.badge-warning {
    background-color: var(--amber-100);
    color: var(--amber-700);
}

.badge-danger {
    background-color: var(--red-100);
    color: var(--red-600);
}

.badge-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* Button Styles */
.btn-custom {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-medium);
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

    .btn-primary:hover {
        background-color: var(--primary-hover);
    }

/* MudBlazor Overrides for Matching React Design */
.mud-paper {
    background-color: white !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--border-radius-lg) !important;
}

.mud-table {
    border-radius: var(--border-radius-lg);
}

.mud-table-head {
    background-color: var(--gray-50);
}

.mud-table-cell {
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.mud-table-row:hover {
    background-color: var(--gray-50);
}

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

.mud-chip {
    border-radius: var(--border-radius-full);
}

/* Navbar Styles */
.navbar-custom {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 73px;
}

/* Stat Cards */
.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem;
}

.stat-card-icon {
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .stat-card-icon.green {
        background-color: var(--green-100);
        color: var(--green-600);
    }

    .stat-card-icon.orange {
        background-color: var(--orange-100);
        color: var(--orange-600);
    }

    .stat-card-icon.blue {
        background-color: var(--blue-100);
        color: var(--blue-600);
    }

    .stat-card-icon.purple {
        background-color: var(--purple-100);
        color: var(--purple-600);
    }

    .stat-card-icon.indigo {
        background-color: var(--indigo-100);
        color: var(--indigo-600);
    }

    .stat-card-icon.red {
        background-color: var(--red-100);
        color: var(--red-600);
    }

    .stat-card-icon.amber {
        background-color: var(--amber-100);
        color: var(--amber-600);
    }

/* Utility Classes */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.text-gray-400 {
    color: var(--gray-400);
}

.text-gray-500 {
    color: var(--gray-500);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-900 {
    color: var(--gray-900);
}

.text-blue-600 {
    color: var(--blue-600);
}

.text-green-600 {
    color: var(--green-600);
}

.text-red-600 {
    color: var(--red-600);
}

.text-amber-700 {
    color: var(--amber-700);
}

.bg-gray-50 {
    background-color: var(--gray-50);
}

.bg-gray-100 {
    background-color: var(--gray-100);
}

.bg-white {
    background-color: white;
}

/* Dialog Styles - Consistent Sizing with Scroll */
.dialog-medium .mud-dialog-content {
    max-height: 65vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.dialog-large .mud-dialog-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Smooth scrolling for dialog content */
.mud-dialog-content {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

    .mud-dialog-content::-webkit-scrollbar {
        width: 8px;
    }

    .mud-dialog-content::-webkit-scrollbar-track {
        background: var(--gray-100);
        border-radius: 4px;
    }

    .mud-dialog-content::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 4px;
    }

        .mud-dialog-content::-webkit-scrollbar-thumb:hover {
            background: var(--gray-400);
        }

/* Responsive dialog sizing */
@media (max-width: 768px) {
    .dialog-medium .mud-dialog-content,
    .dialog-large .mud-dialog-content {
        max-height: 80vh;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dialog-medium .mud-dialog-content,
    .dialog-large .mud-dialog-content {
        max-height: 85vh;
        padding: 0.75rem;
    }
}

.hide-datagrid-toolbar .mud-table-toolbar {
    display: none !important;
}

/* Snackbar Position - Adjust top position for top-right snackbars */
/* Multiple selectors to ensure it works with different MudBlazor versions */
.mud-snackbar-location-top-right,
.mud-snackbar-container.mud-snackbar-location-top-right,
.mud-snackbar-provider .mud-snackbar-location-top-right,
div.mud-snackbar-location-top-right,
[class*="mud-snackbar"][class*="top-right"] {
    top: 65px !important;
}

    /* If MudBlazor uses inline styles, we need to override them */
    .mud-snackbar-location-top-right[style*="top"] {
        top: 65px !important;
    }

/* ============================================
   Utility Classes - Common One-Line Styles
   ============================================ */

/* Margin Utilities */
.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.ml-0 {
    margin-left: 0;
}

.mr-0 {
    margin-right: 0;
}

/* Padding Utilities */
.p-0 {
    padding: 0;
}

.pt-0 {
    padding-top: 0;
}

.pb-0 {
    padding-bottom: 0;
}

.pl-0 {
    padding-left: 0;
}

.pr-0 {
    padding-right: 0;
}

/* Display Utilities */
.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-inline {
    display: inline;
}

.d-inline-block {
    display: inline-block;
}

.d-none {
    display: none;
}

/* Flex Direction */
.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

/* Flex Alignment */
.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

/* Width Utilities */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

/* Font Weight Utilities */
.fw-medium {
    font-weight: var(--font-weight-medium);
}

.fw-semibold {
    font-weight: var(--font-weight-semibold);
}

.fw-bold {
    font-weight: var(--font-weight-bold);
}

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}


.mud-popover .mud-list {
    max-height: none !important;
}

.lacto-subscription-dialog .mud-stepper-actions {
    display: none !important;
}

/* ============================================
   Utility Classes for Common Patterns
   ============================================ */

/* Filter Bar Styles */
.filter-bar {
    padding: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--filter-bar-bg);
}

.filter-bar-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
}

.filter-bar-spacer {
    flex: 1;
}

.filter-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Search Container */
.search-container {
    position: relative;
    width: 320px;
}

.search-container-full {
    width: 100%;
}

/* Button Spacing */
.btn-spacing {
    margin: var(--spacing-sm);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background-color: var(--bulk-actions-bg);
    border-bottom: var(--border-width) solid var(--bulk-actions-border);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bulk-actions-text {
    font-size: var(--text-sm);
    color: var(--bulk-actions-text);
    margin: 0;
}

.bulk-actions-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

/* DataGrid Styles */
.datagrid-clickable {
    cursor: pointer;
}

/* Text Styles */
.text-muted {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.text-muted-xs {
    color: var(--gray-500);
    font-size: var(--text-xs);
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--green-600);
}

.text-warning {
    color: var(--amber-600);
}

.text-danger {
    color: var(--red-600);
}

/* Spacing Utilities */
.margin-sm {
    margin: var(--spacing-sm);
}

.margin-md {
    margin: var(--spacing-md);
}

.margin-lg {
    margin: var(--spacing-lg);
}

.padding-sm {
    padding: var(--spacing-sm);
}

.padding-md {
    padding: var(--spacing-md);
}

.padding-lg {
    padding: var(--spacing-lg);
}

/* Border Utilities */
.border-bottom {
    border-bottom: var(--border-width) solid var(--border-color);
}

.border-top {
    border-top: var(--border-width) solid var(--border-color);
}

/* Flex Utilities */
.flex-1 {
    flex: 1;
}

.flex-gap-sm {
    gap: var(--spacing-sm);
}

.flex-gap-md {
    gap: var(--spacing-md);
}

.flex-gap-lg {
    gap: var(--spacing-lg);
}

/* Width Utilities */
.width-full {
    width: 100%;
}

.width-auto {
    width: auto;
}

/* Select Width Utilities */
.select-width-sm {
    width: 144px;
}

.select-width-md {
    width: 180px;
}

.select-width-lg {
    width: 240px;
}

/* Status Chip Styles */
.status-chip-active {
    background-color: var(--green-600);
    color: white;
    font-size: var(--text-xs);
}

.status-chip-paused {
    background-color: var(--amber-600);
    color: white;
    font-size: var(--text-xs);
}

.status-chip-inactive {
    background-color: var(--gray-500);
    color: white;
    font-size: var(--text-xs);
}

/* Product Icon Styles */
.product-icon {
    font-size: 1.25rem;
}

.product-name {
    font-size: var(--text-base);
    padding-top: 0.2rem;
    margin: 0;
}

/* Cell Content Styles */
.cell-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.cell-content-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.cell-content-start {
    display: flex;
    align-items: start;
    gap: var(--spacing-xs);
}

.cell-icon {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--gray-500);
    flex-shrink: 0;
}

.cell-icon-start {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--gray-500);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Chip Variants */
.chip-small {
    font-size: var(--text-xs);
    padding: 0.125rem 0.375rem;
}

.chip-outlined {
    font-size: var(--text-xs);
    padding: 0.125rem 0.5rem;
}

/* Typography Utilities */
.font-weight-medium {
    font-weight: var(--font-weight-medium);
}

.font-weight-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-weight-bold {
    font-weight: var(--font-weight-bold);
}

/* Color Utilities */
.color-gray-500 {
    color: var(--gray-500);
}

.color-gray-600 {
    color: var(--gray-600);
}

.color-gray-700 {
    color: var(--gray-700);
}

.color-gray-900 {
    color: var(--gray-900);
}

/* Background Utilities */
.bg-gray-50 {
    background-color: var(--gray-50);
}

.bg-gray-100 {
    background-color: var(--gray-100);
}

.bg-white {
    background-color: white;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .search-container {
        width: 100%;
    }
    
    .filter-bar-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar-actions {
        flex-wrap: wrap;
    }
}
