.chat-container {
  height: 100%;
  height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  position: relative;
}

.announcements-section {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.section-header i {
  font-size: 12px;
}

.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.announcement {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.announcement:hover {
  background: rgba(255, 255, 255, 0.05);
}

.announcement-icon {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.announcement-icon i {
  font-size: 14px;
}

.announcement-content {
  flex: 1;
  min-width: 0;
}

.announcement-text {
  color: var(--text-color);
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.announcement-time {
  color: var(--text-secondary);
  font-size: 11px;
}

.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 0px;
  height: 100%;
  overflow: hidden;
}

.chat-section .section-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.online-count {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.online-count i {
  color: #4caf50;
  font-size: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 150px;
  padding-bottom: 120px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
  margin: 0;
  padding: 0;
}

.user-level {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin: 0;
}

.user-level.admin {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
}

.user-level.vip {
  background: rgba(255, 184, 0, 0.1);
  color: #ffb800;
}

.message-main {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2px;
  padding: 0;
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
}

.username {
  color: var(--text-color);
  font-weight: 500;
  font-size: 13px;
  margin: 0;
  padding: 0;
}

.username.admin {
  color: #ff3b30;
}

.username.vip {
  color: #ffb800;
}

.timestamp {
  color: var(--text-secondary);
  opacity: 0;
  font-size: 11px;
  margin: 0;
  padding: 0;
}

.message-content {
  color: var(--message-color);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.system-message {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  text-align: center;
}

.system-message .message-content {
  color: var(--text-secondary);
  font-size: 12px;
}

.personal-message {
  background: rgba(0, 174, 255, 0.08) !important;
  border: 1px solid rgba(0, 174, 255, 0.2) !important;
  border-radius: 6px;
  text-align: center;
  margin: 0.75rem 0 !important;
  animation: pulseHighlight 2s ease-in-out;
}

.personal-message .message-content {
  color: #f5f7f9 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
}

@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 174, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 174, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 174, 255, 0);
  }
}

.chat-input-container {
  position: sticky;
  bottom: 0;
  left: 0;
  right: auto;
  width: 320px;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--nav-bg);
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 13px;
  padding: 0.25rem;
  outline: none;
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emoji-btn,
.send-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.emoji-btn:hover,
.send-btn:hover {
  color: var(--text-color);
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.control-btn.active {
  background: var(--accent-color);
  color: #000;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-to-bottom {
  position: absolute;
  bottom: 110px;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-color, #ff9000);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: none;
}

.scroll-to-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-to-bottom i {
  font-size: 14px;
}

.new-messages-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1px solid var(--accent-color, #ff9000);
}

.rain-notification {
  position: relative;
  margin: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 5;
  animation: fadeInDown 0.3s ease-out;
  height: 60px;
}

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

.rain-notification-content {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  height: 100%;
}

.rain-notification-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  z-index: -1;
}

.rain-notification-text {
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 0.75rem;
}

.rain-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 0;
}

.rain-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.rain-details {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.rain-amount,
.rain-creator {
  font-weight: 600;
  color: #fff;
}

.rain-badge i {
  font-size: 12px;
  color: #00aeff;
}

.join-rain-btn {
  background: rgba(255, 144, 0, 0.8);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.join-rain-btn:hover {
  background: rgba(255, 144, 0, 1);
  transform: translateY(-1px);
}

.rain-btn {
  background: rgba(0, 174, 255, 0.1);
  color: #00aeff;
}

.rain-btn:hover {
  background: rgba(0, 174, 255, 0.2);
}

.rain-btn i {
  color: #00aeff;
}

.rain-modal,
.captcha-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.rain-modal-content,
.captcha-modal-content {
  background: var(--nav-bg);
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rain-modal-header,
.captcha-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title i {
  font-size: 1.2rem;
  color: #00aeff;
}

.modal-title h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
}

.rain-modal-header h3,
.captcha-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
}

.close-rain-modal,
.close-captcha-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.rain-modal-body,
.captcha-modal-body {
  padding: 1.5rem;
}

.modal-description {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
}

.rain-modal-body p,
.captcha-modal-body p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 14px;
}

.rain-amount-input {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rain-amount-input input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 16px;
  padding: 0.5rem;
  outline: none;
  -moz-appearance: textfield; /* Firefox */
}

.rain-amount-input input::-webkit-outer-spin-button,
.rain-amount-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rain-amount-input span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 0 0.5rem;
}

.rain-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  background: rgba(0, 174, 255, 0.05);
  border-radius: 6px;
  padding: 0.75rem;
}

.rain-info i {
  color: #00aeff;
  font-size: 1rem;
  margin-top: 0.2rem;
}

.rain-description {
  font-size: 12px !important;
  opacity: 0.9;
  color: var(--text-secondary);
  margin: 0 !important;
  line-height: 1.5;
  text-align: left;
}

.rain-modal-footer,
.captcha-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cancel-rain-btn,
.cancel-captcha-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-rain-btn,
.submit-captcha-btn {
  background: var(--accent-color, #ff9000);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-rain-btn:hover,
.submit-captcha-btn:hover {
  background: var(--accent-hover, #ffb040);
}

#captcha-container {
  margin: 1rem 0;
  min-height: 80px;
  display: flex;
  justify-content: flex-start;
}
