/* Custom Styles for Mosaic App */

:root {
    --primary-color: #1d5390; /* A brighter, more vibrant blue */
    --secondary-color: #FFD700; /* Gold accent */
    --dark-bg: #2c3e50; /* Dark blue-gray for navbar */
    --light-bg: #f4f7f6; /* Very light gray-blue for body */
    --text-color: #333;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-bg: #e9ecef;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navbar Enhancements */
.navbar {
    background: linear-gradient(135deg, var(--dark-bg), #34495e) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-brand, .navbar-nav .nav-link {
    color: #ecf0f1 !important;
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

.navbar-text {
    color: #bdc3c7 !important;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    background-color: #fff;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
    font-weight: 600;
}

.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6 {
    color: white !important;
    margin-bottom: 0;
}

/* Dashboard specific overrides (if card header is used for title) */
.dashboard-section-title {
    color: var(--dark-bg);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
    display: inline-block;
}

/* Scrollable Areas in Dashboard */
.scrollable-list-container {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* List Group Items */
.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.list-group-item:hover {
    border-left: 3px solid var(--primary-color);
    background-color: #f8f9fa;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #357abd;
    border-color: #357abd;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden; /* For rounded corners on table */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table thead th {
    background-color: #dfe6e9;
    color: var(--dark-bg);
    border-bottom: 2px solid #b2bec3;
}

/* Headings */
h1, h2, h3, h4, h5, h6{
    color: var(--dark-bg);
}

h1 {
    font-weight: 700;
}

/* Alerts */
.alert {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Table Scrollability */
.table-responsive-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
}

.table-responsive-scroll > .table {
    margin-bottom: 0; /* Remove default table margin */
}

/* Dark Theme Overrides */
body.dark-theme {
    --primary-color: #1d5390; 
    --secondary-color: #FFD700;
    --dark-bg: #1a252f;
    --light-bg: #121212; 
    --text-color: #e0e0e0;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --header-bg: #2c3e50;
    --card-bg: #1e1e1e;
    --input-bg: #2b2b2b;
    --input-border: #444;
}

body.dark-theme {
    background-color: var(--light-bg);
    color: var(--text-color);
}

body.dark-theme .card {
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--card-shadow);
}

/* Improved Dark Mode Tables */
body.dark-theme .table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--text-color);
    --bs-table-striped-bg: #2c2c2c;
    --bs-table-striped-color: var(--text-color);
    --bs-table-hover-bg: #333;
    --bs-table-hover-color: var(--text-color);
    background-color: var(--card-bg);
    color: var(--text-color);
}

body.dark-theme .table thead th {
    background-color: #2c2c2c;
    color: #fff;
    border-bottom: 2px solid #444;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--bs-table-striped-bg);
    color: var(--bs-table-striped-color);
    box-shadow: none;
}

body.dark-theme .table > :not(caption) > * > * {
    background-color: transparent; /* Important for row colors to show */
    color: inherit;
}

body.dark-theme .list-group-item {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: #444;
}

body.dark-theme .list-group-item:hover {
    background-color: #2c2c2c;
}

body.dark-theme .form-control, body.dark-theme .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-color);
}

body.dark-theme .form-control:focus, body.dark-theme .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--primary-color);
}

body.dark-theme h1, body.dark-theme h2, body.dark-theme h3, body.dark-theme h4, body.dark-theme h5, body.dark-theme h6 {
    color: #ecf0f1;
}

body.dark-theme .dashboard-section-title {
    color: #ecf0f1;
}

body.dark-theme .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid #444;
}

body.dark-theme .modal-header, body.dark-theme .modal-footer {
    border-color: #444;
}

body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-theme .dropdown-menu {
    background-color: var(--card-bg);
    border-color: #444;
}

body.dark-theme .dropdown-item {
    color: var(--text-color);
}

body.dark-theme .dropdown-item:hover {
    background-color: #2c2c2c;
    color: #fff;
}

body.dark-theme .scrollable-list-container {
    background-color: var(--card-bg);
    border-color: #444;
}

body.dark-theme .text-muted {
    color: #aaa !important;
}

/* Product Inventory Table Styling */
.product-name-col {
    max-width: 250px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.actions-col {
    white-space: nowrap;
    width: 1%;
    min-width: 220px;
}

/* Flex-based Product List Styling */
.product-info-flex {
    flex-grow: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
