﻿/* Transformer Maintenance List Page CSS */
:root {
    --primary: #2e4c6d;
    --primary-light: #396791;
    --secondary: #fc814a;
    --tertiary: #56c596;
    --light: #f0f5fa;
    --dark: #1a2a3a;
    --danger: #e63946;
    --warning: #ffb703;
    --success: #06d6a0;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Main Container */
.TMMContainer {
    background-color: var(--light);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

    .TMMContainer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 8px;
        background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    }

/* Page Title */
.TMMPageTitle {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #e1e8f0;
    padding-bottom: 0.75rem;
    position: relative;
    display: flex;
    align-items: center;
}

    .TMMPageTitle::before {
        content: '⚡';
        margin-right: 0.5rem;
        font-size: 1.5rem;
    }

/* Filter and Action Bar */
.TMMActionBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.TMMFilterGroup {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.TMMFilterBtn {
    background-color: white;
    border: 1px solid #e1e8f0;
    padding: 0.625rem 1rem;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

    .TMMFilterBtn:not(:last-child) {
        border-right: none;
    }

    .TMMFilterBtn:hover {
        background-color: rgba(46, 76, 109, 0.05);
    }

    .TMMFilterBtn.active {
        background-color: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .TMMFilterBtn.active-completed {
        background-color: var(--success);
        color: white;
        border-color: var(--success);
    }

    .TMMFilterBtn.active-scheduled {
        background-color: var(--primary-light);
        color: white;
        border-color: var(--primary-light);
    }

    .TMMFilterBtn.active-inprogress {
        background-color: var(--secondary);
        color: white;
        border-color: var(--secondary);
    }

    .TMMFilterBtn.active-overdue {
        background-color: var(--danger);
        color: white;
        border-color: var(--danger);
    }

.TMMAddBtn {
    background-color: var(--tertiary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

    .TMMAddBtn:hover {
        background-color: #48b587;
        box-shadow: 0 4px 8px rgba(86, 197, 150, 0.3);
        transform: translateY(-2px);
    }

    .TMMAddBtn::before {
        content: '+';
        font-weight: bold;
        font-size: 1.2rem;
    }

/* Table Styles */
.TMMTableContainer {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.TMMTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

    .TMMTable th {
        background-color: var(--primary);
        color: white;
        font-weight: 600;
        text-align: center;
        padding: 0.75rem 0.5rem;
        position: relative;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.85rem;
    }

        .TMMTable th:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 25%;
            height: 50%;
            width: 1px;
            background-color: rgba(255, 255, 255, 0.2);
        }

    .TMMTable td {
        padding: 0.875rem 0.5rem;
        border-top: 1px solid #e1e8f0;
        vertical-align: middle;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .TMMTable tbody tr {
        transition: var(--transition);
    }

        .TMMTable tbody tr:hover {
            background-color: rgba(46, 76, 109, 0.02);
        }

        .TMMTable tbody tr:nth-child(even) {
            background-color: rgba(240, 245, 250, 0.5);
        }

    .TMMTable tr.row-danger {
        background-color: rgba(230, 57, 70, 0.05);
    }

    .TMMTable tr.row-warning {
        background-color: rgba(255, 183, 3, 0.05);
    }

    /* Fixed column widths */
    .TMMTable th.equipment-tag, .TMMTable td.equipment-tag {
        width: 11%;
    }

    .TMMTable th.size, .TMMTable td.size {
        width: 7%;
    }

    .TMMTable th.make, .TMMTable td.make {
        width: 9%;
    }

    .TMMTable th.counter, .TMMTable td.counter {
        width: 10%;
    }

    .TMMTable th.tap-status, .TMMTable td.tap-status {
        width: 15%;
    }

    .TMMTable th.health, .TMMTable td.health {
        width: 11%;
    }

    .TMMTable th.status, .TMMTable td.status {
        width: 14%;
    }

    .TMMTable th.actions, .TMMTable td.actions {
        width: 13%;
    }

/* Status Badges */
.TMMBadge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.TMMBadgeHealthy {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeAlarm {
    background-color: rgba(255, 183, 3, 0.2);
    color: #b27d00;
}

.TMMBadgeDanger {
    background-color: rgba(230, 57, 70, 0.2);
    color: #b02a34;
}

.TMMBadgeCompleted {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeScheduled {
    background-color: rgba(57, 103, 145, 0.2);
    color: #2e4c6d;
}

.TMMBadgeInProgress {
    background-color: rgba(252, 129, 74, 0.2);
    color: #e86120;
}

.TMMBadgeOverdue, .TMMBadgeMaintenanceOverdue {
    background-color: rgba(230, 57, 70, 0.2);
    color: #b02a34;
}

.TMMBadgeUpcoming {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeDueSoon {
    background-color: rgba(255, 183, 3, 0.2);
    color: #b27d00;
}

.TMMBadgeSecondary {
    background-color: rgba(46, 76, 109, 0.1);
    color: #2e4c6d;
}

/* Action Buttons */
.TMMActionGroup {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.TMMActionBtn {
    border: none;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.TMMActionBtnView {
    background-color: rgba(46, 76, 109, 0.1);
    color: var(--primary);
}

    .TMMActionBtnView:hover {
        background-color: rgba(46, 76, 109, 0.2);
    }

.TMMActionBtnEdit {
    background-color: rgba(253, 129, 74, 0.1);
    color: var(--secondary);
}

    .TMMActionBtnEdit:hover {
        background-color: rgba(253, 129, 74, 0.2);
    }

/* Loading State */
.TMMLoading {
    padding: 2rem;
    text-align: center;
    font-style: italic;
    color: var(--primary-light);
}

.TMMEmptyState {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    border: 1px dashed #e1e8f0;
    color: #666;
}

    .TMMEmptyState::before {
        content: '📋';
        display: block;
        font-size: 3rem;
        margin-bottom: 1rem;
    }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .TMMActionBar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .TMMContainer {
        padding: 1.5rem;
        margin: 1rem;
    }

    .TMMPageTitle {
        font-size: 1.5rem;
    }

    .TMMTable {
        display: block;
        overflow-x: auto;
        table-layout: auto;
    }

        .TMMTable th, .TMMTable td {
            min-width: 100px;
        }

    .TMMFilterGroup {
        width: 100%;
    }

    .TMMFilterBtn {
        flex: 1;
        text-align: center;
    }

    .TMMAddBtn {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for loading state */
.TMMLoadingSpinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(46, 76, 109, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
