/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

/* Header styling */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

header button {
    margin: 0 10px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
}

header #weekRange {
    font-size: 1.2em;
    font-weight: bold;
}

/* Menu styling */
nav {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

nav button {
    margin: 0 5px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
}

nav button.active {
    background-color: #3498db;
    color: white;
    border: none;
}

/* Schedule grid styling */
#scheduleGridContainer {
    overflow-x: auto;
    /* Enable horizontal scrolling on smaller screens */
}

#scheduleGrid {
    position: relative;
    display: grid;
    gap: 0;
    border: 1px solid #ccc;
}

/* Grid headers */
.grid-header {
    background-color: #2c3e50;
    color: #ecf0f1;
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    padding: 15px 5px;
    font-weight: bold;
    position: sticky;
    top: 0;
    /* Keep headers visible when scrolling */
    z-index: 2;
}

.work-center-label {
    grid-column: 1 / 2; /* Ensure label stays in the leftmost column */
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #34495e;
    color: #ecf0f1;
    font-weight: bold;
    text-align: center;
    padding: 15px 5px;
    border-bottom: 1px solid #ccc;
    height: auto; /* Ensures the label spans the full height of the row */
    display: flex;
    align-items: center; /* Center text vertically */
  }

/* Grid Cells */
.grid-cell {
    height: auto;
    position: relative;
    min-height: 10px; /* Base minimum height */
    border: 1px solid #ddd;
    overflow: visible;
    transition: min-height 0.3s ease; /* Smooth transition for height changes */
}

.grid-cell.drag-over {
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
    box-shadow: inset 0 0 5px rgba(0, 123, 255, 0.2);
}

/* Hour Headers */
.grid-hour-header {
    /* Existing styles */
    background-color: #34495e;
    color: #ecf0f1;
    text-align: center;
    padding: 10px 5px;
    font-weight: normal;
    position: sticky;
    top: 40px;
    z-index: 2;
    border-right: 1px solid #ccc;
    border-left: 1px solid #ccc;
    min-width: 50px; /* Minimum width for hour columns */
    /* Add left border */
}

.job-block {
    position: absolute;
    height: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px;
    font-size: 12px;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Use transform instead of top/left */
    will-change: transform, opacity; /* Hint to the browser for optimization */
}

/* Styles for jobs that are InProcess */
.job-block.status-in-process {
    border: 2px dashed #f1c40f; /* Yellow border */
    /* Optionally, add an icon or change the background color */
}

/* Styles for jobs that are PartiallyReported */
.job-block.status-partially-reported {
    border: 2px dashed #e67e22; /* Orange dashed border */
    /* Optionally, add an icon or change the background color */
}
/* Status icon styles */
.status-icon {
    position: absolute;
    left: 4px;
    font-size: 12px;
    color: #fff; /* Adjust as needed */
}

.job-block .fa-spinner {
    color: #3498db; /* Blue for InProcess */
}

.job-block .fa-exclamation-circle {
    color: #e67e22; /* Orange for PartiallyReported */
}


/* Specific styles for hour view */
.hour-view .job-block {
    min-width: calc(100% - 4px);
}

/* Specific styles for day view */
.day-view .job-block {
    width: calc(100% - 4px);
}

/* Hover effects */
.job-block:hover {
    background-color: #2980b9;
}

/* Styles specific to the day view */
.day-view .grid-header {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 15px 5px;
    font-weight: bold;
    border-right: 1px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .day-view .work-center-label {
  grid-column: 1 / 2; /* Make sure it only occupies the leftmost column */
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #34495e; /* Keep the background color consistent */
  color: #ecf0f1;
  font-weight: bold;
  text-align: center;
  padding: 15px 5px;
  border-bottom: 1px solid #ccc;
}
  .day-view .grid-cell {
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    position: relative;
  }
  
  .day-view .job-block {
    background-color: #3498db;
    color: white;
    text-align: center;
    padding: 5px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-size: 0.8em;
    border-radius: 3px;
    height: 100%; /* Fill the cell vertically */
  }

  .day-view .work-center-label {
    grid-column: 1 / 2; /* Make sure it only occupies the leftmost column */
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #34495e; /* Keep the background color consistent */
    color: #ecf0f1;
    font-weight: bold;
    text-align: center;
    padding: 15px 5px;
    border-bottom: 1px solid #ccc;
  }

/* Job list styling */
#jobList {
    margin-top: 30px;
}

#jobList h2 {
    margin-bottom: 10px;
}

#jobList ul {
    list-style-type: none;
}

#jobList li {
    padding: 5px 0;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    header {
        flex-direction: column;
    }

    header button {
        margin: 5px 0;
    }

    #scheduleGrid {
        min-width: 600px;
    }
}

.current-time-line {
    position: absolute;
    background-color: red;
    width: 2px;
    z-index: 3;
    pointer-events: none;
    /* Adjust positioning to stay within grid content */
    top: 60px; /* Height of the header rows */
    bottom: 0;
}

#availableJobsContainer {
    margin-top: 20px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.available-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
}

.available-job-card {
    cursor: grab;
    padding: 0; /* Remove padding to accommodate the indicator */
    margin: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex; /* Use flexbox for layout */
    overflow: hidden; /* Ensure indicator stays within bounds */
}

.job-type-indicator {
    width: 6px;
    flex-shrink: 0; /* Prevent the indicator from shrinking */
}

.job-card-content {
    padding: 10px;
    flex-grow: 1; /* Allow content to take remaining space */
}

.available-job-card:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.available-job-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Optional: Style the text content */
.job-card-content h4 {
    margin: 0 0 8px 0;
}

.job-card-content p {
    margin: 4px 0;
    font-size: 0.9em;
    color: #666;
}

.dependency-arrows {
    z-index: 1;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
}

.dependency-arrow {
    fill: none;
    stroke: #666;
    stroke-width: 2px;
    stroke-dasharray: 4 2;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -6;
    }
}

.version-number {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1000;
}


.job-block:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

.job-content {
    display: flex;
    flex-direction: column;
    height: 20px;
}

.job-title {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-details {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Data source dropdown styling */
.data-source-dropdown {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    z-index: 3;
    cursor: pointer;
}

.data-source-dropdown:hover {
    border-color: #999;
}

.data-source-dropdown:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Minute View Headers */
.schedule-grid.minute-view .corner-header {
    background-color: #2c3e50;
    border-right: 1px solid #fff;
}

.schedule-grid.minute-view .date-header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 5px;
    height: 30px;
    text-align: center;
    font-weight: bold;
    z-index: 3;
}

.schedule-grid.minute-view .hour-header {
    background-color: #34495e;
    color: #ecf0f1;
    padding: 2px;
    height: 25px;
    text-align: center;
    z-index: 2;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.schedule-grid.minute-view .minute-header {
    background-color: #95a5a6;
    color: #ecf0f1;
    padding: 1px;
    height: 20px;
    font-size: 0.8em;
    text-align: center;
    z-index: 1;
}

/* Minute View Cells */
.schedule-grid.minute-view .minute-view-cell {
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    min-width: 30px;
    height: 60px; /* Adjust as needed */
    position: relative;
}

/* Job Blocks in Minute View */
.schedule-grid.minute-view .job-block {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.schedule-grid.minute-view .job-block .job-type-indicator {
    width: 6px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.schedule-grid.minute-view {
    overflow-x: auto;
}

.schedule-grid.minute-view .hour-header {
    background-color: #34495e;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

.schedule-grid.minute-view .minute-header {
    background-color: #2c3e50;
    font-size: 0.8em;
    padding: 2px;
}

/* Add vertical lines between hours */
.schedule-grid.minute-view .grid-cell[data-minute="0"] {
    border-left: 2px solid #34495e;
}

/* Highlight every 5 minutes */
.schedule-grid.minute-view .grid-cell[data-minute="0"],
.schedule-grid.minute-view .grid-cell[data-minute="5"],
.schedule-grid.minute-view .grid-cell[data-minute="10"],
.schedule-grid.minute-view .grid-cell[data-minute="15"],
.schedule-grid.minute-view .grid-cell[data-minute="20"],
.schedule-grid.minute-view .grid-cell[data-minute="25"],
.schedule-grid.minute-view .grid-cell[data-minute="30"],
.schedule-grid.minute-view .grid-cell[data-minute="35"],
.schedule-grid.minute-view .grid-cell[data-minute="40"],
.schedule-grid.minute-view .grid-cell[data-minute="45"],
.schedule-grid.minute-view .grid-cell[data-minute="50"],
.schedule-grid.minute-view .grid-cell[data-minute="55"] {
    border-left: 1px solid #ccc;
}

/* Specific styling for minute view */
.schedule-grid.minute-view .job-block {
    height: calc(60% - 4px); /* Full height of cell minus small gap */
    margin: 2px 0; /* Add small gap top and bottom */
    font-size: 10px; /* Slightly smaller font for minute view */
    padding: 2px 6px; /* Smaller padding for minute view */
}

/* Adjust content spacing for minute view */
.schedule-grid.minute-view .job-content {
    margin-left: 6px;
    justify-content: center;
}

/* Adjust type indicator for minute view */
.schedule-grid.minute-view .job-type-indicator {
    width: 3px; /* Slightly smaller indicator for minute view */
}

/* In styles.css */
.work-center-filter {
    width: 200px;
    height: 100px; /* Adjust height to show multiple options */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
    margin-left: 10px; /* Adjust spacing as needed */
}

.work-center-filter:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Fetch Data Button Styling */
.fetch-data-btn {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #2ecc71; /* Green background */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.fetch-data-btn:hover {
    background-color: #27ae60; /* Darker green on hover */
}

.fetch-data-btn:active {
    background-color: #1e8449; /* Even darker green on click */
}

/* Last Fetch Label Styling */
.last-fetch-label {
    margin-left: 15px;
    font-size: 0.9em;
    color: #34495e; /* Dark gray color */
    vertical-align: middle;
}

@media screen and (max-width: 600px) {
    .fetch-data-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .last-fetch-label {
        display: block;
        margin-left: 0;
    }
}

/* Custom Dropdown Container */
.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 200px; /* Adjust width as needed */
}

/* Dropdown Button */
.dropdown-button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    text-align: left;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-button:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}

/* Dropdown List */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px; /* Adjust as needed */
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none; /* Hidden by default */
}

/* Show Dropdown List */
.custom-dropdown.open .dropdown-list {
    display: block;
}

/* Dropdown Options */
.dropdown-list label {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
}

.dropdown-list label:hover {
    background-color: #f1f1f1;
}

/* Checkbox Styling */
.dropdown-list input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

/* Scrollbar Styling (Optional) */
.dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Selected Work Centers Display */
#selectedWorkCenters {
    margin-top: 10px;
    font-size: 14px;
    color: #34495e;
}

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
    .custom-dropdown {
        width: 100%;
    }
}
/* Modal Container */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
  }
  
  /* Modal Content Box */
  .modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 8px;
    position: relative;
  }
  
  /* Close Button */
  .close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  
  .close-button:hover,
  .close-button:focus {
    color: black;
    text-decoration: none;
  }
  
  /* Modal Body */
  #modalBody {
    margin-top: 10px;
  }
  
  #modalBody p {
    margin: 10px 0;
    font-size: 1em;
  }
  
  /* Link Styling */
  .modal-body a {
    color: #3498db;
    text-decoration: none;
  }
  
  .modal-body a:hover {
    text-decoration: underline;
  }

  /* styles.css */

/* Difference Table Styling */
#diffTableContainer {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#diffTableContainer h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#diffTable {
    width: 100%;
    border-collapse: collapse;
}

#diffTable th, #diffTable td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
    font-size: 0.9em;
}

#diffTable th {
    background-color: #34495e;
    color: #ecf0f1;
}

#diffTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

#diffTable tr:hover {
    background-color: #ddd;
}
