/**
 * Edit Panel Styles - Slide-out panel for editing Tasks and Problems
 */

.edit-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.edit-panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

.edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  max-width: 900px;
  height: 100vh;
  background: linear-gradient(145deg, #1a2744 0%, #0d1625 100%);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
}

.edit-panel.active {
  transform: translateX(0);
}

.edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.edit-panel-title svg {
  width: 24px;
  height: 24px;
  color: #65a70b;
}

.edit-panel-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 8px;
  font-size: 13px;
  color: #eab308;
  margin-left: 20px;
  flex-shrink: 1;
}

.edit-panel-close {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.edit-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.edit-panel-close svg {
  width: 20px;
  height: 20px;
}

.edit-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.edit-section {
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

.edit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.edit-section-title svg {
  width: 20px;
  height: 20px;
  color: #65a70b;
}

.edit-section-title.problems svg {
  color: #dc2626;
}

.edit-section-title.status-update svg {
  color: #3b82f6;
}

/* Status Update View Toggle (Compact/Expanded) */
.status-update-view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  width: fit-content;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.view-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.view-toggle-btn.active svg {
  opacity: 1;
}

/* Add Toggle Button */
.edit-add-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: linear-gradient(145deg, #65a70b, #4d8a08);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.edit-add-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(101, 167, 11, 0.4);
}

.edit-add-toggle.active {
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.2);
}

.edit-add-toggle.problem {
  background: linear-gradient(145deg, #dc2626, #b91c1c);
}

.edit-add-toggle.problem:hover {
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.edit-add-toggle.problem.active {
  background: rgba(255, 255, 255, 0.2);
}

.edit-add-toggle.status-update {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.edit-add-toggle.status-update:hover {
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.edit-add-toggle.status-update.active {
  background: rgba(255, 255, 255, 0.2);
}

.edit-add-toggle svg {
  width: 20px;
  height: 20px;
}

/* Collapsible Form Wrapper */
.edit-add-form-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out;
  opacity: 0;
  margin-bottom: 0;
}

.edit-add-form-wrapper.open {
  max-height: 600px;
  opacity: 1;
  margin-bottom: 20px;
}

.edit-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.edit-cancel-button {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-cancel-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.edit-add-form {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  box-sizing: border-box;
}

.edit-input:focus {
  outline: none;
  border-color: #65a70b;
}

.edit-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.edit-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.edit-textarea:focus {
  outline: none;
  border-color: #65a70b;
}

.edit-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.edit-add-button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(145deg, #65a70b, #4d8a08);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-add-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(101, 167, 11, 0.3);
}

.edit-add-button.problem {
  background: linear-gradient(145deg, #dc2626, #b91c1c);
}

.edit-add-button.problem:hover {
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.edit-add-button.status-update {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.edit-add-button.status-update:hover {
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.edit-add-button svg {
  width: 16px;
  height: 16px;
}

.edit-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.edit-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.edit-item.problem {
  border-left: 3px solid #dc2626;
}

.edit-item.problem.closed {
  border-left-color: #22c55e;
  opacity: 0.6;
}

.edit-item.status-update {
  border-left: 3px solid #3b82f6;
}

.edit-item-order.status-update {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.edit-item-description-text {
  font-size: 14px;
  color: #fff;
  line-height: 1.5;
}

.edit-item-description-text.expanded {
  white-space: pre-wrap;
  word-break: break-word;
}

.edit-item-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
}

.edit-item.status-update .edit-item-content.clickable:hover {
  background: rgba(59, 130, 246, 0.15);
}

.edit-item.status-update .edit-item-content.clickable:hover .edit-item-description-text {
  color: #60a5fa;
}

.edit-item-order {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: rgba(238, 51, 37, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #ee3325;
}

.edit-item-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-item-checkbox:hover {
  border-color: #65a70b;
}

.edit-item-checkbox.checked {
  background: #22c55e;
  border-color: #22c55e;
}

.edit-item-checkbox svg {
  width: 14px;
  height: 14px;
  color: #fff;
  display: none;
}

.edit-item-checkbox.checked svg {
  display: block;
}

.edit-item-status-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-item-status-icon svg {
  width: 18px;
  height: 18px;
  color: #eab308;
}

.edit-item.closed .edit-item-status-icon svg {
  color: #22c55e;
}

.edit-item-content {
  flex: 1;
  min-width: 0;
}

.edit-item-content.clickable {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.edit-item-content.clickable:hover {
  background: rgba(101, 167, 11, 0.15);
}

.edit-item-content.clickable:hover .edit-item-title {
  color: #65a70b;
}

.edit-item.problem .edit-item-content.clickable:hover {
  background: rgba(220, 38, 38, 0.15);
}

.edit-item.problem .edit-item-content.clickable:hover .edit-item-title {
  color: #dc2626;
}

.edit-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  line-height: 1.4;
}

.edit-item-title.completed {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.5);
}

.edit-item-description {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  line-height: 1.4;
}

.edit-item-toggle-status {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-item-toggle-status:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.edit-item-delete {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 38, 38, 0.6);
  transition: all 0.2s ease;
}

.edit-item-delete:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

.edit-item-delete svg {
  width: 16px;
  height: 16px;
}

.edit-panel-loading {
  padding: 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.edit-panel-empty {
  padding: 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.edit-panel-error {
  padding: 30px;
  text-align: center;
  color: #dc2626;
  font-size: 14px;
}

@media (max-width: 768px) {
  .edit-panel {
    width: 100%;
    max-width: 100%;
  }
}

/* Edit Button - Language Detail Page */
.edit-language-btn {
  display: none; /* Hidden by default, shown via JS when logged in */
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(145deg, #65a70b, #4d8a08);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-left: auto;
}

.edit-language-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(101, 167, 11, 0.4);
}

.edit-language-btn svg {
  width: 16px;
  height: 16px;
}

.edit-language-btn.visible {
  display: inline-flex;
}

/* Custom Confirmation Modal */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal {
  background: linear-gradient(145deg, #1e2d4a 0%, #0f1a2e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s ease;
}

.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1) translateY(0);
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: rgba(220, 38, 38, 0.15);
}

.confirm-modal-icon svg {
  width: 28px;
  height: 28px;
  color: #dc2626;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin: 0 0 10px;
}

.confirm-modal-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-modal-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 100px;
}

.confirm-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.confirm-modal-btn.confirm {
  background: linear-gradient(145deg, #dc2626, #b91c1c);
  color: white;
}

.confirm-modal-btn.confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

/* Toast Notification */
.edit-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(145deg, #1e2d4a 0%, #0f1a2e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 400px;
}

.edit-toast.active {
  transform: translateY(0);
  opacity: 1;
}

.edit-toast.error {
  border-left: 3px solid #dc2626;
}

.edit-toast.success {
  border-left: 3px solid #22c55e;
}

.edit-toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.edit-toast-icon svg {
  width: 24px;
  height: 24px;
}

.edit-toast.error .edit-toast-icon svg {
  color: #dc2626;
}

.edit-toast.success .edit-toast-icon svg {
  color: #22c55e;
}

.edit-toast-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
  line-height: 1.4;
}

.edit-toast-close {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.edit-toast-close:hover {
  opacity: 1;
}

.edit-toast-close svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   SENTIMENT SECTION STYLES
   ============================================ */

.sentiment-section {
  background: linear-gradient(135deg, rgba(101, 167, 11, 0.1) 0%, rgba(101, 167, 11, 0.02) 100%);
  border: 1px solid rgba(101, 167, 11, 0.3);
  border-radius: 12px;
  margin-bottom: 24px;
}

.edit-section-title.sentiment {
  color: #65a70b;
}

.edit-section-title.sentiment svg {
  color: #65a70b;
}

.sentiment-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 20px;
  flex-wrap: wrap;
}

.sentiment-language-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  min-width: 150px;
}

.sentiment-select {
  flex: 1;
  min-width: 250px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.sentiment-select:hover {
  border-color: rgba(101, 167, 11, 0.5);
}

.sentiment-select:focus {
  outline: none;
  border-color: #65a70b;
  box-shadow: 0 0 0 3px rgba(101, 167, 11, 0.2);
}

.sentiment-select option {
  background: #1a2744;
  color: white;
  padding: 12px;
}

.sentiment-save-status {
  font-size: 13px;
  font-weight: 500;
  min-width: 70px;
  text-align: center;
}

.sentiment-save-status.saving {
  color: rgba(255, 255, 255, 0.6);
}

.sentiment-save-status.success {
  color: #22c55e;
}

.sentiment-save-status.error {
  color: #dc2626;
}
