/**
 * Violations & Alerts Shared Styles
 * Used across: violations.html, alerts.html
 *
 * Components:
 * - Status Row Highlighting
 * - Action Buttons
 * - Table Enhancements
 */

/* ==========================================================================
   STATUS ROW HIGHLIGHTING
   Row colors for approved/rejected status in tables
   ========================================================================== */

/* Apply background to cells to override Bootstrap striped rules (which color *cells*) */
.table tbody tr.status-row-approved > * {
    background-color: #d1e7dd !important; /* Bootstrap success-100 */
}

.table tbody tr.status-row-approved:hover > * {
    background-color: #c3e6cb !important; /* Darker on hover */
}

.table tbody tr.status-row-rejected > * {
    background-color: #f8d7da !important; /* Bootstrap danger-100 */
}

.table tbody tr.status-row-rejected:hover > * {
    background-color: #f5c2c7 !important; /* Darker on hover */
}

/* ==========================================================================
   ACTION BUTTONS
   Small action buttons in table rows
   ========================================================================== */

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.action-btn.view-btn:hover {
    color: #0d6efd;
    border-color: #0d6efd;
}

.action-btn.edit-btn:hover {
    color: #198754;
    border-color: #198754;
}

.action-btn.delete-btn:hover {
    color: #dc3545;
    border-color: #dc3545;
}

/* Tooltip for action buttons */
.action-btn[data-tooltip] {
    position: relative;
}

.action-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    margin-bottom: 4px;
}

.action-btn[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   TABLE ENHANCEMENTS
   Custom table styling for violations/alerts
   ========================================================================== */

.violations-table-container,
.alerts-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.violations-table,
.alerts-table {
    margin-bottom: 0;
}

.violations-table th,
.alerts-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 16px;
}

.violations-table td,
.alerts-table td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Status Badge Enhancements */
.badge-status {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

/* ==========================================================================
   PAGINATION WRAPPER
   Container for pagination controls
   ========================================================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .violations-table th,
    .alerts-table th {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    .violations-table td,
    .alerts-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    .action-btn {
        width: 36px;
        height: 36px;
    }
    /* Hide CSS tooltips on touch devices (no hover) */
    .action-btn[data-tooltip]::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .violations-table th,
    .alerts-table th {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    .violations-table td,
    .alerts-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
}
