/* Edit Dialog Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.modal-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e1e4e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f6f8fa;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #24292e;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6a737d;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e1e4e8;
  color: #24292e;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-control.error {
  border-color: #cf222e;
}

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(207, 34, 46, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: #ddf4ff;
  border: 1px solid #54aeff;
  border-radius: 6px;
  font-size: 13px;
  color: #0969da;
  margin-top: 20px;
}

.form-info i {
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e1e4e8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f6f8fa;
}

.btn {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  border-color: #d0d7de;
  color: #24292e;
}

.btn-secondary:hover {
  background: #f6f8fa;
  border-color: #afb8c1;
}

.btn-primary {
  background: #0969da;
  color: white;
}

.btn-primary:hover {
  background: #0860ca;
  box-shadow: 0 2px 8px rgba(9, 105, 218, 0.3);
}

.btn-primary:disabled {
  background: #6e7781;
  cursor: not-allowed;
  transform: none;
}

/* Modal Dialog Large (for Chart Sets) */
.modal-dialog-large {
  max-width: 700px;
}

/* Chart Set Charts List */
.chart-set-charts-list {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
  background: #f6f8fa;
}

.chart-set-chart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: white;
  border-bottom: 1px solid #d0d7de;
  transition: background 0.2s;
}

.chart-set-chart-item:last-child {
  border-bottom: none;
}

.chart-set-chart-item:hover {
  background: #f6f8fa;
}

.chart-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chart-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.chart-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #24292e;
  flex: 1;
  margin-right: 16px;
}

.chart-item-type {
  font-size: 11px;
  color: #6a737d;
  background: #e1e4e8;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 500;
  text-transform: lowercase;
  flex-shrink: 0;
  margin-right: 12px;
}

/* Scoped button styles for Edit Dialog only */
#edit-dialog .btn-sm {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#edit-dialog .btn-danger {
  background: #ffffff;
  color: #6a737d;
  border: 1px solid #d0d7de;
  font-weight: 400;
}

#edit-dialog .btn-danger:hover {
  background: #fee;
  border-color: #ef4444;
  color: #dc2626;
  box-shadow: none;
}

#edit-dialog .remove-chart-btn {
  flex-shrink: 0;
  border-radius: 4px;
}
