/* ============================================
   COINRUSH CHAT - Modern React Chat Styles
   Premium glassmorphism design with animations
   ============================================ */

/* ============================================
   CSS VARIABLES - Theme Colors
   ============================================ */
:root {
  /* Gold Theme (Default) */
  --cr-chat-primary: #fbbf24;
  --cr-chat-primary-rgb: 251, 191, 36;
  --cr-chat-secondary: #f59e0b;
  --cr-chat-accent: #fcd34d;
  
  /* Background */
  --cr-chat-bg-dark: rgba(10, 12, 16, 0.98);
  --cr-chat-bg-medium: rgba(20, 24, 32, 0.95);
  --cr-chat-bg-light: rgba(30, 36, 48, 0.9);
  
  /* Text */
  --cr-chat-text-primary: #f8fafc;
  --cr-chat-text-secondary: #94a3b8;
  --cr-chat-text-muted: #64748b;
  
  /* Borders */
  --cr-chat-border: rgba(251, 191, 36, 0.2);
  --cr-chat-border-light: rgba(251, 191, 36, 0.1);
  
  /* Shadows */
  --cr-chat-glow: rgba(251, 191, 36, 0.4);
  --cr-chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Green Theme */
.cr-chat-container.green,
.cr-floating-chat-panel.green,
.cr-floating-chat-btn.green,
.cr-chat-minimized.green {
  --cr-chat-primary: #5bffb2;
  --cr-chat-primary-rgb: 91, 255, 178;
  --cr-chat-secondary: #34d399;
  --cr-chat-accent: #6ee7b7;
  --cr-chat-border: rgba(91, 255, 178, 0.2);
  --cr-chat-border-light: rgba(91, 255, 178, 0.1);
  --cr-chat-glow: rgba(91, 255, 178, 0.4);
}

/* Purple Theme */
.cr-chat-container.purple,
.cr-floating-chat-panel.purple,
.cr-floating-chat-btn.purple,
.cr-chat-minimized.purple {
  --cr-chat-primary: #a78bfa;
  --cr-chat-primary-rgb: 167, 139, 250;
  --cr-chat-secondary: #8b5cf6;
  --cr-chat-accent: #c4b5fd;
  --cr-chat-border: rgba(167, 139, 250, 0.2);
  --cr-chat-border-light: rgba(167, 139, 250, 0.1);
  --cr-chat-glow: rgba(167, 139, 250, 0.4);
}

/* Blue Theme */
.cr-chat-container.blue,
.cr-floating-chat-panel.blue,
.cr-floating-chat-btn.blue,
.cr-chat-minimized.blue {
  --cr-chat-primary: #60a5fa;
  --cr-chat-primary-rgb: 96, 165, 250;
  --cr-chat-secondary: #3b82f6;
  --cr-chat-accent: #93c5fd;
  --cr-chat-border: rgba(96, 165, 250, 0.2);
  --cr-chat-border-light: rgba(96, 165, 250, 0.1);
  --cr-chat-glow: rgba(96, 165, 250, 0.4);
}

/* Pink/Neon Theme - For Slice n' Dice */
.cr-chat-container.pink,
.cr-floating-chat-panel.pink,
.cr-floating-chat-btn.pink,
.cr-chat-minimized.pink {
  --cr-chat-primary: #ff2d92;
  --cr-chat-primary-rgb: 255, 45, 146;
  --cr-chat-secondary: #b44aff;
  --cr-chat-accent: #00f5ff;
  --cr-chat-border: rgba(255, 45, 146, 0.3);
  --cr-chat-border-light: rgba(255, 45, 146, 0.15);
  --cr-chat-glow: rgba(255, 45, 146, 0.5);
  --cr-chat-bg-dark: rgba(15, 10, 20, 0.98);
  --cr-chat-bg-medium: rgba(25, 15, 35, 0.95);
  --cr-chat-bg-light: rgba(40, 20, 50, 0.9);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.cr-chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 400px;
  max-height: 700px;
  background: rgba(10, 12, 16, 0.85); /* More transparent */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Subtler border */
  border-radius: 20px; /* Smoother corners */
  overflow: hidden;
  font-family: 'Sora', 'Inter', sans-serif;
  box-shadow: 
    0 20px 50px -10px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05); /* Inner glow */
}

/* ============================================
   HEADER
   ============================================ */
.cr-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent; /* Removed background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cr-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cr-chat-header-icon {
  width: 20px;
  height: 20px;
  color: var(--cr-chat-primary);
  filter: drop-shadow(0 0 8px rgba(var(--cr-chat-primary-rgb), 0.4));
}

.cr-chat-header-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cr-chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cr-chat-online-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cr-chat-text-secondary);
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cr-chat-online-pulse {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: cr-pulse 2s ease-in-out infinite;
}

@keyframes cr-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.cr-chat-minimize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--cr-chat-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cr-chat-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.cr-chat-minimize-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   CHANNEL TABS
   ============================================ */
.cr-chat-tabs {
  display: flex;
  padding: 0 20px 10px 20px; /* Integrated with header spacing */
  gap: 8px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cr-chat-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px; /* Pill shape */
  color: var(--cr-chat-text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cr-chat-tab:hover:not(.locked) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.cr-chat-tab.active {
  background: var(--cr-chat-primary);
  border-color: var(--cr-chat-primary);
  color: #000; /* Black text on gold/primary */
  box-shadow: 0 4px 12px rgba(var(--cr-chat-primary-rgb), 0.3);
}

.cr-chat-tab.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
  border-style: dashed;
}

.cr-chat-tab-icon {
  width: 14px;
  height: 14px;
}

.cr-chat-tab-icon svg {
  width: 100%;
  height: 100%;
}

.cr-chat-tab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 2px 6px;
  background: #ef4444;
  border: 2px solid var(--cr-chat-bg-dark);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.cr-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent; /* Let the container blur show through */
  mask-image: linear-gradient(to bottom, transparent, black 20px, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20px, black 90%, transparent);
}

/* Scrollbar styling */
.cr-chat-messages::-webkit-scrollbar {
  width: 4px;
}

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

.cr-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.cr-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   MESSAGE COMPONENT
   ============================================ */
.cr-chat-message {
  display: flex;
  gap: 12px;
  animation: cr-message-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  align-self: flex-start;
  width: 100%;
  margin-bottom: 12px; /* More spacing between messages */
  padding: 0;
  position: relative;
}

.cr-chat-message:hover {
  background: transparent;
}

@keyframes cr-message-appear {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Own Message - Right Aligned */
.cr-chat-message.own {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.cr-chat-message.own .cr-chat-message-content {
  align-items: flex-end;
}

.cr-chat-message.own .cr-chat-message-header {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.cr-chat-message.own .cr-chat-time {
  margin-left: 0;
  margin-right: auto;
  text-align: right;
}

/* Avatar Wrapper */
.cr-chat-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 36px; /* Slightly larger */
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  z-index: 2;
}

.cr-chat-message-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* PNG Border Frame Overlay */
.cr-chat-avatar-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  width: 58px;
  height: 58px;
}

/* Level 1-4: ROOKIE (No frame) */
.cr-chat-avatar-wrapper.avatar-rookie::before { display: none; }

/* Level 5-9: BRONZE */
.cr-chat-avatar-wrapper.avatar-bronze::before {
  background-image: url('/static/img/borders/Bronzeborder.png');
  filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.5));
}

/* Level 10-14: SILVER */
.cr-chat-avatar-wrapper.avatar-silver::before {
  background-image: url('/static/img/borders/Silverborder.png');
  filter: drop-shadow(0 0 5px rgba(192, 192, 192, 0.6));
}

/* Level 15-19: GOLD */
.cr-chat-avatar-wrapper.avatar-gold::before {
  background-image: url('/static/img/borders/Goldborder.png');
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
}

/* Level 20-29: RUBY/PLATINUM */
.cr-chat-avatar-wrapper.avatar-platinum::before {
  background-image: url('/static/img/borders/Rubyborder.png');
  filter: drop-shadow(0 0 8px rgba(220, 20, 60, 0.8));
  width: 56px;
  height: 56px;
}

/* Level 30-39: DIAMOND */
.cr-chat-avatar-wrapper.avatar-diamond::before {
  background-image: url('/static/img/borders/Diamondborder.png');
  filter: drop-shadow(0 0 10px rgba(185, 242, 255, 0.9));
  width: 58px;
  height: 58px;
}

/* Level 40+: CHALLENGER */
.cr-chat-avatar-wrapper.avatar-challenger::before {
  background-image: url('/static/img/borders/Challengerborder.png');
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 15px rgba(157, 78, 221, 0.7));
  width: 64px;
  height: 64px;
}

.cr-chat-message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  max-width: 85%; /* Prevent full width for better readability */
}

.cr-chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1;
  margin-bottom: 0;
  padding: 0 4px;
}

.cr-chat-username {
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.cr-chat-username:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

.cr-chat-level-badge {
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.8);
  height: 16px;
  display: flex;
  align-items: center;
}

/* Title Badge (LEGEND, MASTER, VIP, etc.) */
.cr-chat-title-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  height: 16px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid transparent;
}

.cr-chat-title-badge.legendary {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(244, 114, 182, 0.1));
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
  box-shadow: 0 0 8px rgba(244, 114, 182, 0.1);
}

.cr-chat-title-badge.master {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(167, 139, 250, 0.1));
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
}

.cr-chat-title-badge.expert {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1));
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.cr-chat-title-badge.vip {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.cr-chat-time {
  font-size: 10px;
  color: var(--cr-chat-text-muted);
  margin-left: auto;
  opacity: 0.6;
  font-weight: 500;
}

.cr-chat-message-text {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px 16px 16px 16px; /* Speech bubble shape */
  font-size: 14px;
  line-height: 1.5;
  color: #f1f5f9;
  word-break: break-word;
  margin-top: 2px;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  backdrop-filter: blur(5px);
}

.cr-chat-message.own .cr-chat-message-text {
  background: linear-gradient(135deg, var(--cr-chat-primary), var(--cr-chat-secondary));
  border: none;
  border-radius: 16px 4px 16px 16px; /* Flipped speech bubble */
  color: #0f172a; /* Dark text on bright bubble */
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(var(--cr-chat-primary-rgb), 0.3);
}

/* System Message */
.cr-chat-message.system {
  justify-content: center;
  margin: 8px 0;
}

.cr-chat-system-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(var(--cr-chat-primary-rgb), 0.08);
  border: 1px solid var(--cr-chat-border-light);
  border-radius: 100px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

.cr-chat-system-icon {
  width: 14px;
  height: 14px;
  color: var(--cr-chat-primary);
}

.cr-chat-system-icon svg {
  width: 100%;
  height: 100%;
}

.cr-chat-system-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--cr-chat-text-secondary);
  letter-spacing: 0.3px;
}

/* ============================================
   EMPTY & LOCKED STATES
   ============================================ */
.cr-chat-empty,
.cr-chat-locked-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

.cr-chat-empty-icon,
.cr-chat-locked-icon {
  width: 48px;
  height: 48px;
  color: var(--cr-chat-text-muted);
  opacity: 0.5;
}

.cr-chat-empty-icon svg,
.cr-chat-locked-icon svg {
  width: 100%;
  height: 100%;
}

.cr-chat-locked-icon {
  color: var(--cr-chat-primary);
  opacity: 1;
  filter: drop-shadow(0 0 15px var(--cr-chat-glow));
}

.cr-chat-empty h3,
.cr-chat-locked-panel h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--cr-chat-text-primary);
}

.cr-chat-empty p,
.cr-chat-locked-panel p {
  margin: 0;
  font-size: 13px;
  color: var(--cr-chat-text-muted);
}

.cr-chat-locked-requirement {
  margin-top: 8px;
  padding: 12px 20px;
  background: rgba(var(--cr-chat-primary-rgb), 0.1);
  border: 1px solid var(--cr-chat-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--cr-chat-text-secondary);
}

.cr-chat-locked-requirement strong {
  color: var(--cr-chat-primary);
}

.cr-chat-current-level {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--cr-chat-text-muted);
}

/* ============================================
   INPUT AREA
   ============================================ */
.cr-chat-input-area {
  padding: 16px 20px;
  background: transparent;
  border-top: none;
  position: relative;
}

/* Glass background for input container */
.cr-chat-input-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  pointer-events: none;
  z-index: 0;
}

.cr-chat-input-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
}

.cr-chat-input-wrapper:focus-within {
  border-color: var(--cr-chat-primary);
  background: rgba(20, 20, 20, 0.9);
  box-shadow: 
    0 0 0 3px rgba(var(--cr-chat-primary-rgb), 0.15),
    0 8px 30px rgba(var(--cr-chat-primary-rgb), 0.15),
    inset 0 0 20px rgba(var(--cr-chat-primary-rgb), 0.05);
}

.cr-chat-input {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 14px;
  color: #fff;
  height: 44px;
  outline: none;
}

.cr-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 500;
}

.cr-chat-input:hover,
.cr-chat-input:focus {
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
}

.cr-chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cr-chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  background: var(--cr-chat-primary);
  border: none;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(var(--cr-chat-primary-rgb), 0.3);
  margin-right: 2px;
  flex-shrink: 0;
  outline: none;
}

.cr-chat-send-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cr-chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(var(--cr-chat-primary-rgb), 0.4);
}

.cr-chat-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.cr-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #334155;
  color: #94a3b8;
  box-shadow: none;
}

/* Login Prompt & Banned */
.cr-chat-login-prompt,
.cr-chat-banned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(var(--cr-chat-primary-rgb), 0.15);
  border: 1px solid rgba(var(--cr-chat-primary-rgb), 0.3);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cr-chat-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cr-chat-login-prompt:hover {
  background: rgba(var(--cr-chat-primary-rgb), 0.25);
  transform: translateY(-1px);
}

.cr-chat-banned {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  cursor: default;
}

.cr-chat-banned-icon {
  width: 16px;
  height: 16px;
}

.cr-chat-banned-icon svg {
  width: 100%;
  height: 100%;
}

/* Footer */
.cr-chat-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 4px;
  padding: 0 4px;
}

.cr-chat-connection-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #f59e0b;
  opacity: 0.7;
}

.cr-chat-connection-status.connected {
  color: #22c55e;
}

.cr-chat-connection-status svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   MINIMIZED STATE
   ============================================ */
.cr-chat-minimized {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--cr-chat-bg-dark);
  border: 1px solid var(--cr-chat-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.cr-chat-minimized:hover {
  background: var(--cr-chat-bg-medium);
  border-color: var(--cr-chat-primary);
  box-shadow: 0 4px 20px rgba(var(--cr-chat-primary-rgb), 0.2);
}

.cr-chat-minimized-icon {
  width: 20px;
  height: 20px;
  color: var(--cr-chat-primary);
}

.cr-chat-minimized-icon svg {
  width: 100%;
  height: 100%;
}

.cr-chat-minimized-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--cr-chat-text-primary);
}

.cr-chat-notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: cr-notification-pulse 1s ease-in-out infinite;
}

@keyframes cr-notification-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.cr-chat-online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
}

/* ============================================
   FLOATING CHAT BUTTON
   ============================================ */
.cr-floating-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--cr-chat-primary), var(--cr-chat-secondary));
  border: 2px solid rgba(var(--cr-chat-primary-rgb), 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 4px 20px var(--cr-chat-glow);
  transition: all 0.3s ease;
}

.cr-floating-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px var(--cr-chat-glow);
}

.cr-floating-chat-btn:active {
  transform: scale(0.95);
}

.cr-floating-chat-btn svg {
  width: 28px;
  height: 28px;
  color: #000;
}

.cr-floating-notification {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border: 2px solid #000;
  border-radius: 50%;
  animation: cr-notification-pulse 1s ease-in-out infinite;
}

/* ============================================
   FLOATING CHAT PANEL
   ============================================ */
.cr-floating-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 550px;
  z-index: 9999;
  animation: cr-slide-up 0.3s ease-out;
}

@keyframes cr-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cr-floating-chat-panel .cr-chat-container {
  height: 100%;
  border-radius: 16px;
}

.cr-floating-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cr-floating-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(1.1);
}

.cr-floating-close-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .cr-floating-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  
  .cr-floating-chat-panel .cr-chat-container {
    border-radius: 16px 16px 0 0;
  }
  
  .cr-floating-chat-btn {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  
  .cr-chat-message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 12px;
  }
  
  .cr-chat-message-text {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes cr-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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