﻿/* Unified Transformer Maintenance Styles */
:root {
    --primary: #2e4c6d;
    --primary-light: #396791;
    --primary-gradient: linear-gradient(135deg, #0078d4, #005a9e);
    --secondary: #fc814a;
    --tertiary: #56c596;
    --light: #f0f5fa;
    --dark: #1a2a3a;
    --danger: #e63946;
    --warning: #ffb703;
    --success: #06d6a0;
    --tapchanger-gradient: linear-gradient(135deg, #f6b73c, #e39f18);
    --dga-gradient: linear-gradient(135deg, #17a2b8, #138496);
    --plan-gradient: linear-gradient(135deg, #28a745, #1e7e34);
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Common Container Styles */
.TMMContainer, .TFContainer {
    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;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    .TMMContainer::before, .TFContainer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 8px;
        background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    }

/* Page Titles */
.TMMPageTitle, .TFPageTitle {
    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, .TFPageTitle::before {
        content: '⚡';
        margin-right: 0.5rem;
        font-size: 1.5rem;
    }

/* Buttons Styles */
.TMMAddBtn, .TFButton {
    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;
    position: relative;
    overflow: hidden;
}

.TMMAddBtn, .TFButton-Primary {
    background-color: var(--tertiary);
    color: white;
    border: none;
}

    .TMMAddBtn:hover, .TFButton-Primary:hover {
        background-color: #48b587;
        box-shadow: 0 4px 8px rgba(86, 197, 150, 0.3);
        transform: translateY(-2px);
    }

.TFButton-Secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

    .TFButton-Secondary:hover {
        background-color: #5a6268;
        border-color: #545b62;
        transform: translateY(-2px);
    }

/* Card Styles */
.TFCard {
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

    .TFCard:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.TFCardHeader {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.TFCardHeader-General {
    background: var(--primary-gradient);
}

.TFCardHeader-TapChanger {
    background: var(--tapchanger-gradient);
}

.TFCardHeader-DGA {
    background: var(--dga-gradient);
}

.TFCardHeader-Plan {
    background: var(--plan-gradient);
}

.TFCardBody {
    padding: 16px;
    background-color: #ffffff;
}

/* Form Styles */
.TFFormGroup {
    margin-bottom: 1rem;
}

.TFFormLabel {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #444;
    font-size: 0.9rem;
}

.TFFormControl, .TFFormSelect {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .TFFormControl:focus, .TFFormSelect:focus {
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.2);
    }

.TFFormSelect {
    padding: 0.4rem 1.8rem 0.4rem 0.6rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px 10px;
}

.TFValidationMessage {
    width: 100%;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #dc3545;
}

/* Grid System */
.TFRow {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.TFCol {
    position: relative;
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
    margin-bottom: 0.8rem;
}

@media (min-width: 768px) {
    .TFCol-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .TFCol-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .TFCol-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Button Group */
.TFButtonGroup {
    margin-top: 1.25rem;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Badge Styles */
.TMMBadge, .TFBadge {
    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;
}

/* Badge Colors - Common across both components */
.TMMBadgeHealthy, .TFBadge-Healthy {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeAlarm, .TFBadge-Alarm {
    background-color: rgba(255, 183, 3, 0.2);
    color: #b27d00;
}

.TMMBadgeDanger, .TFBadge-Danger {
    background-color: rgba(230, 57, 70, 0.2);
    color: #b02a34;
}

.TMMBadgeCompleted, .TFBadge-Completed {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeScheduled, .TFBadge-Scheduled {
    background-color: rgba(57, 103, 145, 0.2);
    color: #2e4c6d;
}

.TMMBadgeInProgress, .TFBadge-InProgress {
    background-color: rgba(252, 129, 74, 0.2);
    color: #e86120;
}

.TMMBadgeOverdue, .TFBadge-Overdue, .TFBadge-PlanOverdue, .TMMBadgeMaintenanceOverdue {
    background-color: rgba(230, 57, 70, 0.2);
    color: #b02a34;
}

.TMMBadgeUpcoming, .TFBadge-Upcoming {
    background-color: rgba(6, 214, 160, 0.2);
    color: #048c68;
}

.TMMBadgeDueSoon, .TFBadge-DueSoon {
    background-color: rgba(255, 183, 3, 0.2);
    color: #b27d00;
}

.TMMBadgeSecondary, .TFBadge-Secondary {
    background-color: rgba(46, 76, 109, 0.1);
    color: #2e4c6d;
}

/* 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);
    }

/* 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%;
    }

/* 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 States */
.TMMLoading, .TFSpinnerContainer {
    padding: 2rem;
    text-align: center;
    font-style: italic;
    color: var(--primary-light);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.TMMLoadingSpinner, .TFSpinner {
    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;
}

.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;
    }

/* Form specific elements */
.TFInfoIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #0078d4;
    color: white;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    position: relative;
}

    .TFInfoIcon:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 10px;
        background-color: #333;
        color: white;
        border-radius: 4px;
        font-size: 12px;
        font-weight: normal;
        white-space: nowrap;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

.TFFormLabelWrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.3rem;
}

.TFStatusDisplay {
    padding: 6px 0;
}

.TFInfoText {
    display: block;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Button ripple effect */
.TFButton:after, .TMMAddBtn:after, .TMMActionBtn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.TFButton:focus:not(:active)::after,
.TMMAddBtn:focus:not(:active)::after,
.TMMActionBtn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .TMMActionBar, .TFContainer {
        flex-direction: column;
        align-items: flex-start;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .TMMContainer, .TFContainer {
        padding: 1.5rem;
        margin: 1rem;
        max-width: 100%;
    }

    .TMMPageTitle, .TFPageTitle {
        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;
    }

    .TFRow {
        flex-direction: column;
    }

    .TFCol {
        max-width: 100%;
    }
}
