﻿/* ============================================
   DASHBOARD CONSTRAINED WIDTH STYLES
   Add these styles to your existing site.css
   ============================================ */

/* CONSTRAIN THE DISPLAY WIDTH - prevents full screen stretching */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.status-table-container {
    max-width: 100%;
    overflow-x: auto;
}

/* Make both tables identical */
#statusTable,
#logTable {
    width: auto !important;
    min-width: 800px;
    margin: 0 auto;
}

    #statusTable th,
    #statusTable td,
    #logTable th,
    #logTable td {
        white-space: nowrap;
        padding: 12px 8px;
        vertical-align: middle;
    }

        /* Topic/Message column constraint for both tables */
        #statusTable th:nth-child(3),
        #statusTable td:nth-child(3),
        #logTable th:nth-child(4),
        #logTable td:nth-child(4) {
            max-width: 250px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

/* Status box styling improvements */
.status-box {
    min-width: 80px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    display: inline-block;
    transition: all 0.2s ease;
}

    .status-box:hover {
        transform: scale(1.02);
    }

/* Button improvements */
.btn-action {
    min-width: 70px;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

    .btn-action:hover {
        transform: translateY(-1px);
    }

/* Enhanced log section */
#logEntries {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0.375rem;
}



/* FIXED: Both table headers with white text - identical styling */
#statusTable thead th,
#logTable thead th {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* Modal text highlighting */
.highlight-text {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
}

/* Pending state animations */
.spinner-pending {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Enhanced responsive adjustments for dashboard */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 10px;
    }

    #statusTable,
    #logTable {
        min-width: 600px;
    }

    .display-4 {
        font-size: 2rem;
    }

    .status-box {
        font-size: 0.8em;
        padding: 6px 10px;
    }

    .btn-action {
        font-size: 0.75em;
        min-width: 60px;
    }
}

@media (max-width: 576px) {
    .dashboard-container {
        padding: 0 5px;
    }

    #statusTable,
    #logTable {
        min-width: 500px;
    }

    .display-4 {
        font-size: 1.5rem;
    }
}

/* Dashboard card improvements */
.dashboard-container .card {
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
}

.dashboard-container .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #ffc107;
}

    .dashboard-container .card-header h5 {
        color: #212529;
        font-weight: 600;
    }

/* Table row hover effects - both tables identical */
#statusTable tbody tr,
#logTable tbody tr {
    transition: all 0.2s ease;
}

    #statusTable tbody tr:hover,
    #logTable tbody tr:hover {
        background-color: rgba(13, 110, 253, 0.05);
        transform: scale(1.01);
    }

/* Enhanced button states */
.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Loading states for dashboard */
.dashboard-loading {
    opacity: 0.7;
    pointer-events: none;
}

    .dashboard-loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 2rem;
        height: 2rem;
        margin: -1rem 0 0 -1rem;
        border: 2px solid #0d6efd;
        border-radius: 50%;
        border-top-color: transparent;
        animation: spin 1s linear infinite;
    }

/* Success/Error state indicators */
.state-success {
    border-left: 4px solid #198754;
}

.state-warning {
    border-left: 4px solid #ffc107;
}

.state-error {
    border-left: 4px solid #dc3545;
}
