/* Work Orders Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Main Work Orders Content */
.work-orders-main {
    flex: 1;
    padding: 0;
    margin-top: var(--header-height, 64px);
}

.work-orders-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Work Orders Header */
.work-orders-header {
    margin-bottom: 2rem;
}

.work-orders-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.work-orders-title i {
    color: #3b82f6;
    font-size: 1.75rem;
}

.work-orders-subtitle {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.5;
}

/* Work Orders Toolbar */
.work-orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

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

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-container {
    position: relative;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.875rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    min-width: 140px;
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Work Orders Stats */
.work-orders-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1), 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Work Orders Table */
.work-orders-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.work-orders-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    white-space: nowrap;
}

.work-orders-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.work-orders-table th.sortable:hover {
    background: #f1f5f9;
}

.work-orders-table th.sortable i {
    margin-left: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.work-orders-table th.sortable:hover i {
    opacity: 1;
}

.work-orders-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    font-size: 0.875rem;
}

.work-orders-table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.work-orders-table tbody tr:hover {
    background: #f8fafc;
}

.work-orders-table tbody tr:last-child td {
    border-bottom: none;
}

/* Work Order Table Cells */
.wo-number {
    font-weight: 600;
    color: #3b82f6;
}

.aircraft-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.aircraft-tail {
    font-weight: 600;
    color: #111827;
}

.aircraft-type {
    font-size: 0.75rem;
    color: #6b7280;
}

.wo-description {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.open {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.in-progress {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.completed {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.on-hold {
    background: #f3f4f6;
    color: #6b7280;
}

/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-badge.high {
    background: #fecaca;
    color: #dc2626;
}

.priority-badge.medium {
    background: #fed7aa;
    color: #ea580c;
}

.priority-badge.low {
    background: #bbf7d0;
    color: #16a34a;
}

/* Actions Column */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.action-btn:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.action-btn.view {
    color: #3b82f6;
}

.action-btn.edit {
    color: #f59e0b;
}

.action-btn.delete {
    color: #ef4444;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-number:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-number.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 3% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button Styles */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn.danger {
    background: #ef4444;
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .work-orders-container {
        padding: 1.5rem;
    }
    
    .work-orders-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .toolbar-left {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-container {
        min-width: unset;
    }
    
    .filters-group {
        flex-wrap: wrap;
    }
    
    .work-orders-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .work-orders-container {
        padding: 1rem;
    }
    
    .work-orders-title {
        font-size: 1.75rem;
        text-align: center;
    }
    
    .work-orders-toolbar {
        padding: 1rem;
    }
    
    .toolbar-right {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .work-orders-table-container {
        overflow-x: auto;
    }
    
    .work-orders-table {
        min-width: 800px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .work-orders-container {
        padding: 0.75rem;
    }
    
    .work-orders-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .work-orders-toolbar {
        padding: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 80vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Print Styles */
@media print {
    .work-orders-main {
        margin-top: 0;
    }
    
    .work-orders-toolbar,
    .work-orders-stats,
    .pagination-container {
        display: none;
    }
    
    .work-orders-table-container {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .modal {
        display: none !important;
    }
    
    .actions-cell {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .work-orders-table-container,
    .work-orders-toolbar,
    .stat-item {
        border: 2px solid #000000;
    }
    
    .btn.primary {
        background: #000000;
        color: #ffffff;
    }
    
    .status-badge,
    .priority-badge {
        border: 1px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .action-btn,
    .stat-item,
    .work-orders-table tbody tr {
        transition: none;
    }
    
    .modal-content {
        animation: none;
    }
    
    .btn.primary:hover,
    .btn.danger:hover {
        transform: none;
    }
} 