/* Task Scheduler Plugin Styles */

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  line-height: 14px;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 3px;
}

/* Specialist type badges */
.specialist-analyst {
  background-color: #3498db;
}

.specialist-developer {
  background-color: #2ecc71;
}

.specialist-tester {
  background-color: #e74c3c;
}

.specialist-unknown {
  background-color: #95a5a6;
}

/* Work type badges */
.work-type-analysis {
  background-color: #3498db;
}

.work-type-development {
  background-color: #2ecc71;
}

.work-type-testing {
  background-color: #e74c3c;
}

.work-type-unknown {
  background-color: #95a5a6;
}

/* Utilization badges */
.utilization-low {
  background-color: #2ecc71;
}

.utilization-medium {
  background-color: #f39c12;
}

.utilization-high {
  background-color: #e74c3c;
}

/* Progress bars */
.progress-bar-container {
  width: 100px;
  height: 14px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.progress-success {
  background-color: #2ecc71;
}

.progress-warning {
  background-color: #f39c12;
}

.progress-danger {
  background-color: #e74c3c;
}

/* Tables */
.workload-summary,
.task-assignments {
  margin-top: 15px;
}

.workload-summary tr.overloaded {
  background-color: #ffe6e6;
}

.workload-summary tr.warning {
  background-color: #fff3cd;
}

/* Form styles */
.query-form fieldset {
  border: 1px solid #ccc;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 4px;
}

.query-form fieldset.task-scheduler-collapsible legend {
  cursor: pointer;
  user-select: none;
  padding: 5px 10px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-weight: bold;
}

.query-form fieldset.task-scheduler-collapsible legend:hover {
  background-color: #e9ecef;
}

.query-form fieldset.task-scheduler-collapsible legend.collapsed::after {
  content: " [+]";
}

.query-form fieldset.task-scheduler-collapsible legend:not(.collapsed)::after {
  content: " [-]";
}

/* Distribution parameters */
.distribution-parameters {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.distribution-parameters label {
  font-weight: bold;
  margin-right: 10px;
}

.distribution-parameters input[type="date"] {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.distribution-parameters .info {
  color: #6c757d;
  font-style: italic;
  font-size: 0.9em;
  margin-left: 10px;
}

/* Buttons */
.btn-preview {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-preview:hover {
  background-color: #545b62;
}

.btn-distribute {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 10px;
}

.btn-distribute:hover {
  background-color: #0056b3;
}

/* Settings tables */
.default-hours-table,
.group-mappings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
}

.default-hours-table th,
.default-hours-table td,
.group-mappings-table th,
.group-mappings-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
  vertical-align: top;
}

.default-hours-table th,
.group-mappings-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.group-select {
  width: 100%;
  min-width: 200px;
  padding: 5px;
}

input.small {
  width: 80px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Sidebar calendar icon */
.icon-calendar {
  background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzIDJIMTJWMUgxMVYySDVWMUg0VjJIM0MxLjkgMiAxIDIuOSAxIDRWMTRDMSAxNS4xIDEuOSAxNiAzIDE2SDEzQzE0LjEgMTYgMTUgMTUuMSAxNSAxNFY0QzE1IDIuOSAxNC4xIDIgMTMgMlpNMTMgMTRIM1Y3SDEzVjE0WiIgZmlsbD0iIzMzNzNkYyIvPgo8L3N2Zz4K);
  background-repeat: no-repeat;
  background-position: left center;
  padding-left: 18px;
}

/* ========================================
   iOS-style Resource Calendar Styles
   ======================================== */

/* Main calendar container */
.resource-calendar-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Calendar header */
.calendar-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 20px;
}

.calendar-nav-btn {
  background: #007AFF;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.calendar-nav-btn:hover {
  background: #0051D5;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.calendar-title {
  font-size: 28px;
  font-weight: 700;
  color: #1c1c1e;
  margin: 0;
  letter-spacing: -0.5px;
}

.calendar-info {
  display: flex;
  gap: 16px;
  align-items: center;
}

.info-item {
  background: rgba(120, 120, 128, 0.12);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #3c3c43;
}

/* Calendar scroll container */
.calendar-scroll-container {
  overflow-x: auto;
  background: #ffffff;
}

/* Header row styles */
.calendar-header-row {
  background: #f2f2f7;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.specialist-column-header {
  background: #f2f2f7;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  color: #1c1c1e;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  left: 0;
  z-index: 150;
}

.day-header {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #f2f2f7;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.day-header.weekend {
  background: #f0f0f5;
}

.day-header.today {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  color: white;
}

.day-number {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.day-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Main calendar grid */
.resource-calendar-grid {
  background: #ffffff;
}

/* Specialist rows */
.specialist-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: contents;
  transition: all 0.2s ease;
}

.specialist-row:hover .specialist-info {
  background: #f8f9fa;
}

/* Specialist info column */
.specialist-info {
  padding: 20px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  position: sticky;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background 0.2s ease;
}

.specialist-name {
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 4px;
  line-height: 1.2;
}

.specialist-type {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.specialist-type-analyst {
  background: rgba(52, 199, 89, 0.15);
  color: #34C759;
}

.specialist-type-developer {
  background: rgba(0, 122, 255, 0.15);
  color: #007AFF;
}

.specialist-type-tester {
  background: rgba(255, 149, 0, 0.15);
  color: #FF9500;
}

.specialist-stats {
  font-size: 11px;
  color: #8e8e93;
  font-weight: 500;
  line-height: 1.3;
}

/* Calendar days */
.specialist-calendar {
  display: contents;
}

.calendar-day {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  min-height: 60px;
  background: #ffffff;
  transition: background 0.1s ease;
}

.calendar-day.weekend {
  background: #fafafa;
}

.calendar-day.today {
  background: rgba(0, 122, 255, 0.02);
  border-left: 3px solid #007AFF;
}

.calendar-day:hover {
  background: rgba(0, 122, 255, 0.04);
}

/* Task blocks */
.task-block {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  top: calc(4px + var(--task-row, 0) * 25px);
  z-index: 10;
}

.task-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

/* Task types with iOS-like colors */
.task-analysis {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.task-development {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
}

.task-testing {
  background: linear-gradient(135deg, #FF9500 0%, #FFCC02 100%);
}

.task-unknown {
  background: linear-gradient(135deg, #8E8E93 0%, #AEAEB2 100%);
}

/* Multi-day task spanning */
.task-block[style*="--task-days"] {
  width: calc(var(--task-days) * 60px - 4px);
}

/* Task content */
.task-content {
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}

.task-title {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-details {
  font-size: 9px;
  opacity: 0.9;
  font-weight: 500;
}

.task-duration,
.task-hours {
  margin-right: 4px;
}

/* Form styles to match iOS theme */
.resource-calendar-form {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-calendar-update {
  background: #007AFF;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-calendar-update:hover {
  background: #0051D5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .calendar-navigation {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .calendar-title {
    font-size: 24px;
  }
  
  .specialist-info {
    padding: 16px 12px;
  }
  
  .specialist-name {
    font-size: 14px;
  }
  
  .day-header {
    padding: 8px 4px;
    min-height: 50px;
  }
  
  .day-number {
    font-size: 14px;
  }
  
  .day-name {
    font-size: 10px;
  }
}

/* Flash messages */
.flash.notice.distribution-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.flash.error.distribution-error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Responsive design */
@media (max-width: 768px) {
  .progress-bar-container {
    width: 80px;
  }
  
  .workload-summary,
  .task-assignments {
    font-size: 12px;
  }
  
  .badge {
    font-size: 10px;
    padding: 1px 4px;
  }
  
  .default-hours-table,
  .group-mappings-table {
    font-size: 12px;
  }
}

/* Table sorting styles */
.sortable-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

.sortable-table th.sortable:hover {
  background-color: #f8f9fa;
}

.sort-indicator {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #999;
}

.sortable-table th.sort-asc .sort-indicator::after {
  content: "↑";
  color: #333;
  font-weight: bold;
}

.sortable-table th.sort-desc .sort-indicator::after {
  content: "↓";
  color: #333;
  font-weight: bold;
}

.sortable-table th.sortable:not(.sort-asc):not(.sort-desc) .sort-indicator::after {
  content: "↕";
  color: #ccc;
}

/* Group dividers in sorted tables */
.sortable-table tbody tr.first-in-group {
  border-top: 2px solid #ccc;
}

.sortable-table tbody tr.last-in-group {
  border-bottom: 1px solid #ddd;
}
