/**
 * Report Manager CSS Styles
 * Companion styles for the Dynamic Report Manager JavaScript
 * Updated with Green Theme (#2B8B3D) Integration
 */

:root {
    --primary-green: #2B8B3D;
    --primary-green-light: rgba(43, 139, 61, 0.1);
    --primary-green-extra-light: rgba(43, 139, 61, 0.05);
    --primary-green-dark: #1B5E20;
    --border-color: #dee2e6;
    --text-color: #495057;
    --bg-light: #f8f9fa;
    --bg-lighter: #e9ecef;
}

/* --- Global Utilities --- */

/* Loading States */
.loading .table tbody {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.loading {
    cursor: wait;
}

/* Highlighting rows dynamically */
.highlight {
    background-color: #f8d7da !important;
    color: #721c24;
}

.highlight.yellow {
    background-color: #fff3cd !important;
}

.highlight.blue {
    background-color: #cce5ff !important;
}

/* Accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- Table Styling --- */

.data-table,
.table {
    border-collapse: collapse;
    width: 100%;
}

/* Table Headers - Enhanced for sticky behavior with green theme */
.data-table thead th,
.data.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
    text-align: left;
    padding: 12px 15px;
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
    min-width: 50px;
    overflow: hidden;
    user-select: none;
    font-weight: 600;
    color: var(--text-color);
}

/* Table Resizing - Enhanced design */
.data-table th.resizable,
.data-table thead th {
    position: relative;
}

.data-table th .resizer {
    position: absolute;
    top: 0;
    right: -4px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: rgba(var(--primary-green), 0.1);
    transition: background 0.2s ease-in-out;
    z-index: 2;
    user-select: none;
}

.data-table th .resizer:hover {
    background: rgba(var(--primary-green), 0.4);
}

/* Table Sorting - Enhanced hover effects with green theme */
.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.data-table thead th.sortable:hover {
    background-color: var(--primary-green-light) !important;
}

.data-table th .sort-indicator {
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.5;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.data-table th.sort-asc .sort-indicator::after {
    content: "▲";
    opacity: 1;
    color: var(--primary-green);
}

.data-table th.sort-desc .sort-indicator::after {
    content: "▼";
    opacity: 1;
    color: var(--primary-green);
}

/* Enhanced Table Hover & Focus */
.table-hover tbody tr:hover {
    background-color: var(--primary-green-extra-light) !important;
    transition: background-color 0.15s ease-in-out;
}

.table tbody tr:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: -2px;
}

/* Custom Scrollbar for Table Container with green theme */
.table-responsive {
    overflow-y: auto;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}


/* --- Modern Card & UI Components --- */

/* Card Styling */
.modern-card {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px);
}

/* Card Headers */
.card-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--bg-lighter) !important;
    padding: 1rem 1.25rem !important;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h6 {
    color: var(--text-color) !important;
    font-weight: 600;
}

/* Summary footer improvements */
.summary-footer .card-body {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%) !important;
    border-radius: 0 0 12px 12px;
}

/* --- Dropdown Styling --- */

.modern-dropdown {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: none !important;
    min-width: 180px;
    padding: 0.5rem 0;
}

.modern-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
}

.modern-dropdown .dropdown-item:hover,
.modern-dropdown .dropdown-item:focus {
    background-color: var(--primary-green-light) !important;
    color: var(--primary-green) !important;
}

.modern-dropdown .dropdown-item.active {
    background-color: var(--primary-green) !important;
    color: white !important;
}

/* --- Button Styling --- */

/* Better button styling with green theme */
.action-btn {
    transition: all 0.2s ease;
    border-radius: 6px !important;
    font-weight: 500;
}

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

.action-btn.btn-primary:hover,
.action-btn.btn-success:hover {
    background-color: var(--primary-green-dark) !important;
    border-color: var(--primary-green-dark) !important;
}

/* Better Visual Feedback for Disabled Elements */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* --- Animations & Visuals --- */

/* AJAX Animations */
.ajax-generated {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner for Buttons */
.btn .bx-loader-alt {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Health Score Circle - Enhanced with green theme */
.health-circle {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-green) calc(var(--score) * 1%),
        #f1f3f4 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-circle::before {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    position: absolute;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.health-score-text {
    position: relative;
    z-index: 1;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-green) !important;
}

/* --- Media Queries --- */

/* Responsive Table Enhancements */
@media (max-width: 1199.98px) {
    .data-table th .resizer {
        display: none;
    }

    .data-table thead th.sortable {
        padding-right: 1.5rem;
    }
}

/* Mobile-first responsive improvements */
@media (max-width: 768px) {
    .health-circle {
        width: 70px;
        height: 70px;
    }

    .health-circle::before {
        width: 52px;
        height: 52px;
    }

    .health-score-text {
        font-size: 1rem;
    }

    .metric-card .card-body,
    .system-card .card-body,
    .contact-card .card-body {
        padding: 1rem !important;
    }

    .metric-card .metric-icon {
        height: 50px;
    }

    .system-card .card-header {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem;
    }

    .modern-card {
        border-radius: 8px !important;
    }

    .header-actions {
        min-width: 150px;
    }
}

@media (max-width: 576px) {
    .account-detail-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .health-circle {
        width: 60px;
        height: 60px;
    }

    .health-circle::before {
        width: 44px;
        height: 44px;
    }

    .health-score-text {
        font-size: 0.9rem;
    }

    .status-badge {
        font-size: 0.7rem !important;
        padding: 0.375rem 0.5rem;
    }

    .system-card .card-header {
        padding: 0.625rem 0.875rem !important;
        font-size: 0.8rem;
    }

    .system-card .card-body {
        padding: 0.875rem !important;
    }

    .btn-sm {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .modern-card {
        border-radius: 6px !important;
    }
}
.dash_hdr.card:hover {
    transform: none !important;
    border: none !important;
}