body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fb;
    color: #495057;
}

.main-container {
    padding: 30px;
    max-width: 1200px;
    margin: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, h4 {
    color: #333333;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #666666;
    margin-top: 30px;
    margin-bottom: 15px;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #4a4a4a;
    border-collapse: collapse;
}

.table-bordered {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    color: #666666;
    font-weight: 600;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody td {
    padding: 14px;
    border-top: 1px solid #e0e0e0;
}

.status-operational {
    color: #28a745;
    font-weight: 500;
}

.status-degraded {
    color: #ffc107;
    font-weight: bold;
}

.status-down {
    color: #dc3545;
    font-weight: 500;
}

.btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background-color: #3b7ddd;
    border-color: #3b7ddd;
    color: #ffffff;
    border: none;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #326abc;
    border-color: #2f64b1;
}

.btn-secondary {
    background-color: #9e9e9e;
    color: #ffffff;
    border: none;
}

.btn-secondary:hover {
    background-color: #757575;
}

#clientDetails {
    padding: 20px;
    background-color: #f0f4f8;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#clientDetails h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
}

#clientDetails h4 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #666666;
    margin-top: 15px;
}

#clientDetails p,
#clientDetails ul {
    margin: 10px 0;
}

#clientDetails ul li {
    margin: 5px 0;
}

table tbody tr:hover {
    background-color: #f1f8ff;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    animation: spin 2s linear infinite;
}

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

.loading-text {
    font-size: 1.2rem;
    margin-top: 10px;
    color: #070c10;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
}

table {
    font-size: 0.9rem;
}

.tabs {
    margin-bottom: 1rem;
}

.tab-content {
    margin-top: 1rem;
    padding: 1.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
}

.tab-pane {
    padding: 1rem;
}

.loading-placeholder {
    color: #888;
    font-style: italic;
}

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.badge-success {
    color: green !important;
}

.badge-danger {
    color: red !important;
}

.table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.75rem;
    vertical-align: middle;
}

.table td:hover {
    white-space: normal;
    overflow: visible;
}

.table th {
    padding: 0.75rem;
    vertical-align: middle;
}

.resolution-details {
    max-width: 200px;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 100px;
}

.metric-card {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-chart {
    height: 300px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 350px;
    overflow: hidden;
}

.load-status {
    margin-top: 15px;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

.load-status.high-load {
    background-color: #dc3545;
    color: white;
}

.load-status.normal-load {
    background-color: #28a745;
    color: white;
}

#loadGauge {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto;
    display: block;
}

.badge {
    padding: 5px 8px;
    font-size: 12px;
    font-weight: normal;
}

.table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

.btn-sm {
    white-space: nowrap;
}

/* Search highlighting styles */
.search-highlight {
    background-color: #80bdff;
    padding: 2px;
    border-radius: 3px;
    color: #000;
    font-weight: bold;
}

.search-match {
    background-color: rgba(255, 235, 59, 0.1);
}

#searchResultsInfo {
    font-size: 0.9rem;
}

#searchResultsInfo .badge {
    font-size: 1rem;
    padding: 0.25em 0.6em;
}

/* Ensure clear button is visible */
#clearSearchBtn {
    background-color: #6c7d6c;
    color: white;
    border: none;
}

#clearSearchBtn:hover {
    background-color: #5a6268;
}

/* Fix table row hover style with highlighted content */
.table tbody tr.search-match:hover {
    background-color: rgba(255, 235, 59, 0.2);
}

/* The input group for search styling */
.input-group .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Ensure table cells with highlights maintain proper sizing */
.table td .search-highlight {
    display: inline;
}

/* SageMaker metrics visualization styles */
.sagemaker-gauge-container {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    position: relative;
}

.indicator-circle {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin: 0 auto 5px auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.status-green {
    background-color: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.status-yellow {
    background-color: #ffc107;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

.status-red {
    background-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

.status-gray {
    background-color: #6c757d;
    box-shadow: 0 0 5px rgba(108, 117, 125, 0.5);
}

.status-indicator {
    text-align: center;
    min-width: 70px;
    margin: 0 auto;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top: 2px solid #fff;
    animation: rotate 1s infinite linear;
}

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

/* Standardized status colors */
.status-operational, .status-running, .status-active, .status-normal {
    color: #28a745;
    font-weight: bold;
}

.status-pending, .status-degraded, .status-warning, .status-unknown {
    color: #ffc107;
    font-weight: bold;
}

.status-down, .status-stopped, .status-terminated, .status-critical {
    color: #dc3545;
    font-weight: bold;
}

.status-default {
    color: #6c757d;
    font-weight: bold;
}

/* Instance status badges */
.instance-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    text-indent: -9999px;
    position: relative;
    overflow: hidden;
}

.instance-badge:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.badge-running, .badge-operational {
    background-color: #28a745;
}

.badge-pending, .badge-degraded {
    background-color: #ffc107;
}

.badge-stopped, .badge-terminated, .badge-down {
    background-color: #dc3545;
}

.badge-default {
    background-color: #6c757d;
}

.instance-state {
    margin-left: 4px;
    font-weight: 600;
}

/* Improved status indicator cell styling */
.status-indicator-cell {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Tab styling for consistency */
.nav-tabs .nav-link, .nav-pills .nav-link {
    font-weight: 500;
    color: #495057;
}

.nav-tabs .nav-link.active, .nav-pills .nav-link.active {
    font-weight: 600;
    color: #2c3e50;
    background-color: #f8f9fa;
    border-color: #dee2e6 #dee2e6 #fff;
}

.nav-tabs .nav-link:hover, .nav-pills .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    background-color: #f1f1f1;
}

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

/* Make detailed view tabs match the rest of the UI */
#view-tabs, #instances-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.tab-content {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 1.5rem;
    border-radius: 0 0 0.25rem 0.25rem;
}

.detailed-view-pills {
    margin-bottom: 1rem;
}

.detailed-view-pills .nav-link {
    margin-right: 4px;
    border-radius: 0.25rem;
}

.detailed-view-pills .nav-link.active {
    background-color: #4e73df;
    color: white;
}

/* Status indicator in summary view */
.status-indicator-cell {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* EC2 Instances table improvements */
.instances-table {
    margin-bottom: 0;
}

.instances-table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Make instances sections more consistent with other sections */
#running-instances, #stopped-instances {
    padding: 1rem 0;
}

/* Base styles */
body {
    background-color: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.content {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

/* Status indicators */
.status-operational {
    color: #28a745;
    font-weight: 500;
}

.status-down {
    color: #dc3545;
    font-weight: 500;
}

.status-default {
    color: #6c757d;
    font-style: italic;
}

.status-unknown {
    color: #6c757d;
    font-style: italic;
}

/* Badge styles for instance status */
.instance-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.badge-running, .status-normal {
    color: #28a745;
}

.badge-stopped, .status-warning {
    color: #ffc107;
}

.badge-terminated, .status-critical {
    color: #dc3545;
}

.badge-pending {
    color: #17a2b8;
}

/* Cards */
.card {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border: none;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.3);
}

/* Table styles */
.table th {
    font-weight: 600;
}

/* SageMaker styles */
.sagemaker-gauge-container {
    position: relative;
    height: 200px;
}

.indicator-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.status-normal {
    background-color: #28a745;
}

.status-warning {
    background-color: #ffc107;
}

.status-critical {
    background-color: #dc3545;
}

.status-unknown {
    background-color: #6c757d;
}

/* Loader modal */
.modal-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

/* Toast container */
.toast-container {
    z-index: 1090;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    max-width: 350px;
}

.toast {
    opacity: 1 !important;
    border: 0;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

/* Better color contrast for toast notifications */
.toast.text-bg-success {
    background-color: #10b981 !important;
    color: #fff !important;
}

.toast.text-bg-danger {
    background-color: #ef4444 !important;
    color: #fff !important;
}

.toast.text-bg-warning {
    background-color: #f59e0b !important;
    color: #fff !important;
}

.toast.text-bg-info {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

/* Toast header styling */
.toast-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.toast-header .btn-close {
    color: inherit;
    filter: brightness(0) invert(1);
    opacity: 0.75;
}

/* Alert styling improvements */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Improved chart and metrics styling */
.metric-chart {
    height: 300px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 350px;
    overflow: hidden;
}

/* Responsive metrics containers */
.metrics-container {
    position: relative;
    min-height: 180px;
    max-height: 250px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    background-color: white;
}

/* Chart loading overlay */
.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Responsive chart sizing */
@media (max-width: 1200px) {
    .metric-chart {
        height: 250px;
    }
}

@media (max-width: 992px) {
    .metric-chart {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .metric-chart {
        height: 200px;
        padding: 10px;
    }
    
    .metrics-container {
        min-height: 150px;
        padding: 8px;
    }
}

/* Metrics value labels for cards */
.metric-value-label {
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    background-color: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 5px;
}

.metric-value-label .value {
    font-family: monospace;
    font-weight: 500;
}

/* Ensure table cells with metrics maintain proper sizing */
.table td .metric-chart {
    height: auto;
    min-height: 100px;
    max-height: 150px;
}

/* Ensure metric cards don't grow excessively */
.card-body .metrics-container {
    max-height: 250px;
    overflow: hidden;
}

/* Improve chart tooltip to not expand the UI */
.chartjs-tooltip {
    opacity: 1;
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 3px;
    pointer-events: none;
    max-width: 200px;
    overflow-wrap: break-word;
}

.chartjs-tooltip-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
}

/* Main Dashboard Styles */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fb;
    color: #495057;
}

/* Button standardization */
.btn-primary {
    background-color: #3b7ddd;
    border-color: #3b7ddd;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #326abc;
    border-color: #2f64b1;
}

.btn-outline-primary {
    color: #3b7ddd;
    border-color: #3b7ddd;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: #3b7ddd;
    border-color: #3b7ddd;
    color: #fff;
}

/* Standardize view metrics button */
.btn-view-metrics {
    color: #3b7ddd;
    border-color: #3b7ddd;
    background-color: transparent;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-view-metrics:hover {
    background-color: #3b7ddd;
    color: white;
}

/* Health status indicators */
.status-operational {
    color: #28a745;
    font-weight: 500;
}

.status-down {
    color: #dc3545;
    font-weight: 500;
}

.status-default {
    color: #6c757d;
    font-weight: 500;
}

/* Card styling */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 0.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

/* Section styling */
section {
    margin-bottom: 2rem;
}

/* Container table styles */
.container-row td {
    vertical-align: middle;
}

.instance-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.badge-running {
    background-color: #28a745;
}

.badge-pending, .badge-provisioning {
    background-color: #ffc107;
}

.badge-stopped, .badge-stopping, .badge-terminated, .badge-shutting-down {
    background-color: #dc3545;
}

/* SageMaker status indicators */
.indicator-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #6c757d;
}

.indicator-circle.bg-success {
    background-color: #28a745;
}

.indicator-circle.bg-warning {
    background-color: #ffc107;
}

.indicator-circle.bg-danger {
    background-color: #dc3545;
}

/* Sidebar hamburger menu */
.sidebar-toggle {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.hamburger {
    width: 20px;
    height: 17px;
    position: relative;
    display: inline-block;
}

.hamburger:before,
.hamburger:after,
.hamburger span {
    content: '';
    display: block;
    height: 2px;
    background-color: #495057;
    position: absolute;
    left: 0;
    right: 0;
    transition: transform 0.2s ease;
}

.hamburger:before {
    top: 0;
}

.hamburger span {
    top: 7.5px;
}

.hamburger:after {
    bottom: 0;
}

.sidebar-toggle:hover .hamburger:before,
.sidebar-toggle:hover .hamburger span,
.sidebar-toggle:hover .hamburger:after {
    background-color: #3b7ddd;
}

.sidebar-collapsed .hamburger:before {
    transform: translateY(7.5px) rotate(45deg);
}

.sidebar-collapsed .hamburger span {
    opacity: 0;
}

.sidebar-collapsed .hamburger:after {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Toast notification styling */
.toast-container {
    z-index: 1060;
}

.toast {
    opacity: 1;
}

/* Last updated info */
.last-updated-info {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Status checks and health indicators */
.health-good {
    color: #28a745;
}

.health-warning {
    color: #ffc107;
}

.health-critical {
    color: #dc3545;
}

.health-unknown {
    color: #6c757d;
}

/* Modals */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive styles */
@media (max-width: 768px) {
    .card-title {
        font-size: 1rem;
    }
    
    section {
        margin-bottom: 1.5rem;
    }
}

/* SageMaker timeframe selector styles */
.timeframe-btn {
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 0.375rem;
}

.timeframe-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeframe-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.btn-group .timeframe-btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .timeframe-btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}