/* ================================================================= */
/*  Artemis II Watch Party — modal + chat widget                     */
/*  Drop into <head>: <link rel="stylesheet" href="/watch-party.css"> */
/* ================================================================= */

/* -------- Modal overlay -------- */
.wp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 5, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: wp-fade-in 0.4s ease;
}

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

@keyframes wp-pop-in {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes wp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(168, 85, 247, 0); }
}

.wp-modal {
  background: linear-gradient(180deg, rgba(20, 10, 50, 0.96) 0%, rgba(5, 5, 25, 0.98) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow:
    0 0 60px rgba(168, 85, 247, 0.25),
    0 0 120px rgba(99, 102, 241, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.6);
  animation: wp-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #f1f5f9;
  position: relative;
}

.wp-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

.wp-modal-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  text-align: center;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.wp-modal-subtitle {
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.5;
}

.wp-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wp-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.wp-input::placeholder {
  color: #64748b;
}

.wp-input:focus {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.wp-btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.wp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

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

.wp-btn-secondary {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
  text-align: center;
  text-decoration: underline;
  font-family: inherit;
  transition: color 0.2s ease;
}

.wp-btn-secondary:hover {
  color: #cbd5e1;
}

.wp-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.2) !important;
}

.wp-form-error {
  color: #fca5a5;
  font-size: 12px;
  text-align: center;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  margin-top: -2px;
}

.wp-chat-viewer-bar {
  justify-content: center;
  text-align: center;
}

.wp-viewer-text {
  font-size: 12px;
  color: #94a3b8;
}

.wp-viewer-text a {
  color: #c4b5fd;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.wp-viewer-text a:hover {
  color: #ddd6fe;
}

/* -------- Chat widget toggle button -------- */
.wp-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(168, 85, 247, 0.5),
    0 0 0 0 rgba(168, 85, 247, 0.6);
  animation: wp-pulse 2.4s ease infinite;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wp-toggle:hover {
  transform: scale(1.08);
}

.wp-toggle-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  background: #ef4444;
  color: #fff;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid #0a0a1e;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* -------- Chat panel -------- */
.wp-chat {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 340px;
  height: 480px;
  background: linear-gradient(180deg, rgba(15, 10, 35, 0.97) 0%, rgba(5, 5, 20, 0.98) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  box-shadow:
    0 0 50px rgba(168, 85, 247, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 9997;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #f1f5f9;
  overflow: hidden;
  animation: wp-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.wp-chat-header {
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.18), rgba(99, 102, 241, 0.12));
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wp-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-chat-title-emoji {
  font-size: 18px;
}

.wp-chat-title-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.wp-chat-presence {
  font-size: 11px;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wp-chat-presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: wp-blink 1.8s ease-in-out infinite;
}

@keyframes wp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.wp-chat-collapse {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.wp-chat-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.wp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}

.wp-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.wp-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.wp-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}

.wp-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

.wp-chat-empty {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  padding: 30px 16px;
  font-style: italic;
}

.wp-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  word-wrap: break-word;
  animation: wp-msg-in 0.25s ease;
}

@keyframes wp-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wp-msg-own {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.18));
  border-color: rgba(168, 85, 247, 0.4);
}

.wp-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.wp-msg-name {
  font-size: 11px;
  font-weight: 700;
  color: #c4b5fd;
}

.wp-msg-own .wp-msg-name {
  color: #ddd6fe;
}

.wp-msg-time {
  font-size: 9px;
  color: #64748b;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.wp-msg-text {
  font-size: 13px;
  line-height: 1.45;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.wp-chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.wp-chat-input {
  flex: 1;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.wp-chat-input::placeholder {
  color: #64748b;
}

.wp-chat-input:focus {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(168, 85, 247, 0.08);
}

.wp-chat-send {
  padding: 0 16px;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wp-chat-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(168, 85, 247, 0.4);
}

.wp-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -------- Mobile -------- */
@media (max-width: 480px) {
  .wp-chat {
    width: calc(100vw - 24px);
    height: 65vh;
    right: 12px;
    bottom: 12px;
  }
  .wp-modal {
    padding: 24px 20px;
  }
}
