

/* chat system, */
.chat-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    z-index: 998;
    transition: all 0.3s ease;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-modal {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    width: 350px;
    height: 500px;
    background: #0f172a;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-modal.active {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    padding: 1.25rem;
    background: linear-gradient(90deg, #1e293b, #0f172a);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

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

.chat-title h2 {
    font-size: 1.1rem;
    color: #e2e8f0;
}

.admin-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-offline {
    background: #64748b;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e2e8f0;
}

.chat-history {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(180deg, #0f172a, #1e293b);
}

.message-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    max-width: 80%;
    padding: 0.9rem 1.1rem;
    border-radius: 18px;
    position: relative;
    animation: messageAppear 0.3s ease-out;
    font-size: 0.95rem;
    line-height: 1.4;
}

.admin-message {
    background: #1e293b;
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #334155;
}

.user-message {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    text-align: right;
}

.unread-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #334155, transparent);
}

.divider-text {
    font-size: 0.8rem;
    color: #6366f1;
    font-weight: 500;
}

.message-input-area {
    padding: 1rem;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    gap: 0.75rem;
}

.message-input {
    flex: 1;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    resize: none;
    font-size: 0.95rem;
    max-height: 120px;
    transition: all 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    background: linear-gradient(135deg, #5659e3, #7a4ae8);
    transform: scale(1.05);
}

/* Animations */
@keyframes messageAppear {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .chat-modal {
        width: 90%;
        height: 70vh;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        margin: 0 auto;
    }
    
    .chat-button {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Chat Modal Styles */
.chat-modal {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 1000;
  flex-direction: column;
  display: none;
}

.chat-modal.active {
  display: flex !important;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

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

.admin-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-online {
  background: #4CAF50;
}

.status-offline {
  background: #9e9e9e;
}

.status-online.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.chat-history {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message {
  max-width: 80%;
  padding: 0.5rem 1rem;
  border-radius: 18px;
  margin-bottom: 0.5rem;
  position: relative;
}

.user-message {
  align-self: flex-end;
  background: #4361ee;
  color: white;
}

.admin-message {
  align-self: flex-start;
  background: #e9ecef;
  color: black;
}

.message-time {
  font-size: 0.7rem;
  margin-top: 0.2rem;
  opacity: 0.7;
}

.message-input-area {
  display: flex;
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
}

.message-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 0.5rem 1rem;
  resize: none;
  outline: none;
}

.send-btn {
  background: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  cursor: pointer;
}

.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: black;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f44336;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}