/* Task Screen Specific Styles - Cosmic Theme */

.task-screen-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Task Detail View */
.task-detail-container {
  background: rgba(30, 30, 60, 0.95);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a6a;
  backdrop-filter: blur(10px);
}

.task-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(127, 95, 255, 0.3);
}

.task-detail-title-section {
  flex: 1;
}

.task-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(45deg, #fff, #7f5fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.task-detail-description {
  color: #e8e8ff;
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
}

.task-detail-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.task-detail-btn {
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.task-detail-btn.edit {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.task-detail-btn.edit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.task-detail-btn.delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.task-detail-btn.delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.task-detail-btn.back {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.task-detail-btn.back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Task Info Sections */
.task-detail-content {
  margin-top: 20px;
}

.task-info-section {
  margin-bottom: 30px;
}

.task-info-section h3 {
  color: #e8e8ff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(127, 95, 255, 0.3);
}

.task-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.task-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-info-item label {
  color: #a8a8b3;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-info-item span {
  color: #e8e8ff;
  font-size: 1rem;
  font-weight: 500;
}

.task-status.completed {
  color: #28a745;
  font-weight: 600;
}

.task-status.incomplete {
  color: #ffc107;
  font-weight: 600;
}

.task-priority {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

.task-priority.priority-high {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.task-priority.priority-medium {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.task-priority.priority-low {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.task-priority.priority-none {
  background-color: #e2e3e5;
  color: #383d41;
  border: 1px solid #d6d8db;
}

.task-project {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.no-project, .no-scheduled-at, .no-recurrence {
  color: #a8a8b3;
  font-style: italic;
}

.task-scheduled-at, .task-created-at, .task-completed-at {
  color: #e8e8ff;
  font-weight: 500;
}

.task-recurrence {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid #5a6fd8;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-recurrence-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recurrence-days {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.recurrence-days-label {
  color: #a8a8b3;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recurrence-days-list {
  color: #e8e8ff;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.recurrence-details {
  margin-top: 8px;
}

.recurrence-detail-text {
  color: #e8e8ff;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  display: inline-block;
}

/* Subtasks */
.subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.no-subtasks {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-style: italic;
}

.add-subtask-section {
  margin-top: 15px;
}

.add-subtask-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-subtask-form .subtask-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 0.9rem;
}

.add-subtask-form .subtask-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.add-subtask-form .add-subtask-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.add-subtask-form .add-subtask-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.subtask-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.subtask-item.completed {
  opacity: 0.6;
}

.subtask-item.completed .subtask-title {
  text-decoration: line-through;
}

.subtask-checkbox {
  display: flex;
  align-items: center;
}

.subtask-checkbox-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.subtask-title {
  flex: 1;
  color: #ffffff;
  font-size: 0.9rem;
}

.remove-subtask-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.subtask-item:hover .remove-subtask-btn {
  opacity: 1;
}

.remove-subtask-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.remove-subtask-icon {
  font-size: 14px;
  font-weight: bold;
}

/* Form Container */
.task-form-container {
  background: rgba(30, 30, 60, 0.95);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a6a;
  backdrop-filter: blur(10px);
}

.task-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(127, 95, 255, 0.3);
}

.task-form-header-title {
  background: linear-gradient(45deg, #fff, #7f5fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Form Fields */
.task-form-field {
  margin-bottom: 24px;
}

.task-form-field label {
  display: block;
  font-weight: 600;
  color: #e8e8ff;
  margin-bottom: 8px;
  font-size: 1rem;
}

.task-form-field input[type="text"],
.task-form-field input[type="date"],
.task-form-field input[type="number"],
.task-form-field textarea,
.task-form-field select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #3a3a6a;
  border-radius: 8px;
  background: rgba(20, 20, 40, 0.8);
  color: #e8e8ff;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.task-form-field input[type="text"]:focus,
.task-form-field input[type="date"]:focus,
.task-form-field input[type="number"]:focus,
.task-form-field textarea:focus,
.task-form-field select:focus {
  outline: none;
  border-color: #7f5fff;
  box-shadow: 0 0 0 3px rgba(127, 95, 255, 0.2);
  background: rgba(20, 20, 40, 0.9);
}

.task-form-field input[type="text"]::placeholder,
.task-form-field textarea::placeholder {
  color: #888;
}

.task-form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.task-form-error {
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-top: 4px;
  font-weight: 500;
}

.character-counter {
  text-align: right;
  font-size: 0.8rem;
  color: #a8a8b3;
  margin-top: 4px;
  font-weight: 500;
}

/* Form Grid Layout */
.task-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .task-form-row {
    grid-template-columns: 1fr;
  }
}

/* Project Selection */
.project-selection {
  display: flex;
  gap: 12px;
  align-items: end;
}

.project-select {
  flex: 1;
}

.new-project-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.new-project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  color: white;
  text-decoration: none;
}

/* Form Actions */
.task-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid rgba(127, 95, 255, 0.3);
}

.task-form-cancel {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.task-form-cancel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
  color: white;
  text-decoration: none;
}

.task-form-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.task-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Priority dot styling */
.task-priority-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.task-priority-dot.priority-none {
  background-color: #6c757d;
  border-color: #5a6268;
}

.task-priority-dot.priority-high {
  background-color: #dc3545;
  border-color: #c82333;
}

.task-priority-dot.priority-medium {
  background-color: #ffc107;
  border-color: #e0a800;
}

.task-priority-dot.priority-low {
  background-color: #28a745;
  border-color: #1e7e34;
}

/* Task Detail Action Buttons */
.task-detail-btn.complete {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: 1px solid #1e7e34;
}

.task-detail-btn.complete:hover {
  background: linear-gradient(135deg, #218838, #1ea085);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.task-detail-btn.incomplete {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  border: 1px solid #545b62;
}

.task-detail-btn.incomplete:hover {
  background: linear-gradient(135deg, #5a6268, #495057);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Inline form styles */
.inline-form {
  display: inline-block;
  margin: 0;
}

.inline-form input[type="submit"] {
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  height: auto;
  line-height: 1.2;
}

/* Responsive Design */
@media (max-width: 768px) {
  .task-detail-header {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .task-detail-actions {
    justify-content: center;
  }
  
  .task-info-grid {
    grid-template-columns: 1fr;
  }
  
  .task-form-actions {
    flex-direction: column;
  }
  
  .task-form-cancel,
  .task-form-submit {
    width: 100%;
    text-align: center;
  }
}

/* Reschedule buttons */
.reschedule-buttons {
  display: flex;
  gap: 0px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  width: fit-content;
}

.reschedule-form {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.reschedule-btn {
  background: linear-gradient(135deg, #42a5f5 0%, #1976d2 100%) !important;
  color: white !important;
  border: none !important;
  padding: 1px 2px !important;
  border-radius: 0px !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 150px !important;
  height: 22px !important;
  line-height: 1 !important;
}

/* More specific selectors to override any existing button styles */
.tasks-table .reschedule-btn,
.task-reschedule-cell .reschedule-btn,
.reschedule-buttons .reschedule-btn {
  border-radius: 0px !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.reschedule-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(66, 165, 245, 0.3);
}

.reschedule-btn.today-btn {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.reschedule-btn.tomorrow-btn {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.reschedule-btn.unschedule-btn {
  background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
}

.reschedule-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.reschedule-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Reschedule column width - Force narrow width */
.task-reschedule-cell {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  padding: 0px !important;
  text-align: center !important;
  position: relative !important;
  overflow: visible !important;
}

/* Center reschedule buttons in the column */
.reschedule-buttons {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* Force table to respect narrow column */
.tasks-table .col-reschedule {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
}

/* Override any table layout that might force wider columns */
.tasks-table {
  table-layout: fixed !important;
}


/* NUCLEAR OPTION: Force reschedule column to be tiny and center buttons */
.tasks-table .task-reschedule-cell {
  width: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.tasks-table .task-reschedule-cell .reschedule-buttons {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
}

.tasks-table .task-reschedule-cell .reschedule-btn {
  display: inline-block !important;
  width: 12px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0.7rem !important;
  line-height: 1 !important;
  text-align: center !important;
  vertical-align: middle !important;
}
