@tailwind base;
@tailwind components;
@tailwind utilities;

.bg-grid-dots {
    background-image: radial-gradient(circle, #3A344A 1px, transparent 1px);
    background-size: 20px 20px;
}
.bg-dots {
    background-image: radial-gradient(circle, #ECE0FC 1px, transparent 1px);
    background-size: 6px 6px;
}

.group:hover .group-hover\:translate-y-0 {
    transform: translateY(0);
}

.group:hover .group-hover\:text-indigo-500 {
    color: #3B82F6; /* Tailwind Indigo-500 */
}

.group:hover .group-hover\:text-chrysomela-500 {
    color: #3A344A;
}

.group:hover .group-hover\:shadow-xl {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.card {
    background: linear-gradient(135deg, #F9F2FF, #ECE0FC);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0 30px #9688B3; /* Glowing shadow */
    transform: translateY(-10px); /* Subtle lift effect */
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

.animate-fadeIn {
    animation: fadeIn 1.2s ease-out forwards;
}
/* Floating Animations */
@keyframes slowPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes slowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-rotate {
    animation: slowRotate 30s linear infinite;
}



/*
chat related
*/
/* Core container for mascot and chat */
.ai-friend-container {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 50;
}


.ai-mascot img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #F9F2FF;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

.ai-mascot img:hover {
  transform: scale(1.1);
}

.ai-mascot img.thinking {
  animation: pulse 1.5s infinite;
}

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

/* Chat Box */
#chat-box {
  width: 100%; 
  max-width: 400px; 
  min-height: 300px; 
  max-height: 75vh; 
  position: fixed;
  bottom: 0px;
  right: 70px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: transform 0.4s ease-in-out;
}

.chat-box.hidden {
  transform: translateY(100%);
}

.chat-box.show {
  bottom: 60px;
  transform: translateY(0);
}

/* Chat Header */
.chat-header {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  height: 60px;
}

.chat-body {
  flex-grow: 1;
  overflow-y: auto; 
  padding: 1rem;
}

.message {
  display: flex;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.user-message {
  justify-content: flex-end;
  background: linear-gradient(135deg, #5B21B6, #7C3AED);
  color: #fff;
}

.ai-response {
  justify-content: flex-start;
  background: linear-gradient(135deg, #F9F2FF, #FFFAF0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chat-footer {
  display: flex;
  align-items: center;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  height: 70px;
}

.chat-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 20px;
  font-size: 16px;
  transition: border-color 0.3s ease-in-out;
}

.chat-input:focus {
  border-color: #7C3AED;
}

.chat-input::placeholder {
  color: #888;
}

.character-counter {
  font-size: 12px;
  color: #888;
}

input:disabled,
button:disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.7;
}

.chat-link {
  color: #5B21B6;
  font-weight: bold;
  position: relative;
}

.chat-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px; 
  width: 0;
  height: 2px;
  background-color: #7C3AED; 
  transition: width 0.3s ease-in-out;
}

.chat-link:hover::after {
  width: 100%; 
}

.button {
  background-color: #7C3AED;
  border-radius: 8px;
  color: #fff;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.button:hover {
  background-color: #5B21B6;
  transform: scale(1.05);
}

/* Quick Actions */
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E5E7EB;
}

.quick-action-btn {
  padding: 8px 16px;
  background-color: #F3F4F6;
  border-radius: 20px;
  font-size: 14px;
  color: #111827;
  border: 1px solid #D1D5DB;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.quick-action-btn:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
  transform: translateY(-2px);
}

.quick-action-btn:active {
  transform: translateY(0);
}

/* 📱 Mobile Styles (For Small Screens) */
@media (max-width: 640px) {
  .ai-mascot img {
    width: 60px;
    height: 60px;
  }

  #chat-box {
    width: 100vw;
    height: 72vh;
    bottom: 0px;
    right: 0px;
    border-radius: 0;
    max-height: none;
  }

  .chat-header {
    height: 50px;
    padding: 12px;
    font-size: 14px;
  }

  .chat-body {
    padding: 0.5rem;
  }

  .chat-footer {
    height: 60px;
    padding: 8px;
  }

  .chat-input {
    font-size: 14px;
    padding: 8px;
  }

  .quick-action-btn {
    flex: 1 1 45%; /* 2 buttons per row */
    text-align: center;
    padding: 8px;
  }

  .message {
    font-size: 14px;
    padding: 8px;
  }
}
