﻿/* maintenancegrid.css - Friendly and Modern Maintenance Dashboard Styles */

/* Main container and layout */
.MM-maintenance-dashboard {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border-top: 4px solid #2563eb; /* Added top border line */
}

/* Header row with icon and title - no longer includes Add button */
.MM-dashboard-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

/* Title with lightning icon */
.MM-dashboard-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mm-bolt-icon {
    color: #f59e0b; /* Golden color for the bolt */
    font-size: 1.5rem;
}

.MM-dashboard-header h3 {
    color: #2563eb;
    font-weight: 600;
    margin: 0;
    font-size: 1.6rem;
}

/* Horizontal divider under header */
.MM-divider {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 0.5rem 0 1.5rem;
}

/* Filter and Actions Row - updated to have filter buttons and Add New Record button */
.MM-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Filter buttons container: horizontal layout */
.MM-filter-group {
    display: flex;
    gap: 0; /* No gap between buttons - connected look */
}

/* Filter buttons - updated to match image style */
.MM-filter-btn {
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #333;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
    border-radius: 0;
    padding: 0.5rem 1.25rem;
    outline: none !important; /* Remove outline */
}

    /* First and last buttons with rounded corners */
    .MM-filter-btn:first-child {
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
    }

    .MM-filter-btn:last-child {
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
    }

    .MM-filter-btn:not(:last-child) {
        border-right: none;
    }

    .MM-filter-btn:hover {
        background-color: #f3f4f6;
    }

    .MM-filter-btn:focus {
        outline: none !important; /* Remove outline on focus */
        box-shadow: none !important; /* Remove box shadow on focus */
    }

    /* Filter active states with specific color matching */
    .MM-filter-btn.active {
        color: #ffffff;
        border-color: #1e40af;
    }

        /* All button active state */
        .MM-filter-btn.active[data-filter="All"] {
            background-color: #1e40af;
        }

        /* Completed button active state - green */
        .MM-filter-btn.active[data-filter="Completed"] {
            background-color: #16a34a;
            border-color: #16a34a;
        }

        /* Scheduled button active state - yellow */
        .MM-filter-btn.active[data-filter="Scheduled"] {
            background-color: #ca8a04;
            border-color: #ca8a04;
        }

        /* In Progress button active state - orange */
        .MM-filter-btn.active[data-filter="In Progress"] {
            background-color: #ea580c;
            border-color: #ea580c;
        }

        /* Overdue button active state - red */
        .MM-filter-btn.active[data-filter="Overdue"] {
            background-color: #dc2626;
            border-color: #dc2626;
        }

/* "Add New Record" button - adjusted to match image */
.MM-add-record-btn {
    background-color: #22c55e;
    border-color: #22c55e;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
    outline: none !important; /* Remove outline */
}

    .MM-add-record-btn:hover {
        background-color: #16a34a;
        border-color: #16a34a;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(34, 197, 94, 0.25);
    }

    .MM-add-record-btn:focus {
        outline: none !important; /* Remove outline on focus */
        box-shadow: none !important; /* Remove box shadow on focus */
    }

    .MM-add-record-btn i {
        margin-right: 0.5rem;
    }

/* Table styling */
.MM-table-container {
    scrollbar-gutter: stable both-edges;
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.MM-maintenance-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

    .MM-maintenance-table thead th {
        background-color: #f1f5f9;
        color: #475569;
        font-weight: 600;
        text-align: center;
        padding: 0.85rem 0.6rem;
        position: sticky;
        top: 0;
        z-index: 10;
        border-bottom: 2px solid #e2e8f0;
        transition: background-color 0.2s ease;
    }

        .MM-maintenance-table thead th:hover {
            background-color: #e2e8f0;
        }

    .MM-maintenance-table th:first-child {
        border-top-left-radius: 8px;
    }

    .MM-maintenance-table th:last-child {
        border-top-right-radius: 8px;
    }

    .MM-maintenance-table tbody tr {
        border-bottom: 1px solid #e9ecef;
        transition: background-color 0.2s ease;
    }

        .MM-maintenance-table tbody tr:hover {
            background-color: #f8fafc;
        }

        .MM-maintenance-table tbody tr:last-child {
            border-bottom: none;
        }

    .MM-maintenance-table td {
        padding: 0.85rem 0.6rem;
        text-align: center;
        vertical-align: middle;
        border-right: 1px solid #f1f5f9;
    }

        .MM-maintenance-table td:last-child {
            border-right: none;
        }

/* Year header styling */
.MM-year-header {
    width: 6.5rem;
}

.MM-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .MM-header-content span {
        font-weight: 600;
        font-size: 1rem;
        color: #2563eb;
    }

/* Status cell styling */
.MM-status-cell {
    padding: 0.5rem 0.25rem !important;
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 6px;
    overflow: hidden;
}

    .MM-status-cell:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        z-index: 5;
    }

.MM-status-date {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: #334155;
}

.MM-status-label {
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 0.2rem 0.6rem;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Custom status colors with improved contrast */
.MM-status-cell[style*="DCFFE4"] .MM-status-label { /* Completed */
    color: #16a34a;
    border: 1px solid #16a34a;
}

.MM-status-cell[style*="FFF4D1"] .MM-status-label { /* Plan */
    color: #ca8a04;
    border: 1px solid #ca8a04;
}

.MM-status-cell[style*="FFE5CC"] .MM-status-label { /* Pending */
    color: #ea580c;
    border: 1px solid #ea580c;
}

.MM-status-cell[style*="FFE0E0"] .MM-status-label { /* Overdue */
    color: #dc2626;
    border: 1px solid #dc2626;
    animation: pulse 2s infinite;
}

/* Action buttons styling */
.MM-action-buttons {
    white-space: nowrap;
}

.MM-action-btn {
    margin: 0 0.3rem;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0 !important;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none !important; /* Remove outline */
}

    .MM-action-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    }

    .MM-action-btn:focus {
        outline: none !important; /* Remove outline on focus */
        box-shadow: none !important; /* Remove box shadow on focus */
    }

    .MM-action-btn.btn-primary {
        background-color: #3b82f6;
        border-color: #3b82f6;
    }

        .MM-action-btn.btn-primary:hover {
            background-color: #2563eb;
            border-color: #2563eb;
        }

    .MM-action-btn.btn-danger {
        background-color: #ef4444;
        border-color: #ef4444;
    }

        .MM-action-btn.btn-danger:hover {
            background-color: #dc2626;
            border-color: #dc2626;
        }

    .MM-action-btn i {
        font-size: 0.9rem;
        margin: 0;
    }

/* View report button styling */
.MM-view-report-btn {
    color: #3b82f6;
    padding: 0.3rem 0.6rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    outline: none !important; /* Remove outline */
}

    .MM-view-report-btn:hover {
        color: #2563eb;
        background-color: #f0f9ff;
        transform: translateY(-2px);
    }

    .MM-view-report-btn:focus {
        outline: none !important; /* Remove outline on focus */
        box-shadow: none !important; /* Remove box shadow on focus */
    }

    .MM-view-report-btn i {
        margin-right: 0.3rem;
    }

/* Remove outlines from all buttons */
.btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Alternating row colors for better readability */
.MM-maintenance-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Tooltip styling for header abbreviations */
.MM-maintenance-table th[title] {
    position: relative;
    cursor: help;
}

    .MM-maintenance-table th[title]:hover::after {
        content: attr(title);
        position: absolute;
        top: 110%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #334155;
        color: white;
        padding: 0.6rem;
        border-radius: 6px;
        font-size: 0.8rem;
        white-space: nowrap;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        pointer-events: none;
    }

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .MM-maintenance-table {
        font-size: 0.85rem;
    }

    .MM-year-header {
        width: 5.5rem;
    }
}

@media (max-width: 992px) {
    .MM-actions-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .MM-maintenance-table {
        font-size: 0.8rem;
    }

    .MM-status-cell {
        padding: 0.4rem 0.2rem !important;
    }

    .MM-status-date {
        font-size: 0.75rem;
    }

    .MM-status-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .MM-year-header {
        width: 4.5rem;
    }

    .MM-action-btn {
        width: 1.8rem;
        height: 1.8rem;
    }

    .MM-maintenance-dashboard {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .MM-maintenance-dashboard {
        background-color: white;
        box-shadow: none;
        padding: 0;
    }

    .MM-add-record-btn,
    .MM-action-buttons,
    .MM-filter-group {
        display: none;
    }

    .MM-table-container {
        box-shadow: none;
    }

    .MM-maintenance-table thead th {
        background-color: #f1f1f1;
        color: black;
    }

    .MM-status-cell:hover {
        transform: none;
        box-shadow: none;
    }
}
