body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    background-color: #f1f8ff;
    border-bottom: 1px solid #e3f2fd;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #343a40 !important;
}

.stat-card {
    text-align: center;
    padding: 15px;
    border-left: 4px solid #007bff;
}

.stat-card h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-card p {
    margin-bottom: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.calorie-in {
    border-left-color: #28a745;
}

.calorie-out {
    border-left-color: #dc3545;
}

.deficit {
    border-left-color: #17a2b8;
}

.positive-value {
    color: #28a745;
}

.negative-value {
    color: #dc3545;
}

.recent-entries {
    max-height: 475px;
}

.summary-header {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.macro-pill {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 5px;
    font-weight: 600;
}

.protein-pill {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.carbs-pill {
    background-color: #fff3cd;
    color: #856404;
    /* Darker yellow/brown color for better contrast */
}

.fat-pill {
    background-color: #f8d7da;
    color: #dc3545;
}

/* Style for pagination controls */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Transition for smoother pagination */
.list-group-item {
    transition: opacity 0.2s ease-in-out;
}

/* Increase height for the food entries container */
#foodEntriesList {
    min-height: 400px;
    /* Adjust this value as needed */
}

/* Ensure list items have consistent height */
.food-entry {
    padding: 15px;
    margin-bottom: 5px;
}

/* Ensure container grows with content on pagination */
.tab-pane {
    overflow: visible;
    height: auto;
}

/* Remove any max-height constraints that might be causing scrollbars */
.list-group {
    max-height: none !important;
    overflow: visible;
}

/* Improve carb progress orange text contrast for better accessibility */
.carb-progress .text-warning {
    color: #cc6600 !important;
    /* Dark orange with 4.5:1 contrast ratio on white */
}

/* Global text-warning improvement for better accessibility */
.text-warning {
    color: #b8860b !important;
    /* Dark goldenrod - darker than default warning color */
}

/* Accessibility: Improve contrast for warning text in hydration cards */
.text-warning {
    color: #B45309 !important;
    /* Darker orange-yellow for better contrast (4.5:1 ratio) */
}

/* Ensure warning text maintains readability in all contexts */
.card-body .text-warning,
.position-absolute .text-warning {
    color: #B45309 !important;
}

/* Stomach issues button styling - override Bootstrap warning button text color for accessibility */
.btn-warning {
    color: #212529 !important;
    /* Black text for better contrast on yellow background */
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active {
    color: #212529 !important;
    /* Maintain black text on all states */
}

/* Ensure outline warning buttons also have proper contrast when active */
.btn-outline-warning.active,
.btn-outline-warning:active {
    color: #212529 !important;
    /* Black text when outline button is active */
}

/* Recipe Card Styling */
.recipe-card {
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.recipe-card.hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

.recipe-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    max-width: 80%;
}

.recipe-card .macro-details {
    font-size: 0.75rem;
}

/* Add Food page styles */
.nutrition-badge {
    display: inline-block;
    text-align: center;
    min-width: 70px;
}

.form-control-plaintext.fw-bold {
    padding-left: 0;
    font-size: 1.1rem;
}

#recipeGrid .card {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

#recipeGrid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

#recipeGrid .card-footer {
    background-color: transparent;
    padding-top: 0;
}

/* Tab styling enhancements */
.nav-tabs .nav-link {
    color: #495057;
    border: 1px solid transparent;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
    padding: 0.75rem 1rem;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
}

.deficit-container {
    height: 24px;
    border-radius: 12px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.deficit-bar {
    height: 100%;
    border-radius: 12px;
    width: 0;
    transition: width 0.5s ease-out;
}

.deficit-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* For surplus case, display bar from right to left */
.deficit-surplus .deficit-bar {
    float: right;
    border-radius: 0 12px 12px 0;
}

/* Goal marker */
.goal-marker {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: #000;
    z-index: 2;
}

.protein-chart-container {
    position: relative;
    margin: 0 auto;
}

/* Hydration chart container to prevent clipping */
.hydration-chart-container {
    position: relative !important;
    margin: 0 auto;
    overflow: visible !important;
    width: 140px;
    height: 140px;
    display: inline-block;
    z-index: 1;
    padding: 10px;
}

.hydration-chart-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
}

/* Ensure hydration card doesn't clip the chart */
.card-body:has(.hydration-chart-container) {
    overflow: visible !important;
    position: relative;
}

/* Better support for hydration chart containers */
.card-body {
    overflow: visible !important;
    position: relative;
}

.card:has(.hydration-chart-container) {
    overflow: visible !important;
    position: relative;
}

/* Specific styling for hydration cards */
.card .card-body:has(canvas) {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.calendar-table {
    table-layout: fixed;
}

.calendar-day {
    height: 65px;
    /* Increased height to accommodate duration indicator */
    vertical-align: top;
    /* Align to top to fit both day number and duration */
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
    padding: 8px 4px;
    border: 2px solid transparent;
    min-width: 60px;
}

.calendar-day:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.today {
    border: 3px solid #0d6efd !important;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.6);
    border-radius: 6px;
}

.calendar-day small {
    font-size: 0.7rem;
    opacity: 0.95;
    font-weight: 500;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}

/* Day type button improvements */
.day-type-buttons {
    max-width: 100%;
}

/* Desktop - make day type buttons smaller and more compact */
@media (min-width: 992px) {
    .day-type-buttons {
        max-width: 300px;
    }

    .day-type-buttons .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.75rem;
        white-space: nowrap;
    }

    .day-type-buttons .btn i {
        font-size: 0.85rem;
    }
}

/* Mobile improvements for header buttons */
@media (max-width: 991.98px) {
    .day-type-buttons .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .card-header .btn-group {
        width: 100%;
    }

    .card-header .btn-group .btn {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure action buttons are evenly spaced on mobile */
    .card-header .d-flex.gap-2 .btn {
        min-width: 0;
        flex: 1;
    }
}

/* Day type visual indicators */
.rest-day {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
    border-left: 4px solid #0dcaf0;
}

.sick-day {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
    border-left: 4px solid #ffc107;
}

/* Ensure buttons don't break on small screens */
.btn-group .btn {
    white-space: nowrap;
}

/* Improved spacing for mobile */
@media (max-width: 767.98px) {
    .card-header {
        padding: 1rem 0.75rem;
    }

    .card-header h5 {
        font-size: 1.1rem;
    }
}

/* Enhanced Exercise Consistency Calendar Styles */

/* Calendar day type styling with improved contrast and accessibility */
.calendar-day {
    height: 65px;
    vertical-align: top;
    position: relative;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    padding: 8px 4px;
    border: 2px solid transparent;
    min-width: 60px;
}

.calendar-day:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

/* Today indicator with enhanced visibility */
.today {
    border: 3px solid #0d6efd !important;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.6);
    border-radius: 6px;
}

/* Rest day styling - blue theme */
.calendar-day.rest-day {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0a58ca;
}

.calendar-day.rest-day:hover {
    background-color: #0a58ca !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* Sick day styling - red theme with thermometer icon support */
.calendar-day.sick-day {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #bb2d3b;
}

.calendar-day.sick-day:hover {
    background-color: #bb2d3b !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.calendar-day.sick-day .bi-thermometer-half {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-right: 2px;
}

/* Stomach issues day styling - orange border with exclamation triangle icon support */
.calendar-day.stomach-issues-day {
    border: 3px solid #fd7e14 !important;
    /* Orange border for stomach issues */
    border-radius: 6px;
}

.calendar-day.stomach-issues-day:hover {
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.4);
    border-color: #dc6502 !important;
    /* Darker orange border on hover */
}

.calendar-day.stomach-issues-day .bi-exclamation-triangle-fill {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-right: 2px;
}

/* Skipped day styling - orange theme */
.calendar-day.skipped-day {
    background-color: #fd7e14 !important;
    color: white !important;
    border-color: #dc6502;
}

.calendar-day.skipped-day:hover {
    background-color: #dc6502 !important;
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.4);
}

/* Exercise day styling - green gradient theme */
.calendar-day.exercise-day {
    border-color: rgba(0, 100, 0, 0.3);
}

.calendar-day.exercise-day:hover {
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

/* Duration indicator styling */
.calendar-day small {
    font-size: 0.7rem;
    opacity: 0.95;
    font-weight: 500;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}

/* Calendar table styling */
.calendar-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 2px;
}

.calendar-table th {
    text-align: center;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
    border: none;
    padding: 8px 4px;
}

/* Calendar legend styling */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.legend-rest {
    background-color: #0d6efd;
    color: white;
}

.legend-sick {
    background-color: #dc3545;
    color: white;
}

.legend-stomach-issues {
    background-color: #ffc107;
    color: black;
}

.legend-skipped {
    background-color: #fd7e14;
    color: white;
}

.legend-exercise-low {
    background: linear-gradient(to right, #90ee90, #32cd32);
    color: black;
}

.legend-exercise-high {
    background-color: #006400;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-day {
        height: 55px;
        min-width: 50px;
        padding: 6px 2px;
    }

    .calendar-day small {
        font-size: 0.65rem;
    }

    .calendar-legend {
        gap: 10px;
        padding: 10px;
    }

    .legend-item {
        font-size: 0.8rem;
        gap: 6px;
    }

    .legend-color {
        width: 16px;
        height: 16px;
        font-size: 0.7rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .calendar-day {
        transition: none;
    }

    .calendar-day:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calendar-day {
        border-width: 3px;
    }

    .today {
        border-width: 4px;
    }
}

.text-info {
    color: #0960a5 !important;
    /* Darker blue for better contrast */
}

.card-header.bg-warning {
    background-color: #e0a800 !important;
    /* Darker yellow for carb headers */
    color: #212529;
}

.protein-header {
    background-color: #800020 !important;
    /* Dark red/maroon for protein header */
    color: white;
}

/* Metric cards for exercise detail page */
.metric-card {
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e9ecef !important;
}

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

.metric-card h6 {
    font-weight: 600;
    margin-bottom: 12px;
}

.metric-card h6 i {
    margin-right: 5px;
}

.metric-card .d-flex {
    margin-bottom: 4px;
}

.metric-card .d-flex:last-child {
    margin-bottom: 0;
}

/* Enhanced Exercise Detail Metric Cards */
.metric-card {
    transition: all 0.3s ease;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Exercise Detail Lap Table Enhancements */
.lap-row:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
    transform: scale(1.01);
}

.table-dark th {
    background-color: #495057 !important;
    border-color: #6c757d !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Metric card responsive adjustments */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }

    .metric-card .fs-4 {
        font-size: 1.1rem !important;
    }

    .metric-card .fs-5 {
        font-size: 1rem !important;
    }

    .metric-card .fs-6 {
        font-size: 0.9rem !important;
    }
}

/* Color-coded badges for lap numbers */
.badge.bg-primary {
    background: linear-gradient(45deg, #0d6efd, #0056b3) !important;
}

/* Enhanced font styling for lap table */
.font-monospace {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
}

/* Improved spacing for table cells */
.table td,
.table th {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* Enhanced text colors for better readability */
.text-success {
    color: #198754 !important;
    font-weight: 600;
}

.text-info {
    color: #0dcaf0 !important;
    font-weight: 600;
}

.text-warning {
    color: #fd7e14 !important;
    font-weight: 600;
}

/* CRITICAL: Override text-warning color for ALL buttons - MUST come after .text-warning rule */
.btn-warning,
.btn-warning *,
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.btn-outline-warning.active,
.btn-outline-warning:active,
.day-type-btn.btn-warning,
.day-type-btn.btn-warning *,
.day-type-btn.btn-warning:hover,
.day-type-btn.btn-warning:focus,
.day-type-btn.btn-warning:active,
.day-type-btn.btn-outline-warning.active,
.day-type-btn.btn-outline-warning:active {
    color: #212529 !important;
    /* ACCESSIBILITY: Black text for contrast on yellow background */
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Basic Info Section Styling */
.basic-info-section {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef) !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    display: block;
    line-height: 1.2;
}

/* Responsive adjustments for basic info */
@media (max-width: 768px) {
    .basic-info-section {
        margin-bottom: 2rem !important;
    }

    .info-value {
        font-size: 1.1rem !important;
    }
}

/* Fix spacing and layout for day type buttons and exclude checkbox */
.day-type-buttons {
    margin-bottom: 1.5rem !important;
    /* Force more space between buttons and checkbox */
}

/* CRITICAL: Force spacing in view_day.html button/checkbox layout */
.card-header .d-flex.flex-column.flex-lg-row.gap-2>div:first-child {
    margin-bottom: 1.5rem !important;
    /* Force space after button group */
}

.card-header .btn-group.day-type-buttons {
    margin-bottom: 1.5rem !important;
    /* Force space after button group */
}

/* Reset margin on larger screens where they're side by side */
@media (min-width: 992px) {
    .card-header .d-flex.flex-column.flex-lg-row.gap-2>div:first-child {
        margin-bottom: 0 !important;
    }

    .card-header .btn-group.day-type-buttons {
        margin-bottom: 0 !important;
    }
}

/* CRITICAL: Even more aggressive mobile spacing */
@media (max-width: 991.98px) {
    .card-header .d-flex.flex-column.gap-3>div {
        margin-bottom: 1rem !important;
    }

    .day-type-buttons {
        margin-bottom: 2rem !important;
        /* Even more space on mobile */
    }

    .btn-group.day-type-buttons {
        margin-bottom: 2rem !important;
        /* Force large gap on mobile */
    }

    /* Force spacing on the checkbox container too */
    .card-header .d-flex.align-items-center.justify-content-center {
        margin-top: 1rem !important;
    }
}

/* NUCLEAR OPTION: Direct targeting of view_day.html structure */
.card-header .d-flex.flex-column.flex-lg-row.gap-2 {
    gap: 2rem !important;
    /* Force larger gap between button group and checkbox */
}

/* Force stomach issues button text to be black - NUCLEAR OPTION */
button[data-day-type="stomach_issues"],
button[data-day-type="stomach_issues"]:hover,
button[data-day-type="stomach_issues"]:focus,
button[data-day-type="stomach_issues"]:active,
button[data-day-type="stomach_issues"].active {
    color: #000000 !important;
    /* Force black text */
}

button[data-day-type="stomach_issues"] span,
button[data-day-type="stomach_issues"] i {
    color: #000000 !important;
    /* Force black text on all children */
}

/* Exercise Comparison Styling */
.exercise-checkbox {
    transform: scale(1.2);
}

#comparison-table .table-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
}

.nav-tabs .nav-link {
    color: #495057;
    border: 1px solid transparent;
    border-bottom-color: #dee2e6;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: #0056b3;
}

.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Comparison card animations */
#comparison-results-card {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Checkbox selection styling */
.exercise-checkbox:checked+label,
tr:has(.exercise-checkbox:checked) {
    background-color: rgba(13, 110, 253, 0.1);
}

.glycogen-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-unit {
    font-size: 1rem;
    color: #6c757d;
    font-weight: normal;
}

.metric-value-small {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.1rem;
}

.metric-label-small {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.progress-custom {
    height: 25px;
    border-radius: 12px;
    background-color: #e9ecef;
}

.progress-bar-custom {
    border-radius: 12px;
    font-weight: bold;
    line-height: 25px;
}

.status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.excess-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.deficit-warning {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.optimal-status {
    background-color: #d1edff;
    border: 1px solid #b3d4fc;
    color: #004085;
}

/* Carb Calculator Styles */
.carb-calculator-page {
    margin: -20px;
    padding: 0;
}

.carb-calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.carb-calculator-header {
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.carb-calculator-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.carb-calculator-header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.carb-main-content {
    padding: 40px;
}

.carb-input-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.carb-input-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.carb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.carb-form-group {
    display: flex;
    flex-direction: column;
}

.carb-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.carb-form-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.carb-form-group input:focus {
    outline: none;
    border-color: #2196F3;
}

.carb-zone-inputs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.carb-zone-input {
    text-align: center;
}

.carb-zone-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.carb-zone-input input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.carb-advanced-options {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.carb-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.carb-checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.carb-rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.carb-rates-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.carb-rates-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.carb-rate-inputs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.carb-rate-input {
    text-align: center;
}

.carb-rate-input label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.carb-rate-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

.carb-calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
    margin: 0 auto;
}

.carb-calculate-btn:hover {
    transform: translateY(-2px);
}

.carb-results-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-top: 30px;
    display: none;
}

.carb-results-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.carb-results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.carb-summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #2196F3;
}

.carb-summary-card h3 {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.carb-summary-card .value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.carb-summary-card .unit {
    font-size: 0.9em;
    color: #666;
}

.carb-zone-details {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.carb-zone-details h3 {
    margin-bottom: 15px;
    color: #333;
}

.carb-zone-breakdown {
    margin-bottom: 20px;
}

.carb-zone-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #2196F3;
}

.carb-zone-item h4 {
    color: #333;
    margin-bottom: 8px;
}

.carb-zone-calculations {
    font-size: 0.9em;
    color: #666;
}

.carb-zone-calculations li {
    margin-bottom: 5px;
}

.carb-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.carb-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin-bottom: 20px;
}

.carb-extended-card {
    background: #fff3cd !important;
    border-left-color: #ffc107 !important;
}

.carb-example-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
}

/* Responsive styles for carb calculator */
@media (max-width: 768px) {
    .carb-zone-inputs {
        grid-template-columns: 1fr;
    }

    .carb-rates-grid {
        grid-template-columns: 1fr;
    }

    .carb-rate-inputs {
        grid-template-columns: repeat(3, 1fr);
    }
}
