* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  transition: background 0.3s ease;
}

/* Glassmorphism Utility */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

/* Auth Container (index.html) */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  animation: fadeIn 0.5s ease-in-out;
}

.auth-container h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-align: center;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.input-group {
  width: 100%;
  margin-bottom: 1.5rem;
}

.input-group input {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.input-group input::placeholder {
  color: rgba(224, 224, 224, 0.7);
}

.input-group input:focus {
  outline: none;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.btn-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1rem;
}

.btn-group button {
  padding: 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-group button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-group button:hover::before {
  left: 100%;
}

#signup {
  background: linear-gradient(45deg, #ff6b6b, #ffa726);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#signup:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  transform: translateY(-2px);
}

#login {
  background: linear-gradient(45deg, #4ecdc4, #45b7d1);
  color: white;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

#login:hover {
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
  transform: translateY(-2px);
}

#google-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#google-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* User Setup (user.html) */
.user-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  animation: fadeIn 0.5s ease-in-out;
}

.user-setup h2 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-setup p {
  margin-bottom: 1.5rem;
  color: rgba(224, 224, 224, 0.8);
  text-align: center;
}

#username {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

#username::placeholder {
  color: rgba(224, 224, 224, 0.7);
}

#username:focus {
  outline: none;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

#user-btn {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(45deg, #4ecdc4, #45b7d1);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

#user-btn:hover {
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
  transform: translateY(-2px);
}

#Logout-btn.logout {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#Logout-btn.logout:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Chat Container (chat.html) */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  animation: fadeIn 0.5s ease-in-out;
}

#Logout-btn {
  align-self: flex-end;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#Logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.message-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(78, 205, 196, 0.5) transparent;
}

.message-box::-webkit-scrollbar {
  width: 6px;
}

.message-box::-webkit-scrollbar-track {
  background: transparent;
}

.message-box::-webkit-scrollbar-thumb {
  background: rgba(78, 205, 196, 0.5);
  border-radius: 3px;
}

.message {
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease-out;
}

.message.own {
  text-align: right;
}

.message.other {
  text-align: left;
}

.bubble {
  display: inline-block;
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  word-wrap: break-word;
}

.message.own .bubble {
  background: linear-gradient(45deg, #4ecdc4, #45b7d1);
  color: white;
}

.message.other .bubble {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.actions button:hover {
  transform: scale(1.2);
}

.timestamp {
  font-size: 0.8rem;
  color: rgba(224, 224, 224, 0.6);
  margin-top: 0.25rem;
}

#message {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

#message::placeholder {
  color: rgba(224, 224, 224, 0.7);
}

#message:focus {
  outline: none;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

#sendMessage {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(45deg, #ff6b6b, #ffa726);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#sendMessage:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  transform: translateY(-2px);
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-container, .user-setup, .chat-container {
    padding: 1rem;
    max-width: 100%;
  }

  .btn-group {
    gap: 0.75rem;
  }

  .message-box {
    padding: 0.5rem;
  }

  .bubble {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .auth-container h2, .user-setup h2 {
    font-size: 1.5rem;
  }

  .input-group input, #username, #message {
    padding: 0.75rem;
  }

  .btn-group button, #user-btn, #sendMessage {
    padding: 0.75rem;
  }
}
