/**
 * Equipment & Fleet Management Styles
 *
 * Modern, responsive styles for equipment and fleet modules
 */

/* ==================== SHARED COMPONENTS ==================== */

/* Photo Uploader */
.photo-uploader {
    width: 100%;
}

.photo-upload-zone {
    border: 2px dashed var(--mts-primary-color, #4A90E2);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--mts-gray-50, #f9fafb);
}

.photo-upload-zone:hover {
    border-color: var(--mts-primary-dark, #357ABD);
    background: var(--mts-gray-100, #f3f4f6);
}

.photo-upload-zone.drag-over {
    border-color: var(--mts-primary-dark, #357ABD);
    background: var(--mts-primary-light, #E3F2FD);
}

.photo-upload-zone.has-photos {
    padding: 1rem;
    margin-bottom: 1rem;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-text strong {
    color: var(--mts-primary-color, #4A90E2);
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--mts-gray-600, #6b7280);
}

.upload-queue {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

.upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    border-radius: 4px;
    background: white;
}

.upload-item.uploading {
    border-color: var(--mts-primary-color, #4A90E2);
}

.upload-item.success {
    border-color: var(--mts-success-color, #10b981);
}

.upload-item.error {
    border-color: var(--mts-danger-color, #ef4444);
}

.upload-item-info {
    flex: 1;
    min-width: 0;
}

.upload-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-size {
    font-size: 0.875rem;
    color: var(--mts-gray-600, #6b7280);
}

.upload-item-progress {
    flex: 1;
    margin-left: 1rem;
}

.progress-bar {
    height: 6px;
    background: var(--mts-gray-200, #e5e7eb);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: var(--mts-primary-color, #4A90E2);
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 0.75rem;
    color: var(--mts-gray-600, #6b7280);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    background: var(--mts-gray-50, #f9fafb);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    color: #1f2937;
    transition: transform 0.2s ease;
}

.photo-btn:hover {
    transform: scale(1.05);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    text-align: center;
}

.photo-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.photo-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.photo-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.photo-viewer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Modal */
/* DISABLED - conflicts with global .mts-modal: .mts-modal {
/* DISABLED - conflicts with global .mts-modal:     position: fixed;
/* DISABLED - conflicts with global .mts-modal:     top: 0;
/* DISABLED - conflicts with global .mts-modal:     left: 0;
/* DISABLED - conflicts with global .mts-modal:     right: 0;
/* DISABLED - conflicts with global .mts-modal:     bottom: 0;
/* DISABLED - conflicts with global .mts-modal:     z-index: 9999;
/* DISABLED - conflicts with global .mts-modal:     display: flex;
/* DISABLED - conflicts with global .mts-modal:     align-items: center;
/* DISABLED - conflicts with global .mts-modal:     justify-content: center;
/* DISABLED - conflicts with global .mts-modal:     opacity: 0;
/* DISABLED - conflicts with global .mts-modal:     transition: opacity 0.2s ease;
/* DISABLED - conflicts with global .mts-modal: }
/* DISABLED - conflicts with global .mts-modal: 
/* DISABLED - conflicts with global .mts-modal: .mts-modal.show {
/* DISABLED - conflicts with global .mts-modal:     opacity: 1;
/* DISABLED - conflicts with global .mts-modal: }

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.clickable {
    cursor: pointer;
}

.modal-dialog {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-small {
    width: 400px;
    max-width: 90vw;
}

.modal-medium {
    width: 600px;
    max-width: 90vw;
}

.modal-large {
    width: 900px;
    max-width: 90vw;
}

.modal-full {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--mts-gray-500, #6b7280);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--mts-gray-100, #f3f4f6);
    color: var(--mts-gray-700, #374151);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--mts-gray-200, #e5e7eb);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Data Table */
.data-table-wrapper {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    overflow: hidden;
}

.data-table-info {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--mts-gray-600, #6b7280);
}

.selected-info {
    color: var(--mts-primary-color, #4A90E2);
    font-weight: 500;
}

.data-table-scroll {
    overflow-x: auto;
}

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

.data-table thead {
    background: var(--mts-gray-50, #f9fafb);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--mts-gray-700, #374151);
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: var(--mts-gray-100, #f3f4f6);
}

.data-table th.sorted {
    color: var(--mts-primary-color, #4A90E2);
}

.sort-icon {
    margin-left: 0.5rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

.data-table tbody tr.clickable:hover {
    background: var(--mts-gray-50, #f9fafb);
}

.data-table tbody tr.selected {
    background: var(--mts-primary-light, #E3F2FD);
}

.data-table .select-column {
    width: 40px;
    text-align: center;
}

.data-table .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--mts-gray-500, #6b7280);
}

.data-table-pagination {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--mts-gray-200, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--mts-gray-600, #6b7280);
}

/* Status Chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

.status-chip-success {
    background: #d1fae5;
    color: #065f46;
}

.status-chip-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-chip-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-chip-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-chip-secondary {
    background: var(--mts-gray-200, #e5e7eb);
    color: var(--mts-gray-700, #374151);
}

.status-icon {
    font-size: 1em;
}

/* ==================== EQUIPMENT & FLEET SPECIFIC ==================== */

/* Toolbar */
.mts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
}

.mts-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mts-toolbar-left h1 {
    margin: 0;
    font-size: 1.5rem;
}

.mts-toolbar-right {
    display: flex;
    gap: 0.75rem;
}

/* Filter Chips */
.type-chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.type-chip {
    padding: 0.5rem 1rem;
    border: 2px solid var(--mts-gray-300, #d1d5db);
    border-radius: 9999px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.type-chip:hover {
    border-color: var(--mts-primary-color, #4A90E2);
    background: var(--mts-primary-light, #E3F2FD);
}

.type-chip.active {
    border-color: var(--mts-primary-color, #4A90E2);
    background: var(--mts-primary-color, #4A90E2);
    color: white;
}

.chip-label {
    font-weight: 500;
}

.chip-count {
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* QR Code Display */
.qr-code-container {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
}

.qr-code-container canvas {
    margin: 0 auto;
}

/* Vehicle/Equipment Cards */
.item-card {
    background: white;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: var(--mts-primary-color, #4A90E2);
}

.item-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.item-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.item-card-subtitle {
    font-size: 0.875rem;
    color: var(--mts-gray-600, #6b7280);
}

.item-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.item-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-detail-label {
    font-size: 0.75rem;
    color: var(--mts-gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-detail-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* DVIR Checklist */
.dvir-checklist {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dvir-section {
    background: white;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
}

.dvir-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--mts-gray-900, #111827);
}

.dvir-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dvir-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--mts-gray-50, #f9fafb);
    border-radius: 4px;
}

.dvir-item-label {
    font-weight: 500;
}

.dvir-item-controls {
    display: flex;
    gap: 0.5rem;
}

.dvir-radio-group {
    display: flex;
    gap: 1rem;
}

.dvir-radio {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .mts-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .mts-toolbar-left,
    .mts-toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .item-card-body {
        grid-template-columns: 1fr;
    }

    .data-table-pagination {
        flex-direction: column;
        gap: 1rem;
    }
}
