:root {
  /* Color Variables */
  --primary-color: #4E9EFF;
  --secondary-color: #6bb2ff;
  --dark-bg: #121218;
  --darker-bg: #0e0e12;
  --text-color: #e0e0e0;
  --accent-color: #4E9EFF;
  --highlight-color: #ff6b6b;
  --user-bubble: #4E9EFF;
  --bot-bubble: #2a2a3a;
  --constant-blue: #4E9EFF;
  
  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(10px);
  
  /* Mode Colors */
  --chill-color: #4E9EFF;
  --roast-color: #ff6b6b;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes gradientPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

@keyframes messageAppear {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes scaleIn {
  from { transform: scale(0.95); }
  to { transform: scale(1); }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

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

body {
  background-color: var(--dark-bg);
  color: var(--text-color);
  height: 100vh;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
  border: 2px solid var(--darker-bg);
  box-shadow: 0 0 5px rgba(78, 158, 255, 0.5);
}

::-webkit-scrollbar-track {
  background: rgba(18, 18, 24, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
  box-shadow: 0 0 10px rgba(78, 158, 255, 0.7);
}

/* Firefox Scrollbar */
html {
  scrollbar-color: var(--accent-color) rgba(18, 18, 24, 0.5);
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

/* Particles Background - Fixed */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  background: var(--darker-bg);
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
  animation-delay: 0.2s;
  pointer-events: none;
}

/* Container Structure */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.landing-content {
  text-align: center;
  padding: 2rem;
  max-width: 800px;
  animation: fadeIn 0.8s ease-out forwards;
}

.vibez-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--constant-blue);
  opacity: 0;
  animation: slideUp 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

.highlight {
  color: var(--highlight-color);
}

.tagline {
  font-size: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 3rem;
  opacity: 0;
  animation: slideUp 0.6s ease-out forwards;
  animation-delay: 0.5s;
}

.vibe-button {
  background: var(--constant-blue);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(78, 158, 255, 0.3);
  opacity: 0;
  transform: scale(0.95);
  animation: slideUp 0.6s ease-out forwards, 
             scaleIn 0.4s ease-out forwards;
  animation-delay: 0.7s;
  position: relative;
  overflow: hidden;
}

.vibe-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 20px rgba(78, 158, 255, 0.3);
}

.ripple {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* Enhanced Mode Modal with Backdrop */
.mode-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.mode-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  cursor: pointer;
}

.modal-content {
  background: linear-gradient(
    135deg,
    rgba(78, 158, 255, 0.2),
    rgba(106, 178, 255, 0.15)
  );
  padding: 3rem 2.5rem;
  border-radius: 24px;
  text-align: center;
  width: 100%;
  max-width: 450px;
  min-width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 20px rgba(255, 255, 255, 0.15);
  animation: modalAppear 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  z-index: 1001;
  position: relative;
}

.modal-content h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(45deg, #fff, #d1e5ff);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0.5px;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.mode-btn {
  padding: 1.4rem;
  border-radius: 14px;
  font-size: 1.25rem;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  border: none;
  cursor: pointer;
}

#chill-mode {
  background: linear-gradient(to right, var(--chill-color), #5fa8ff);
  color: white;
  box-shadow: 0 4px 15px rgba(78, 158, 255, 0.3);
}

#roast-mode {
  background: linear-gradient(to right, var(--roast-color), #ff8f8f);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.mode-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Chat Interface */
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background: rgba(18, 18, 24, 0.95);
  position: absolute;
  top: 0;
  left: 0;
  animation: fadeIn 0.4s ease-out;
  z-index: 1;
}

/* Updated Chat Header - Constant Dark Background */
.chat-header {
  background: #293241 !important;
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.chat-header h2 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  color: white !important;
}

.icon-button {
  background: transparent !important;
  border: none;
  color: white !important;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.icon-button:hover {
  transform: scale(1.1);
  background: transparent !important;
}

.icon-button:active {
  background: transparent !important;
}

/* Reset Button Styles */
.reset-button {
  background: none;
  border: none;
  color: white !important;
  opacity: 0.7;
  font-size: 1.1rem;
  padding: 0 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  align-self: center;
  margin-right: 0.5rem;
}

.reset-button:hover {
  opacity: 1;
  color: var(--highlight-color);
  transform: scale(1.1);
}

.reset-button:active {
  transform: scale(0.95);
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Message Alignment */
.message-container {
  display: flex;
  margin-bottom: 1.25rem;
  max-width: 90%;
  animation: messageAppear 0.3s ease-out;
}

.bot-message-container {
  justify-content: flex-start;
  margin-right: auto;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding-left: 35px;
}

.user-message-container {
  justify-content: flex-end;
  margin-left: auto;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
  position: relative;
  max-width: 100%;
  word-break: break-word;
  transition: transform 0.2s ease;
}

.bot-message {
  background: var(--bot-bubble);
  color: var(--text-color);
  border-bottom-right-radius: 4px !important;
  border-bottom-left-radius: 18px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-message {
  background: var(--user-bubble);
  color: white;
  border-bottom-left-radius: 4px !important;
  border-bottom-right-radius: 18px !important;
  box-shadow: 0 2px 8px rgba(78, 158, 255, 0.3);
}

.message-bubble:hover {
  transform: translateY(-2px);
}

.copy-btn-wrapper {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.copy-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--text-color);
  background: transparent;
}

.copy-btn i {
  font-size: 0.9rem;
}

.typing-indicator {
  display: inline-flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bot-bubble);
  border-radius: 18px;
  margin-bottom: 1rem;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  background-color: white;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.chat-input {
  display: flex;
  padding: 1rem;
  background: rgba(26, 26, 46, 0.95);
  border-top: 1px solid var(--glass-border);
  max-width: 1200px;
  margin: 0 auto 1rem;
  width: calc(100% - 2rem);
  border-radius: 25px;
  position: sticky;
  bottom: 0;
  transition: transform 0.3s ease;
  gap: 0.5rem;
}

.chat-input:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.chat-input input {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input input:focus {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px var(--primary-color);
}

#send-btn {
  transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  color: var(--primary-color);
  background: transparent !important;
}

#send-btn:hover {
  background: transparent !important;
  transform: scale(1.1);
  color: var(--secondary-color);
}

/* Confirmation Popup Styles */
.confirmation-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.confirmation-popup.hidden {
  display: none;
}

.popup-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2001;
}

.popup-content {
  background: var(--darker-bg);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  z-index: 2002;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  animation: modalAppear 0.3s ease-out;
}

.popup-content p {
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-color);
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.popup-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 1rem;
}

.confirm-btn {
  background: var(--roast-color);
  color: white;
}

.cancel-btn {
  background: var(--glass-bg);
  color: var(--text-color);
}

.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.confirm-btn:hover {
  background: #ff5252;
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-messages {
    padding: 1rem;
    padding-bottom: 150px;
  }
  
  .message-container {
    max-width: 95%;
  }
  
  .chat-input {
    border-radius: 0;
    margin-bottom: 0;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    gap: 0.3rem;
    padding: 0.8rem;
  }
  
  .reset-button {
    padding: 0 0.6rem;
    font-size: 1rem;
    margin-right: 0.3rem;
  }

  /* Mobile popup adjustments */
  .popup-content {
    padding: 1.5rem;
  }
  
  .popup-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .popup-btn {
    width: 100%;
  }
  
  #particles-js {
    pointer-events: none !important;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 2.5rem 1.5rem;
    max-width: 90vw;
    border-radius: 20px;
  }
  
  .modal-content h3 {
    font-size: 1.7rem;
    margin-bottom: 1.5rem;
  }
  
  .mode-btn {
    padding: 1.2rem;
    font-size: 1.1rem;
  }
  
  .reset-button {
    padding: 0 0.5rem;
  }
}

@media (max-width: 375px) {
  .modal-content {
    padding: 2rem 1.25rem;
  }
  
  .modal-content h3 {
    font-size: 1.5rem;
  }
  
  .mode-options {
    gap: 1.25rem;
  }

  .popup-content {
    padding: 1.25rem;
  }
  
  .popup-content p {
    font-size: 1rem;
  }
}

/* Floating particles interaction */
@media (hover: hover) {
  #particles-js {
    pointer-events: auto;
  }
}
