/*
 * TSL Monitoring Dashboard - Custom Styles
 */

/* Global Styles */
:root {
    --chart-height: 350px;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Cards */
.card {
    border: none;
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

/* Dashboard Cards */
.card.text-white .card-title {
    opacity: 0.9;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card.text-white h2,
.card.text-white h3,
.card.text-white h4 {
    font-weight: 700;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Buttons */
.btn {
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-outline-secondary.active {
    background-color: #6c757d;
    color: #fff;
}

/* Chart Containers */
[style*="height: 350px"],
[style*="height: 400px"],
[style*="height: 450px"],
[style*="height: 500px"] {
    border-radius: 0.25rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Code blocks */
code {
    background-color: #e9ecef;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 85%;
    color: #c7254e;
}

/* Utility Classes */
.text-truncate-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--chart-height);
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.chart-loading::after {
    content: 'Loading...';
    color: #6c757d;
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card.text-white h2,
    .card.text-white h3 {
        font-size: 1.5rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    [style*="height: 350px"],
    [style*="height: 400px"] {
        height: 250px !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none;
    }

    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Animation for status changes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom scrollbar for tables */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 4px;
}

/* Tooltip customization */
.tooltip-inner {
    font-size: 0.875rem;
}

/* Modal improvements */
.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Icon sizing */
.bi {
    vertical-align: -0.125em;
}
