/* Tool Style CSS - Shared styling for all calculator tools */

/* Blue color palette for tools */
:root {
    --tool-primary: #1e88e5;
    --tool-primary-light: #42a5f5;
    --tool-primary-dark: #1565c0;
    --tool-secondary: #64b5f6;
    --tool-secondary-light: #90caf9;
    --tool-secondary-dark: #1976d2;
    --tool-accent: #0d47a1;
    --tool-accent-light: #1565c0;
    --tool-accent-dark: #0a3d91;
    
    --tool-success: #2e7d32;
    --tool-info: #0277bd;
    --tool-warning: #f57c00;
    --tool-danger: #c62828;
    
    --tool-bg-light: #f8fafc;
    --tool-bg-white: #ffffff;
    --tool-border: #e3f2fd;
    --tool-text: #1e293b;
    --tool-text-muted: #64748b;
    --tool-shadow: rgba(30, 136, 229, 0.1);
    --tool-shadow-hover: rgba(30, 136, 229, 0.2);
}

/* Tool Container Styling */
.tool-container {
    background: var(--tool-bg-white);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Chart Container Styling */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container canvas {
    max-height: 400px;
}

/* Enhanced Chart Styling */
.chart-card {
    background: var(--tool-bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--tool-shadow);
    border: 1px solid var(--tool-border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: 0 4px 20px var(--tool-shadow-hover);
    transform: translateY(-2px);
}

.chart-card .card-header {
    background: var(--tool-primary);
    border: none;
    padding: 0.75rem 1rem;
}

.chart-card .card-header h6 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.chart-card .card-header i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.chart-card .card-body {
    padding: 1rem;
    background: var(--tool-bg-white);
}

/* Chart Grid Layout */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Unit Toggle Button Styling */
.unit-toggle-group {
    margin-bottom: 1.5rem;
}

.unit-toggle-group .btn-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.unit-toggle-group .btn {
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.unit-toggle-group .btn-outline-primary {
    color: var(--tool-primary);
    background-color: white;
    border: 2px solid var(--tool-primary);
}

.unit-toggle-group .btn-outline-primary:hover {
    background-color: var(--tool-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.unit-toggle-group .btn-check:checked + .btn-outline-primary {
    background-color: var(--tool-primary);
    color: white;
    border-color: var(--tool-primary);
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.unit-toggle-group .btn i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* Input Group Unit Labels */
.input-group-text {
    background-color: var(--tool-primary);
    color: white;
    border: 1px solid var(--tool-primary);
    font-weight: 500;
    min-width: 50px;
    justify-content: center;
}

.charts-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-row .chart-card {
    flex: 1;
    min-width: 0;
}

/* Responsive Chart Adjustments */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chart-card .card-body {
        padding: 0.75rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
}

/* Chart Loading States */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: var(--tool-bg-light);
    border-radius: 8px;
}

.chart-loading .spinner-border {
    color: var(--tool-primary);
}

/* Chart Tooltip Enhancements */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: white !important;
}

/* Chart Legend Enhancements */
.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: var(--tool-bg-light);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--tool-text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Standard Chart Header Styling */
.chart-header {
    background: var(--tool-bg-white);
    border-bottom: 2px solid var(--tool-border);
    padding: 1rem 1.5rem;
}

.chart-header h5 {
    color: var(--tool-text) !important;
    font-weight: 600;
    margin: 0;
    font-size: 1.25rem;
}

.chart-header i {
    color: var(--tool-primary);
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

/* Calculator Form Styling */
.calculator-form {
    background: var(--tool-bg-white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--tool-shadow);
    border: 1px solid var(--tool-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.calculator-form:hover {
    box-shadow: 0 8px 30px var(--tool-shadow-hover);
    transform: translateY(-2px);
}

.calculator-form .card-header {
    background: var(--tool-primary);
    border: none;
    padding: 1rem 1.5rem;
}

.calculator-form .card-header h5 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 1.25rem;
}

/* Calculator Section Headers - Match main title styling */
.calculator-section .card-header {
    background: var(--tool-primary) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

.calculator-section .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    margin: 0 !important;
    font-size: 1.25rem !important;
}

.calculator-section .card-header i {
    color: white !important;
}

/* Force calculator section headers to use blue background - Override any other styles */
div.calculator-section .card-header {
    background: #1e88e5 !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

div.calculator-section .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    margin: 0 !important;
    font-size: 1.25rem !important;
}

div.calculator-section .card-header i {
    color: white !important;
}

/* Add spacing between calculator-form and calculator-section */
.calculator-section {
    margin-top: 2rem !important;
}

/* Add extra spacing for the first calculator section */
.calculator-section:first-of-type {
    margin-top: 3rem !important;
}

.calculator-form .card-body {
    padding: 2rem;
}

/* Form Controls */
.form-control, .form-select {
    border: 2px solid var(--tool-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--tool-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    outline: none;
}

.form-label {
    color: var(--tool-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-text {
    color: var(--tool-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn-primary {
    background: var(--tool-primary);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover {
    background: var(--tool-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: var(--tool-bg-white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--tool-shadow);
    border: 1px solid var(--tool-border);
    overflow: hidden;
    margin-top: 2rem;
}

/* Chart Container Styling */
.chart-container {
    position: relative;
    margin: 0 auto;
    padding: 1rem;
}

.chart-container canvas {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Charts Section Styling */
#chartsSection {
    margin-top: 2rem;
}

#chartsSection .card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#chartsSection .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#chartsSection .card-header {
    background: linear-gradient(135deg, var(--tool-primary) 0%, var(--tool-primary-dark) 100%);
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

#chartsSection .card-header h5 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

#chartsSection .card-body {
    padding: 1.5rem;
    background: var(--tool-bg-white);
    border-radius: 0 0 12px 12px;
}

/* Chart Grid Layout */
#chartsSection .row {
    margin-bottom: 2rem;
}

#chartsSection .col-lg-6 {
    margin-bottom: 1.5rem;
}

/* Responsive Chart Heights */
@media (max-width: 768px) {
    .chart-container {
        height: 300px !important;
    }
    
    #chartsSection .col-lg-6 {
        margin-bottom: 2rem;
    }
}

@media (min-width: 769px) {
    .chart-container {
        height: 400px !important;
    }
}

/* Chart Loading States */
.chart-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tool-bg-light);
    border-radius: 8px;
}

.chart-container.loading::after {
    content: "Loading chart...";
    color: var(--tool-text-muted);
    font-style: italic;
}

/* Chart Tooltips */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 6px !important;
    color: white !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
}

/* Chart Legend Styling */
.chartjs-legend {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chartjs-legend-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
}

.chartjs-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chartjs-legend-label {
    font-size: 14px;
    color: var(--tool-text);
    font-weight: 500;
}

.results-section .card-header {
    background: var(--tool-primary);
    border: none;
    padding: 1rem 1.5rem;
}

.results-section .card-header h4,
.results-section .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
}

.results-section .card-body {
    padding: 2rem;
}

/* Result Cards */
.result-card {
    background: var(--tool-bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--tool-border);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--tool-shadow-hover);
}

/* Example Cards - Special styling for calculation examples */
.result-card .d-flex.justify-content-between {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tool-border);
}

.result-card .d-flex.justify-content-between:last-child {
    border-bottom: none;
}

.result-card .fw-bold.text-primary {
    font-size: 1.1rem;
    color: var(--tool-primary) !important;
}

.result-card strong.text-primary {
    color: var(--tool-primary) !important;
    font-weight: 600;
}

.result-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--tool-primary);
}

.result-label {
    color: var(--tool-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Indicators */
.progress-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--tool-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    background: var(--tool-bg-white);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--tool-shadow);
    cursor: pointer;
}

.progress-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--tool-shadow-hover);
}

.progress-circle.completed {
    border-color: var(--tool-primary);
    background: var(--tool-primary);
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.progress-circle.current {
    border-color: var(--tool-primary);
    background: var(--tool-primary-light);
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
}

.stage-text {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--tool-text);
    line-height: 1.2;
}

.progress-circle.completed .stage-text {
    color: white;
    font-weight: 700;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(30, 136, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 136, 229, 0); }
}

/* Tables */
.table {
    background: var(--tool-bg-white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--tool-border);
}

.table thead th {
    background: var(--tool-primary);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody td {
    padding: 1rem;
    border-color: var(--tool-border);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--tool-bg-light);
}

/* Charts and Visualizations */
.chart-container {
    background: var(--tool-bg-white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--tool-border);
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px var(--tool-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--tool-shadow-hover);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tool-primary), var(--tool-primary-light));
}

.chart-container h6 {
    color: var(--tool-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--tool-border);
    padding-bottom: 0.75rem;
}

.chart-container canvas {
    border-radius: 8px;
    background: var(--tool-bg-light);
    padding: 1rem;
    max-width: 100%;
    height: auto;
}

/* Ensure chart containers are visible */
.chart-container {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    flex: 1;
    min-height: 250px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem 0;
    }
    
    .calculator-form .card-body,
    .results-section .card-body {
        padding: 1.5rem;
    }
    
    .result-number {
        font-size: 1.5rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Flatpickr Customization */
.flatpickr-input {
    background-color: var(--tool-bg-white);
    border: 2px solid var(--tool-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--tool-text);
    transition: all 0.3s ease;
}

.flatpickr-input:focus {
    border-color: var(--tool-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.flatpickr-calendar {
    font-family: inherit;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--tool-border);
    z-index: 9999 !important;
}

.flatpickr-day.selected {
    background: var(--tool-primary);
    border-color: var(--tool-primary);
}

/* Utility Classes */
.text-primary {
    color: var(--tool-primary) !important;
}

.text-info {
    color: var(--tool-info) !important;
}

.text-warning {
    color: var(--tool-warning) !important;
}

.text-success {
    color: var(--tool-success) !important;
}

/* Force white text in blue headers */
.card-header h4,
.card-header h5,
.card-header h6 {
    color: white !important;
}

.card-header .text-primary,
.card-header .text-info,
.card-header .text-warning,
.card-header .text-success {
    color: white !important;
}

/* Fix icon sizing in calculator form headers */
.calculator-form .card-header i,
.calculator-section .card-header i,
.results-section .card-header i {
    font-size: 1.25rem !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    color: white !important;
    display: inline-block !important;
}

/* Ensure proper icon spacing in headers */
.calculator-form .card-header i.me-2,
.calculator-section .card-header i.me-2,
.results-section .card-header i.me-2 {
    margin-right: 0.5rem !important;
}

/* Fix icon sizing in tool headers */
.tool-header-icon {
    font-size: 1.5rem !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
}

/* Ensure proper spacing for icons in headers */
.tool-header-icon.me-2 {
    margin-right: 0.5rem !important;
}

/* Adjust breadcrumb icon sizes */
.breadcrumb-item i {
    font-size: 1rem !important;
}

/* Ensure category icons are properly sized */
.col-md-4 .tool-header-icon {
    font-size: 1.25rem !important;
}

/* Link Styling */
.result-card a,
.card-body a {
    color: var(--tool-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.result-card a:hover,
.card-body a:hover {
    color: var(--tool-primary-dark);
    border-bottom-color: var(--tool-primary-dark);
    transform: translateY(-1px);
}

.result-card a:focus,
.card-body a:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

.bg-primary {
    background-color: var(--tool-primary) !important;
}

.bg-light {
    background-color: var(--tool-bg-light) !important;
}

.border-primary {
    border-color: var(--tool-primary) !important;
}

/* Enhanced Card Shadows */
.shadow-lg {
    box-shadow: 0 10px 30px var(--tool-shadow) !important;
}

/* Progress Bars */
.progress {
    height: 35px;
    border-radius: 18px;
    background-color: var(--tool-bg-light);
    border: 2px solid var(--tool-border);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 18px;
    background: var(--tool-primary);
    transition: width 0.8s ease;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-info {
    background: var(--tool-info);
    color: white;
}

.alert-danger {
    background: var(--tool-danger);
    color: white;
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

/* Smooth Transitions */
* {
    transition: all 0.3s ease;
}

/* Custom Statistical Cards - No Bootstrap */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    z-index: 1;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.stat-content {
    position: relative;
    z-index: 2;
}

.stat-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-card p {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Individual Card Color Schemes */
.hours-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.hours-card:hover {
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.wage-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
}

.wage-card:hover {
    box-shadow: 0 15px 35px rgba(240, 147, 251, 0.4);
}

.lunch-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

.lunch-card:hover {
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4);
}

.efficiency-card {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 8px 25px rgba(67, 233, 123, 0.3);
}

.efficiency-card:hover {
    box-shadow: 0 15px 35px rgba(67, 233, 123, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card h2 {
        font-size: 2rem;
    }
}

/* Most specific rules for text elements */
.card.bg-primary h2,
.card.bg-primary p,
.card.bg-primary span,
.card.bg-primary div {
    color: white !important;
}

.card.bg-success h2,
.card.bg-success p,
.card.bg-success span,
.card.bg-success div {
    color: white !important;
}

.card.bg-info h2,
.card.bg-info p,
.card.bg-info span,
.card.bg-info div {
    color: white !important;
}

.card.bg-warning h2,
.card.bg-warning p,
.card.bg-warning span,
.card.bg-warning div {
    color: #212529 !important;
}

/* Override any existing text colors */
.text-white {
    color: white !important;
}

.text-dark {
    color: #212529 !important;
}

/* Force colors on specific card types */
.col-md-3 .card.bg-primary,
.col-md-3 .card.bg-success,
.col-md-3 .card.bg-info {
    color: white !important;
}

.col-md-3 .card.bg-warning {
    color: #212529 !important;
}

/* Card styling for better readability */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeline Chart Styling */
.timeline-container {
    padding: 1rem;
    background: var(--tool-bg-white);
    border-radius: 12px;
    border: 1px solid var(--tool-border);
}

.timeline-day {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--tool-bg-light);
    border-radius: 8px;
    border: 1px solid var(--tool-border);
}

.timeline-day-label {
    font-weight: 600;
    color: var(--tool-primary);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.timeline-bar-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

.timeline-bar {
    position: relative;
    height: 40px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.timeline-work {
    background: linear-gradient(135deg, var(--tool-success) 0%, #28a745 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    line-height: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-lunch {
    background: linear-gradient(135deg, var(--tool-warning) 0%, #ffc107 100%);
    color: #212529;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    line-height: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-time-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--tool-text-muted);
}

.timeline-time-labels span {
    flex: 1;
    text-align: center;
}

/* Chart Loading Animation */
.chart-loading {
    position: relative;
}

.chart-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-loading::after {
    content: 'Loading charts...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    color: var(--tool-primary);
    font-weight: 600;
}

/* Result Card Styling for Examples */
.result-card {
    background: var(--tool-bg-white);
    border: 1px solid var(--tool-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px var(--tool-shadow);
}

.result-card h6 {
    color: var(--tool-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.result-card .text-primary {
    color: var(--tool-primary) !important;
}

.result-card .fw-bold {
    font-weight: 600 !important;
}

.result-card .d-flex.justify-content-between {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tool-border);
}

.result-card .d-flex.justify-content-between:last-child {
    border-bottom: none;
}

.result-card .d-flex.justify-content-between span:first-child {
    color: var(--tool-text-muted);
}

.result-card .d-flex.justify-content-between span:last-child {
    font-weight: 600;
    color: var(--tool-primary);
}

/* Lean Body Mass Calculator Specific Styling - Updated to match bust size calculator */
.lean-body-mass-calculator .container {
    max-width: 100% !important;
}

.lean-body-mass-calculator .col-lg-10 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* Matrix Calculator Enhanced Styles */
.matrix-input-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.matrix-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.matrix-input-container:hover::before {
    left: 100%;
}

.matrix-input-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.matrix-grid {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.matrix-grid table {
    border-collapse: separate;
    border-spacing: 10px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.matrix-grid table:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.matrix-grid input {
    width: 90px;
    height: 60px;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.matrix-grid input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0,123,255,0.3);
    background: white;
    transform: scale(1.1);
    color: #007bff;
}

.matrix-grid input:hover {
    border-color: #adb5bd;
    background: white;
    transform: scale(1.05);
}

.matrix-grid input:valid {
    border-color: #3b82f6;
    background: #ffffff;
}

.matrix-grid input:invalid {
    border-color: #dc3545;
    background: #ffffff;
}

/* Enhanced Button Styles */
.btn-matrix {
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-matrix::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-matrix:hover::before {
    left: 100%;
}

.btn-matrix:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
}

.btn-matrix:active {
    transform: translateY(-1px);
}

/* Matrix Result Display */
.matrix-result {
    background: linear-gradient(135deg, #e8f5e8 0%, #f8fff8 100%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid #d4edda;
    box-shadow: 0 8px 25px rgba(40,167,69,0.15);
    margin-top: 30px;
    transition: all 0.3s ease;
}

.matrix-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(40,167,69,0.2);
}

.matrix-result h4 {
    color: #155724;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.matrix-result table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.matrix-result th {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-weight: 600;
    padding: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-result td {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.matrix-result tr:hover td {
    background: #f8f9fa;
    transform: scale(1.02);
}

/* Matrix Input Validation */
.matrix-input-error {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #ffeaea 0%, #ffffff 100%) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Matrix Size Controls */
.matrix-size-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.matrix-size-btn {
    padding: 10px 20px;
    border: 2px solid #007bff;
    border-radius: 25px;
    background: white;
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-size-btn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.3);
}

.matrix-size-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 5px 15px rgba(0,123,255,0.4);
}

/* Matrix Operations Panel */
.matrix-operations {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #dee2e6;
}

.matrix-operations h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-operations .btn {
    margin: 5px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.matrix-operations .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Matrix History */
.matrix-history {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #dee2e6;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Enhanced Function Inputs Styling */
.function-inputs {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(30, 136, 229, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.function-inputs::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 136, 229, 0.1), transparent);
    transition: left 0.5s;
}

.function-inputs:hover::before {
    left: 100%;
}

.function-inputs:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(30, 136, 229, 0.15);
    border-color: #1e88e5;
}

.function-inputs h6 {
    color: #1e88e5;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.function-inputs h6 i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Enhanced Input Field Styling */
.function-inputs .form-control {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.function-inputs .form-control:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1);
    transform: translateY(-2px);
    background: #ffffff;
}

.function-inputs .form-control:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.function-inputs .form-control:valid {
    border-color: #3b82f6;
    background: #ffffff;
}

.function-inputs .form-control:invalid {
    border-color: #ef4444;
    background: #ffffff;
}

/* Enhanced Label Styling */
.function-inputs .form-label {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    position: relative;
}

.function-inputs .form-label::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #1e88e5;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
}

/* Input Group Enhancements */
.function-inputs .row {
    margin-bottom: 1.5rem;
}

.function-inputs .row:last-child {
    margin-bottom: 0;
}

.function-inputs .col-md-3,
.function-inputs .col-md-4,
.function-inputs .col-md-6 {
    margin-bottom: 1rem;
}

/* Input Field Icons */
.function-inputs .input-group {
    position: relative;
}

.function-inputs .input-group-text {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    border: 2px solid #1e88e5;
    border-radius: 12px 0 0 12px;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.function-inputs .input-group .form-control {
    border-radius: 0 12px 12px 0;
    border-left: none;
}

.function-inputs .input-group .form-control:focus {
    border-left: 2px solid #1e88e5;
}

/* Enhanced Placeholder Styling */
.function-inputs .form-control::placeholder {
    color: #94a3b8;
    font-style: italic;
    font-weight: 500;
}

/* Input Validation States */
.function-inputs .form-control.is-valid {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #ffffff 100%);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.function-inputs .form-control.is-invalid {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Input Animation Effects */
@keyframes inputFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.function-inputs .form-control:focus {
    animation: inputFocus 0.3s ease;
}

/* Responsive Design for Function Inputs */
@media (max-width: 768px) {
    .function-inputs {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .function-inputs .form-control {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .function-inputs .form-label {
        font-size: 0.9rem;
    }
    
    .function-inputs h6 {
        font-size: 1rem;
    }
}

/* Related Tools Section Width Control */
.related-tools-section {
    max-width: 83%;
    margin: 0 auto;
}

/* Systems of Equations Calculator Specific Styles */
.equation-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
}

.preview-equation {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.preview-equation:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #1e88e5;
}

.preview-equation:last-child {
    margin-bottom: 0;
}

.equation-number {
    background: #1e88e5;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
    min-width: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(30, 136, 229, 0.3);
}

.equation-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.coefficient-input {
    width: 80px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1e293b;
}

.coefficient-input:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    transform: scale(1.05);
}

.coefficient-input:hover {
    border-color: #cbd5e1;
    transform: scale(1.02);
}

.coefficient-input:valid {
    border-color: #3b82f6;
    background: #ffffff;
}

.coefficient-input:invalid {
    border-color: #ef4444;
    background: #ffffff;
}

.variable {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e88e5;
    margin: 0 0.25rem;
    min-width: 1rem;
    text-align: center;
}

.operator {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0.25rem;
    min-width: 1rem;
    text-align: center;
}

.quick-examples {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.example-buttons .btn {
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-width: 2px;
}

.example-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.example-buttons .btn-outline-primary:hover {
    background: #1e88e5;
    border-color: #1e88e5;
    color: white;
}

.example-buttons .btn-outline-success:hover {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.example-buttons .btn-outline-secondary:hover {
    background: #64748b;
    border-color: #64748b;
    color: white;
}

/* Enhanced Matrix Input Section */
.matrix-input-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.matrix-input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.matrix-input-section:hover::before {
    left: 100%;
}

.matrix-input-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    border-color: #1e88e5;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.matrix-title {
    color: #1e293b;
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.matrix-title i {
    color: #1e88e5;
    font-size: 1.2rem;
}

.matrix-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.matrix-size-badge {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.matrix-status {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    font-style: italic;
}

/* Enhanced Control Panel */
.control-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.control-panel:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Enhanced Form Groups */
.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label-modern i {
    color: #1e88e5;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.form-select-modern {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    color: #1e293b;
}

.form-select-modern:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    transform: translateY(-1px);
}

.form-select-modern:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Enhanced Calculate Section */
.calculate-section {
    text-align: center;
    margin: 2.5rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-calculate {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    color: white !important;
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 25px;
    border: none !important;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.3) !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-calculate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-calculate:hover::before {
    left: 100%;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.4) !important;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
}

.btn-calculate:active {
    transform: translateY(-1px);
}

.btn-calculate i {
    font-size: 1.2rem;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.matrix-tips {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

.matrix-tips i {
    color: #1e88e5;
    margin-right: 0.25rem;
}

/* Force blue color for calculate button - Override any green styles */
.calculate-section .btn-calculate,
.calculate-section .btn.btn-calculate,
button.btn-calculate,
.btn-calculate.btn {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    background-color: #1e88e5 !important;
    color: white !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.3) !important;
}

.calculate-section .btn-calculate:hover,
.calculate-section .btn.btn-calculate:hover,
button.btn-calculate:hover,
.btn-calculate.btn:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    background-color: #1565c0 !important;
    border-color: #1565c0 !important;
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.4) !important;
}

.calculate-section .btn-calculate:focus,
.calculate-section .btn.btn-calculate:focus,
button.btn-calculate:focus,
.btn-calculate.btn:focus {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    background-color: #1e88e5 !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.3) !important;
}

/* Enhanced Calculate Button Styling for Summation Calculator */
.btn-calculate-modern {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    color: white !important;
    border: none !important;
    padding: 1.25rem 3rem !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 25px !important;
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    min-width: 250px !important;
    cursor: pointer !important;
}

.btn-calculate-modern::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
    transition: left 0.6s ease !important;
    z-index: 1 !important;
}

.btn-calculate-modern:hover::before {
    left: 100% !important;
}

.btn-calculate-modern:hover {
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(30, 136, 229, 0.4) !important;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
}

.btn-calculate-modern:active {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.5) !important;
}

.btn-calculate-modern:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.3) !important;
}

.btn-calculate-modern i {
    font-size: 1.3rem !important;
    z-index: 2 !important;
    position: relative !important;
}

.btn-calculate-modern .btn-text {
    z-index: 2 !important;
    position: relative !important;
    font-weight: 700 !important;
}

.btn-calculate-modern .btn-loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 3 !important;
}

.btn-calculate-modern .spinner {
    width: 24px !important;
    height: 24px !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 3px solid white !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Form Input Styling for Summation Calculator */
.summation-form .form-control,
.summation-form .form-select {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
    overflow: hidden !important;
}

.summation-form .form-control:focus,
.summation-form .form-select:focus {
    outline: none !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
    background: #ffffff !important;
}

.summation-form .form-control:hover,
.summation-form .form-select:hover {
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.summation-form .form-control:valid,
.summation-form .form-select:valid {
    border-color: #3b82f6 !important;
    background: #ffffff !important;
}

.summation-form .form-control:invalid,
.summation-form .form-select:invalid {
    border-color: #ef4444 !important;
    background: #ffffff !important;
}

/* Enhanced Label Styling */
.summation-form .form-label {
    color: #1e293b !important;
    font-weight: 700 !important;
    margin-bottom: 0.75rem !important;
    font-size: 1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
}

.summation-form .form-label::before {
    content: '' !important;
    position: absolute !important;
    left: -1.5rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: #1e88e5 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2) !important;
}

/* Enhanced Input Group Styling */
.summation-form .input-group-text {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    color: white !important;
    border: 2px solid #1e88e5 !important;
    border-radius: 12px 0 0 12px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    padding: 1rem 1.25rem !important;
    min-width: 60px !important;
    text-align: center !important;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3) !important;
}

.summation-form .input-group .form-control {
    border-radius: 0 12px 12px 0 !important;
    border-left: none !important;
}

.summation-form .input-group .form-control:focus {
    border-left: 2px solid #1e88e5 !important;
}

/* Enhanced Error Alert Styling */
.alert-error-modern {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3) !important;
    border-left: 4px solid #dc2626 !important;
    animation: slideInDown 0.5s ease !important;
}

.alert-error-modern i {
    font-size: 1.2rem !important;
    margin-right: 0.75rem !important;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Success Alert Styling */
.alert-success-modern {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3) !important;
    border-left: 4px solid #059669 !important;
    animation: slideInUp 0.5s ease !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Info Alert Styling */
.alert-info-modern {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3) !important;
    border-left: 4px solid #2563eb !important;
}

/* Button Loading State */
.btn-calculate-modern.loading {
    pointer-events: none !important;
    opacity: 0.8 !important;
}

.btn-calculate-modern.loading .btn-text {
    opacity: 0 !important;
}

.btn-calculate-modern.loading .btn-loading {
    display: block !important;
}

/* Focused state for form inputs */
.summation-form .form-control.focused,
.summation-form .form-select.focused {
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1) !important;
    transform: translateY(-2px) !important;
    background: #ffffff !important;
}

/* Enhanced form group styling */
.summation-form .mb-3 {
    position: relative;
    margin-bottom: 1.5rem !important;
}

.summation-form .mb-3::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1e88e5, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summation-form .mb-3:hover::after {
    opacity: 0.3;
}

/* Enhanced card styling for calculator form */
.calculator-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.1) !important;
}

.calculator-form:hover {
    box-shadow: 0 15px 40px rgba(30, 136, 229, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Enhanced card header */
.calculator-form .card-header {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

.calculator-form .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.calculator-form .card-header h5 i {
    color: white !important;
    font-size: 1.25rem !important;
    margin-right: 0.5rem !important;
}

/* Content section header styling for Calculate and About sections */
.results-section .card-header h4,
.results-section .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
}

.results-section .card-header {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

/* Enhanced card body */
.calculator-form .card-body {
    padding: 2.5rem !important;
    background: transparent !important;
}

/* Enhanced results section */
.results-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(30, 136, 229, 0.1) !important;
}

.results-section .card-header {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

.results-section .card-header h5 {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
}

.results-section .card-body {
    padding: 2rem !important;
}

/* Enhanced chart cards */
.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.chart-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(30, 136, 229, 0.2) !important;
}

.chart-card .card-header {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
}

.chart-card .card-header h6 {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Related Tools Styling */
.related-tool-link {
    background: #f8f9fa !important;
    border-left: 3px solid #1e88e5 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: block !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    margin-bottom: 0.75rem !important;
}

.related-tool-link:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%) !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.15) !important;
    text-decoration: none !important;
}

.related-tool-link strong {
    color: #1e88e5 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

.related-tool-link small {
    color: #64748b !important;
    font-size: 0.875rem !important;
}

/* Responsive Design for Enhanced Elements */
@media (max-width: 768px) {
    .btn-calculate-modern {
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        min-width: 200px !important;
    }
    
    .summation-form .form-control,
    .summation-form .form-select {
        padding: 0.875rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .summation-form .form-label {
        font-size: 0.9rem !important;
    }
    
    .calculator-form .card-body {
        padding: 1.5rem !important;
    }
    
    .results-section .card-body {
        padding: 1.5rem !important;
    }
    
    .related-tool-link {
        padding: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .related-tool-link strong {
        font-size: 0.95rem !important;
    }
    
    .related-tool-link small {
        font-size: 0.8rem !important;
    }
}

.matrix-history h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-history-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.matrix-history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* Inverse Matrix Calculator Specific Styles */
.calculator-form-modern {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(30, 136, 229, 0.1);
    border: 1px solid #e3f2fd;
    margin-bottom: 2rem;
}

.control-panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.form-group-modern {
    margin-bottom: 1rem;
}

.form-label-modern {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-select-modern:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-modern {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

.btn-secondary-modern {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    color: white;
}

.btn-secondary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
}

.matrix-input-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.matrix-title {
    color: #1e293b;
    font-weight: 600;
    margin: 0;
}

.matrix-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.matrix-size-badge {
    background: #1e88e5;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.matrix-status {
    color: #64748b;
    font-size: 0.8rem;
}

.matrix-container {
    position: relative;
}

.interactive-matrix {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.interactive-matrix input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #ffffff;
}

.interactive-matrix input:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
    transform: scale(1.05);
}

.interactive-matrix input:hover {
    border-color: #cbd5e1;
}

.matrix-controls {
    margin-top: 1rem;
    text-align: center;
}

.matrix-tips {
    color: #64748b;
    font-size: 0.8rem;
}

.calculate-section {
    text-align: center;
    margin: 2rem 0;
}

.btn-calculate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-loading {
    display: inline-block;
    margin-left: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.matrix-preview {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.preview-header h6 {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 1rem;
}

.preview-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.preview-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.preview-label {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.preview-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 1.1rem;
}