﻿/* maintenance-history-modal.css */

/* Modal Genel Stiller */
#maintenanceHistoryModal .modal-dialog {
    max-width: 1200px;
}

#maintenanceHistoryModal .modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: none;
}

/* Modal Header */
#maintenanceHistoryModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px 25px;
    border-bottom: none;
}

.modal-title-container {
    flex: 1;
}

#maintenanceHistoryModal .modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

    #maintenanceHistoryModal .modal-title i {
        font-size: 1.3rem;
    }

/* Araç Bilgileri */
.vehicle-info {
    margin-top: 10px;
}

.vehicle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

    .vehicle-details .plate-number {
        background-color: rgba(255,255,255,0.2);
        padding: 5px 12px;
        border-radius: 8px;
        font-weight: 700;
        font-family: 'Courier New', monospace;
        letter-spacing: 1px;
        font-size: 14px;
    }

    .vehicle-details .vehicle-brand-model {
        background-color: rgba(255,255,255,0.15);
        padding: 4px 10px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 13px;
    }

    .vehicle-details .vehicle-color {
        background-color: rgba(255,255,255,0.1);
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 12px;
        opacity: 0.9;
    }

/* Close Button */
#maintenanceHistoryModal .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    #maintenanceHistoryModal .btn-close:hover {
        opacity: 1;
        background-color: rgba(255,255,255,0.1);
        transform: scale(1.1);
    }

/* Modal Body */
#maintenanceHistoryModal .modal-body {
    padding: 25px;
    min-height: 400px;
}

/* Loading State */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #6c757d;
}

    .loading-spinner i {
        font-size: 2rem;
        color: #007bff;
    }

    .loading-spinner span {
        font-size: 14px;
        font-weight: 500;
    }

/* Error State */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #dc3545;
    text-align: center;
}

    .error-message i {
        font-size: 2rem;
    }

/* Empty State */
.empty-maintenance-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

    .empty-maintenance-state i {
        font-size: 4rem;
        color: #dee2e6;
        margin-bottom: 20px;
    }

    .empty-maintenance-state h5 {
        font-size: 1.3rem;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .empty-maintenance-state p {
        font-size: 1rem;
        opacity: 0.8;
    }

/* Table Container */
.table-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* DataTable Customization */
#dt-maintenance-history {
    margin-bottom: 0;
}

    #dt-maintenance-history thead th {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        color: white !important;
        border-color: #20c997 !important;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
        padding: 15px 10px;
        vertical-align: middle;
    }

    #dt-maintenance-history tbody tr {
        transition: all 0.2s ease;
    }

        #dt-maintenance-history tbody tr:hover {
            background-color: #f8f9fa !important;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

/* Table Cell Styles */
.maintenance-row td {
    vertical-align: middle;
    padding: 15px 10px;
}

/* Tarih Sütunu */
.service-date .main-date {
    font-weight: 700;
    color: #495057;
    font-size: 14px;
}

.service-date .created-date {
    font-size: 11px;
    color: #6c757d;
    margin-top: 3px;
}

/* Başlık Sütunu */
.service-title strong {
    color: #2c3e50;
    font-size: 14px;
}

/* Tutar Sütunu */
.service-cost .cost-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 15px;
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

/* Ürünler Sütunu */
.service-items {
    max-height: 120px;
    overflow-y: auto;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
    font-size: 12px;
}

    .service-item:last-child {
        margin-bottom: 0;
    }

.item-type {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 45px;
    text-align: center;
}

    .item-type.product {
        background-color: #007bff;
        color: white;
    }

    .item-type.labor {
        background-color: #fd7e14;
        color: white;
    }

.item-name {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.item-quantity {
    font-weight: 600;
    color: #6c757d;
    min-width: 25px;
}

.item-price {
    font-weight: 700;
    color: #28a745;
    min-width: 60px;
    text-align: right;
}

/* Açıklama Sütunu */
.service-description .description-text {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
    max-width: 200px;
    display: block;
    word-wrap: break-word;
}

/* İşlemler Sütunu */
.service-actions {
    text-align: center;
}

    .service-actions .action-buttons {
        display: flex;
        gap: 5px;
        justify-content: center;
    }

    .service-actions .btn-action {
        padding: 6px 10px;
        border: none;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 32px;
    }

.btn-edit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.btn-view-detail {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

    .btn-view-detail:hover {
        background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
        color: white;
    }

.btn-edit-record {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

    .btn-edit-record:hover {
        background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
        color: #212529;
    }

/* Modal Footer */
#maintenanceHistoryModal .modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

    #maintenanceHistoryModal .modal-footer .btn {
        padding: 10px 20px;
        font-weight: 600;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

        #maintenanceHistoryModal .modal-footer .btn i {
            margin-right: 6px;
        }

    #maintenanceHistoryModal .modal-footer .btn-primary {
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        border: none;
        box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    }

        #maintenanceHistoryModal .modal-footer .btn-primary:hover {
            background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
        }

/* DataTable Pagination */
#maintenanceHistoryModal .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border-color: #28a745 !important;
    color: white !important;
    border-radius: 6px;
}

#maintenanceHistoryModal .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%) !important;
    border-color: #20c997 !important;
    color: white !important;
}

/* DataTable Info ve Length */
#maintenanceHistoryModal .dataTables_wrapper .dataTables_info {
    color: #6c757d;
    font-weight: 500;
    font-size: 13px;
}

#maintenanceHistoryModal .dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 4px 8px;
    font-size: 13px;
}

/* DataTable Search */
#maintenanceHistoryModal .dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    margin-left: 8px;
    font-size: 13px;
}

    #maintenanceHistoryModal .dataTables_wrapper .dataTables_filter input:focus {
        border-color: #28a745;
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        outline: none;
    }

/* Scrollbar Customization */
.service-items::-webkit-scrollbar {
    width: 4px;
}

.service-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.service-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

    .service-items::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Responsive Düzenlemeler */
@media (max-width: 1200px) {
    #maintenanceHistoryModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    #maintenanceHistoryModal .modal-dialog {
        max-width: 98%;
        margin: 0.5rem auto;
    }

    #maintenanceHistoryModal .modal-body {
        padding: 15px;
    }

    #maintenanceHistoryModal .modal-header {
        padding: 15px;
    }

    #maintenanceHistoryModal .modal-footer {
        padding: 15px;
    }

    .vehicle-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .service-actions .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .service-actions .btn-action {
        width: 100%;
        min-width: auto;
    }

    .service-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .item-type {
        align-self: flex-start;
    }
}

@media (max-width: 576px) {
    #maintenanceHistoryModal .modal-title {
        font-size: 1.2rem;
    }

    .vehicle-details .plate-number {
        font-size: 12px;
        padding: 4px 8px;
    }

    .vehicle-details .vehicle-brand-model,
    .vehicle-details .vehicle-color {
        font-size: 11px;
        padding: 3px 6px;
    }

    #dt-maintenance-history thead th {
        font-size: 10px;
        padding: 10px 6px;
    }

    .maintenance-row td {
        padding: 10px 6px;
    }

    .service-date .main-date,
    .service-title strong {
        font-size: 12px;
    }

    .service-cost .cost-amount {
        font-size: 13px;
        padding: 4px 8px;
    }
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#maintenanceHistoryModal .modal-content {
    animation: fadeInUp 0.3s ease-out;
}

.maintenance-row {
    animation: fadeInUp 0.2s ease-out;
}

    .maintenance-row:nth-child(odd) {
        animation-delay: 0.05s;
    }

    .maintenance-row:nth-child(even) {
        animation-delay: 0.1s;
    }

/* Tooltip Customization */
#maintenanceHistoryModal .tooltip {
    z-index: 9999;
}

#maintenanceHistoryModal .tooltip-inner {
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Proforma butonu */
.btn-proforma {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
}

    .btn-proforma:hover {
        background: linear-gradient(135deg, #5a32a3 0%, #4c2a85 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(111, 66, 193, 0.4);
        color: white;
    }

    .btn-proforma:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
    }

/* Proforma preview popup */
.proforma-preview-popup {
    max-width: 95vw !important;
    max-height: 95vh !important;
}

    .proforma-preview-popup iframe {
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

/* Delete butonu */
.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

    .btn-delete:hover {
        background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
        color: white;
    }

    .btn-delete:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }
