/* Reaction Picker — 6x6 emoji grid overlay */

/* Alpine x-cloak: hide elements with the attribute until Alpine mounts.
   Used on .reaction-picker-overlay so the overlay doesn't flash before
   x-show="open" evaluates on page load. */
[x-cloak] { display: none !important; }

:root {
  --rp-bg: rgba(0, 0, 0, 0.55);
  --rp-panel-bg: rgba(20, 20, 22, 0.72);
  --rp-panel-border: rgba(255, 255, 255, 0.1);
  --rp-cell-hover: rgba(255, 255, 255, 0.08);
  --rp-cell-active: rgba(225, 62, 19, 0.18);
  --rp-cell-active-border: rgba(225, 62, 19, 0.55);
  --rp-cell-disabled: 0.3;
  --rp-text: #e2e8f0;
  --rp-text-muted: #94a3b8;
  --rp-message-bg: rgba(239, 68, 68, 0.9);
  --rp-radius: 16px;
  --rp-cell-size: 48px;
}

[data-theme="light"] {
  --rp-bg: rgba(0, 0, 0, 0.35);
  --rp-panel-bg: rgba(255, 255, 255, 0.78);
  --rp-panel-border: rgba(0, 0, 0, 0.1);
  --rp-cell-hover: rgba(0, 0, 0, 0.05);
  --rp-cell-active: rgba(225, 62, 19, 0.12);
  --rp-cell-active-border: rgba(225, 62, 19, 0.45);
  --rp-text: #1e293b;
  --rp-text-muted: #64748b;
}

.reaction-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rp-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: rp-fade-in 0.15s ease-out;
}

@keyframes rp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reaction-picker-panel {
  background: var(--rp-panel-bg);
  border: 1px solid var(--rp-panel-border);
  border-radius: var(--rp-radius);
  padding: 16px;
  max-width: 340px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  animation: rp-scale-in 0.15s ease-out;
}

@keyframes rp-scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reaction-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.reaction-picker-title {
  color: var(--rp-text);
  font-size: 14px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
}

.reaction-picker-hint {
  color: var(--rp-text-muted);
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.reaction-picker-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--rp-cell-size);
  height: var(--rp-cell-size);
  font-size: 22px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  padding: 0;
  line-height: 1;
}

.reaction-picker-cell:hover:not(:disabled) {
  background: var(--rp-cell-hover);
  transform: scale(1.15);
}

.reaction-picker-cell:active:not(:disabled) {
  transform: scale(0.95);
}

.reaction-picker-cell--active {
  background: var(--rp-cell-active);
  border-color: var(--rp-cell-active-border);
}

.reaction-picker-cell--disabled {
  opacity: var(--rp-cell-disabled);
  cursor: not-allowed;
}

.reaction-picker-cell[data-count]::after {
  content: attr(data-count);
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--rp-text-muted);
  font-family: system-ui, -apple-system, sans-serif;
  background: rgba(20, 20, 22, 0.9);
  padding: 0 3px;
  border-radius: 4px;
  line-height: 14px;
}

[data-theme="light"] .reaction-picker-cell[data-count]::after {
  background: rgba(255, 255, 255, 0.9);
}

.reaction-picker-message {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--rp-message-bg);
  color: white;
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  border-radius: 8px;
  text-align: center;
  animation: rp-fade-in 0.15s ease-out;
}

/* Report Modal */
.report-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: rp-fade-in 0.15s ease-out;
}

.report-modal-panel {
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  max-width: 400px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  animation: rp-scale-in 0.15s ease-out;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="light"] .report-modal-panel {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.1);
}

.report-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-modal-title {
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
}

[data-theme="light"] .report-modal-title {
  color: #1e293b;
}

.report-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: all 0.12s ease;
  padding: 0;
}

.report-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

[data-theme="light"] .report-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1e293b;
}

.report-modal-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  display: block;
  margin-bottom: -6px;
}

[data-theme="light"] .report-modal-label {
  color: #64748b;
}

.report-modal-select,
.report-modal-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
  transition: border-color 0.12s ease;
}

[data-theme="light"] .report-modal-select,
[data-theme="light"] .report-modal-textarea {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

.report-modal-select {
  padding: 8px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2394a3b8' d='m213.66 101.66-80 80a8 8 0 0 1-11.32 0l-80-80A8 8 0 0 1 53.66 90.34L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.report-modal-select option {
  background: #141416;
  color: #e2e8f0;
}

[data-theme="light"] .report-modal-select option {
  background: #ffffff;
  color: #1e293b;
}

.report-modal-select:focus,
.report-modal-textarea:focus {
  outline: none;
  border-color: rgba(225, 62, 19, 0.5);
}

.report-modal-textarea {
  padding: 8px 10px;
  resize: vertical;
  min-height: 72px;
}

.report-modal-textarea::placeholder {
  color: #475569;
}

[data-theme="light"] .report-modal-textarea::placeholder {
  color: #94a3b8;
}

.report-modal-message {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
  animation: rp-fade-in 0.15s ease-out;
}

.report-modal-message--success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

[data-theme="light"] .report-modal-message--success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.2);
}

.report-modal-message--error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .report-modal-message--error {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

.report-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.report-modal-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.12s ease;
}

.report-modal-btn--cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.report-modal-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

[data-theme="light"] .report-modal-btn--cancel {
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
}

[data-theme="light"] .report-modal-btn--cancel:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #1e293b;
}

.report-modal-btn--submit {
  background: #ef4444;
  color: white;
}

.report-modal-btn--submit:hover:not(:disabled) {
  background: #dc2626;
}

.report-modal-btn--submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
