/* Global Chat App Styles - Windows Phone Dark Mode */

.tile-globalchat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tile-globalchat .tile-glyph {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.tile-globalchat .tile-title {
  position: static;
  margin: 0;
}

.global-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #000;
  color: #fff;
}

.global-chat-header {
  padding: 20px 24px 12px 24px;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.global-chat-title {
  font-size: 42px;
  font-weight: 200;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  font-family: 'Segoe WP Light', 'Segoe UI Light', sans-serif;
}

.global-chat-subtitle {
  font-size: 14px;
  opacity: 0.7;
  margin: 0;
  font-weight: 300;
}

.global-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 24px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #000;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  min-height: 0;
}

/* Add safe space at bottom when custom keyboard is open */
.kb-open .global-chat-messages {
  padding-bottom: calc(var(--kb-h, 240px) + 180px);
  scroll-padding-bottom: calc(var(--kb-h, 240px) + 180px);
}

.global-chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-loading {
  text-align: center;
  opacity: 0.5;
  padding: 40px 20px;
  font-size: 14px;
}

.global-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: messageSlideIn 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.message-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.95;
}

.message-time {
  font-size: 11px;
  opacity: 0.5;
}

.message-text {
  font-size: 15px;
  line-height: 1.4;
  color: #fff;
  word-wrap: break-word;
  opacity: 0.92;
  padding-left: 2px;
}

.global-chat-input-area {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d0d0d;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  display: flex;
  gap: 8px;
  align-items: center;
}

.global-chat-input-area .input-wrapper {
  flex: 1;
}

.global-chat-input-area .message-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 0;
  outline: none;
  font-family: 'Segoe WP', 'Segoe UI', Arial, sans-serif;
  caret-color: #8b5cf6;
}

.global-chat-input-area .message-input:focus {
  border-color: var(--accent);
  background: #222;
  caret-color: #8b5cf6;
}

.global-chat-input-area .message-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.global-chat-input-area .input-actions {
  display: flex;
  gap: 4px;
}

.global-chat-input-area .input-action-btn {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.global-chat-input-area .input-action-btn:active {
  opacity: 0.7;
}

.global-chat-input-area .action-icon-img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* System message style */
.global-message.system .message-text {
  opacity: 0.5;
  font-style: italic;
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
}

.global-message.system .message-header {
  display: none;
}

/* Accent purple for global chat tile */
.accent-purple {
  background: #8b5cf6 !important;
}

/* Authentication Screen Styles */
.global-chat-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #000;
  color: #fff;
  padding: 24px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 48px;
  font-weight: 200;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  font-family: 'Segoe WP Light', 'Segoe UI Light', sans-serif;
  text-align: center;
}

.auth-subtitle {
  font-size: 16px;
  opacity: 0.6;
  margin: 0 0 40px 0;
  text-align: center;
}

.auth-form {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-form.hidden {
  display: none;
}

.auth-form-title {
  font-size: 20px;
  font-weight: 300;
  margin: 0 0 20px 0;
  text-transform: lowercase;
}

.auth-input-group {
  margin-bottom: 16px;
}

.auth-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 0;
  outline: none;
  font-family: 'Segoe WP', 'Segoe UI', Arial, sans-serif;
  box-sizing: border-box;
  caret-color: #8b5cf6;
}

.auth-input:focus {
  border-color: #8b5cf6;
  background: #222;
  caret-color: #8b5cf6;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
  color: #fff;
  font-family: 'Segoe WP', 'Segoe UI', Arial, sans-serif;
}

.auth-btn:active {
  opacity: 0.8;
}

.auth-link {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

.auth-link a {
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:active {
  opacity: 0.7;
}

.auth-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 14px;
  text-align: center;
  display: none;
}

.auth-error.show {
  display: block;
}

/* Hide/show main chat */
.global-chat-container.hidden {
  display: none;
}

.global-chat-auth.hidden {
  display: none;
}

/* Message delete button for admin */
.message-delete-btn {
  background: rgba(239, 68, 68, 0.8);
  border: none;
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.message-delete-btn:active {
  opacity: 0.7;
}

.message-header .message-delete-btn {
  opacity: 0.9;
}
