/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f6f8;
    color: #333;
}

/* Container and Layout */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Login Card */
.login-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
/* Dashboard Header Layout */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Top Section with Welcome and Logout */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

#dashboardTitle {
    margin: 0;
    font-size: 1.5rem;
}

/* Action Buttons Section */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.logout-btn {
    padding: 8px 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .logout-btn {
        width: auto;
        align-self: flex-end;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
/* Multi-select styles */
select[multiple] {
    height: auto;
    min-height: 100px;
    padding: 8px;
}

select[multiple] option {
    padding: 5px;
    border-bottom: 1px solid #eee;
}

select[multiple] option:last-child {
    border-bottom: none;
}

/* Button Styles */
.login-btn,
.view-all-btn,
.action-btn,
.view-btn,
.delete-btn,
.reschedule-btn,
.upload-btn,
.logout-btn,
.submit-btn,
.save-btn,
.complete-btn,
.accept-btn,
.reject-btn,
.cancel-btn,
.analysis-btn,
.download-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn { background-color: #007bff; color: white; }
.view-all-btn { background-color: #28a745; color: white; }
.action-btn { background-color: #007bff; color: white; }
.view-btn { background-color: #28a745; color: white; }
.delete-btn { background-color: #dc3545; color: white; }
.reschedule-btn { background-color: #ffc107; color: #000; }
.submit-btn { background-color: #007bff; color: white; width: 100%; }
.save-btn { background-color: #28a745; color: white; }
.complete-btn { background-color: #17a2b8; color: white; }
.accept-btn { background-color: #28a745; color: white; }
.reject-btn { background-color: #dc3545; color: white; }
.cancel-btn { background-color: #6c757d; color: white; }
.logout-btn { background-color: #dc3545; color: white; }
.analysis-btn { background-color: #6610f2; color: white; }
.download-btn { background-color: #28a745; color: white; }

/* Button Hover States */
.login-btn:hover,
.view-all-btn:hover,
.action-btn:hover,
.view-btn:hover,
.delete-btn:hover,
.submit-btn:hover,
.save-btn:hover,
.complete-btn:hover,
.accept-btn:hover,
.reject-btn:hover,
.cancel-btn:hover,
.logout-btn:hover,
.analysis-btn:hover,
.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
.date-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-input-container label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .date-filter-group {
        flex-direction: column;
        width: 100%;
    }
    
    .date-input-container {
        width: 100%;
    }
    
    .date-filter {
        width: 100%;
    }
}
/* Dashboard Styles */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Job Sections */
.admin-job-sections,
.vendor-sections {
    margin-top: 20px;
}

.jobs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.job-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.job-card.delayed {
    border: 2px solid #dc3545;
}

.job-info {
    margin: 15px 0;
}

.job-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-section {
    margin: 20px 0;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* Status Colors */
.status-pending { color: #ffc107; }
.status-approved { color: #28a745; }
.status-rejected { color: #dc3545; }
.status-in-progress { color: #17a2b8; }
.status-completed { color: #28a745; }
.status-delayed { color: #dc3545; }

/* Worker name display */
.worker-name {
    color: #0056b3;
    font-weight: 600;
}

/* Order number field */
.form-group input[type="text"]#orderNumber {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Image Upload Styles */
.image-upload-container {
    margin: 15px 0;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-container {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Utility Classes */
.full-width { width: 100%; }
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}
.upload-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}


/* Notification Styles */
.loading-notification, .error-notification, .success-notification, .info-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease forwards;
    max-width: 300px;
    font-size: 14px;
}

.loading-notification {
    background-color: #f8f9fa;
    color: #495057;
    border-left: 5px solid #6c757d;
}

.error-notification {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.success-notification {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

.info-notification {
    background-color: #e2f0fd;
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.notification-exit {
    animation: slideOut 0.3s ease forwards;
}

/* Connection Status Indicator */
.connection-status {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
    z-index: 1000;
}

.connection-online {
    background-color: #28a745;
}

.connection-offline {
    background-color: #dc3545;
}

/* Last Sync Indicator */
.last-sync {
    position: fixed;
    bottom: 40px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    background-color: #f8f9fa;
    color: #6c757d;
    z-index: 1000;
}
/* Responsive Design */
@media (max-width: 1200px) {
    .jobs-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .jobs-list {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions button {
        width: 100%;
    }
}
/* Filter Styles */
.date-filter {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.status-filter {
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* Vendor Analysis Styles */
.vendor-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.vendor-analysis-content {
    padding: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.metric-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.metric-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.metric-value {
    font-size: 24px;
    color: #007bff;
    font-weight: bold;
}

/* Cable Metrics */
.cable-metrics {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 10px;
}

.cable-usage {
    font-weight: bold;
    color: #007bff;
    margin-top: 10px;
    text-align: center;
}

/* Map Link */
.map-link {
    color: #007bff;
    text-decoration: none;
}

.map-link:hover {
    text-decoration: underline;
}

.unit {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
}

/* Delay Warning Styles */
.delay-warning {
    color: #dc3545;
    font-weight: bold;
}

.delay-reason {
    color: #dc3545;
    font-style: italic;
    margin-top: 5px;
}

/* Credentials Display */
.credentials-display {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cred-section {
    margin: 15px 0;
}

.vendor-list {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.vendor-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
}

.vendor-name {
    font-weight: bold;
    color: #007bff;
}

/* Hide file input but keep it accessible */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Upload Button */
.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background-color: #5a6268;
}

/* Rejection Section */
.rejection-reason {
    color: #dc3545;
    font-style: italic;
    margin-top: 5px;
}
/* Updated Dashboard Header Styles */
.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#dashboardTitle {
    flex: 1;
    margin: 0;
    min-width: 200px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Filter Controls */
.status-filter {
    min-width: 150px;
    max-width: 200px;
}

.date-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.date-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 200px;
}

/* Button Group Styles */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* Responsive Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
    overflow-x: hidden;
}

/* Adjust heading sizes for better responsive behavior */
h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

/* Media Queries */
@media (max-width: 1200px) {
    .header-actions {
        justify-content: flex-start;
        width: 100%;
    }
    
    .date-filter-group {
        flex: 1;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .status-filter,
    .date-input-container,
    .view-all-btn,
    .analysis-btn,
    .download-btn,
    .logout-btn {
        width: 100%;
        max-width: none;
    }
    
    .date-filter-group {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Ensure buttons have consistent styling */
.view-all-btn,
.analysis-btn,
.download-btn,
.logout-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    min-width: 120px;
    white-space: nowrap;
}

/* Fix horizontal scrolling */
body {
    overflow-x: hidden;
}

/* Schedule New Job Section */
.admin-controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Jobs Grid */
.jobs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}
/* Print Styles */
@media print {
    .modal, .header-actions, .job-actions {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .job-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin: 10px 0;
        page-break-inside: avoid;
    }
}