/* Callback Buttons (Reaction Buttons) Styles */

/* Button type selector in modal */
.button-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.button-type-selector .type-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-type-selector .type-btn svg {
  width: 18px;
  height: 18px;
}

.button-type-selector .type-btn:hover {
  border-color: var(--accent);
}

.button-type-selector .type-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.button-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-hint {
  font-size: 12px;
  color: #999;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-top: 4px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  margin-bottom: 4px;
  margin-top: 8px;
}

/* Emoji picker */
.emoji-picker {
  margin: 12px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.emoji-picker-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 500;
}

.emoji-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.emoji-buttons .emoji-btn {
  padding: 8px;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: static; /* Override absolute positioning */
}

.emoji-buttons .emoji-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.emoji-buttons .emoji-btn:active {
  transform: scale(0.95);
}

/* More emoji button - single column, compact */
.emoji-buttons .more-emoji-btn {
  font-size: 16px;
  font-weight: 600;
  background: rgba(47, 125, 246, 0.1);
  border: 1px solid rgba(47, 125, 246, 0.3);
  color: var(--accent);
}

.emoji-buttons .more-emoji-btn:hover {
  background: rgba(47, 125, 246, 0.2);
  border-color: rgba(47, 125, 246, 0.5);
}

/* Full emoji picker panel */
.full-emoji-panel {
  position: relative;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  height: 320px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.full-emoji-panel emoji-picker {
  width: 100%;
  height: 100%;
  --background: var(--surface);
  --border-color: var(--border);
  --num-columns: 8;
}

/* Button editor - distinguish URL from callback buttons */
.btn-item.btn-url {
  border-left: 3px solid #0088cc;
}

.btn-item.btn-callback {
  border-left: 3px solid #6c757d;
}

/* Preview buttons - callback buttons have different color */
.tg-ik-btn-callback {
  background: rgba(108, 117, 125, 0.5) !important;
  cursor: not-allowed !important;
}

.tg-ik-btn-callback::after {
  content: "" !important;
}

.tg-ik-btn-url::after {
  content: "↗";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

/* Drag and Drop Overlay */
.drag-drop-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drag-drop-overlay.active {
  pointer-events: auto;
}

.drag-drop-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  opacity: 0.95;
}

.drag-drop-zone-top {
  background: rgba(100, 100, 120, 0.85);
}

.drag-drop-zone-bottom {
  background: rgba(50, 120, 220, 0.85);
}

.drag-drop-zone.drag-over {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.01);
}

.drag-drop-zone-top.drag-over {
  background: rgba(120, 120, 140, 0.92);
  box-shadow: 0 4px 20px rgba(120, 120, 140, 0.3);
}

.drag-drop-zone-bottom.drag-over {
  background: rgba(50, 150, 255, 0.92);
  box-shadow: 0 4px 20px rgba(50, 150, 255, 0.3);
}

.drag-drop-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.9;
  color: #fff;
  stroke-width: 1.5;
  pointer-events: none;
}

.drag-drop-text {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  text-align: center;
  pointer-events: none;
}

.drag-drop-subtext {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  line-height: 1.5;
  pointer-events: none;
}

/* Poll Editor */
.poll-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.poll-editor.poll-editor-expanded {
  margin-top: 0 !important;
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.poll-editor.poll-editor-expanded .poll-editor-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 8px;
  gap: 16px;
}

.poll-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.poll-editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.poll-editor-body::-webkit-scrollbar {
  width: 8px;
}

.poll-editor-body::-webkit-scrollbar-track {
  background: transparent;
}

.poll-editor-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.poll-editor-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.poll-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.poll-option-item:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(47, 125, 246, 0.1);
}

.poll-option-item .drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  font-size: 18px;
  user-select: none;
  padding: 0 4px;
  flex-shrink: 0;
}

.poll-option-item .drag-handle:active {
  cursor: grabbing;
}

.poll-option-item .correct-answer {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.poll-option-item input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.poll-option-item input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.poll-option-item .char-count {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.poll-option-item .remove-btn {
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.poll-option-item .remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.poll-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.form-group .form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  resize: vertical;
}

.form-group .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group .char-count {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
}

/* Poll Preview Styles */
.tg-poll {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.tg-poll-question {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
  word-wrap: break-word;
}

.tg-poll-type {
  font-size: 13px;
  color: #3390ec;
  margin-bottom: 12px;
  font-weight: 400;
}

.tg-poll-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.tg-poll-option {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  cursor: default;
  min-height: 36px;
}

.tg-poll-option.correct-answer {
  background: rgba(76, 175, 80, 0.12);
}

.tg-poll-radio {
  margin: 0;
  margin-right: 10px;
  cursor: default;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.tg-poll-option-label {
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
  word-wrap: break-word;
  flex: 1;
}

.tg-poll-vote-btn {
  width: 100%;
  padding: 9px;
  background: transparent;
  color: #3390ec;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.tg-poll-explanation {
  margin-top: 10px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-left: 2px solid #3390ec;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tg-poll-vote-count {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}
