/* ==========================================================================
   ACHARYA INSTITUTES - SEARCH & CHATBOT STYLESHEET (search.css)
   Includes: Live client-side JSON Search Modal, Result cards,
   and "Ask Simba" Mascot AI Chatbot Widget
   ========================================================================== */

/* --- Client-Side Search Modal --- */
.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 28, 68, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2050;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-modal-backdrop.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 1;
  padding-top: 60px;
}

.search-modal-box {
  background: #ffffff;
  width: 90%;
  max-width: 780px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-modal-backdrop.active .search-modal-box {
  transform: translateY(0);
}

.search-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f8fafc;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 16px;
  color: var(--acharya-navy);
  font-size: 1.2rem;
}

.search-modal-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-family: 'Open Sans', sans-serif;
}

.search-modal-input:focus {
  border-color: var(--acharya-orange);
  box-shadow: 0 0 0 3px rgba(244, 147, 35, 0.2);
}

.search-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.search-modal-close:hover {
  color: #fa0910;
  background: #fee2e2;
}

.search-filter-pills {
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-filter-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-filter-btn.active,
.search-filter-btn:hover {
  background: var(--acharya-navy);
  color: #ffffff;
  border-color: var(--acharya-navy);
}

.search-results-container {
  padding: 20px 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.search-result-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
  background: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
}

.search-result-card:hover {
  border-color: var(--acharya-orange);
  box-shadow: 0 4px 12px rgba(244, 147, 35, 0.15);
  transform: translateX(4px);
}

.search-result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.search-result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--acharya-navy);
  margin: 0;
}

.search-result-badge {
  background: #eef2ff;
  color: var(--acharya-navy);
  border: 1px solid #c7d2fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.search-result-dept {
  font-size: 0.82rem;
  color: var(--acharya-orange-dark);
  font-weight: 600;
  margin-bottom: 6px;
}

.search-result-desc {
  font-size: 0.88rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.4;
}

.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.search-no-results i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.search-highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 700;
}

/* --- "Ask Simba" Mascot Interactive Chatbot Widget --- */
.simba-chat-trigger {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.simba-chat-trigger:hover {
  transform: scale(1.05);
}

.simba-avatar-btn {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f49323, #d9770c);
  border: 3px solid #ffffff;
  box-shadow: 0 8px 25px rgba(244, 147, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.simba-avatar-img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.simba-online-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.simba-speech-bubble {
  background: #ffffff;
  color: var(--acharya-navy);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  font-weight: 700;
  font-size: 0.85rem;
  border-left: 3px solid var(--acharya-orange);
  white-space: nowrap;
  animation: bounce-speech 3s ease infinite;
}

@keyframes bounce-speech {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

/* Simba Chat Window */
.simba-chat-window {
  position: fixed;
  bottom: 100px;
  left: 25px;
  width: 360px;
  max-width: calc(100vw - 50px);
  height: 520px;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  z-index: 1060;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.simba-chat-window.active {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.simba-chat-header {
  background: linear-gradient(135deg, #223983 0%, #162659 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--acharya-orange);
}

.simba-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.simba-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--acharya-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.simba-header-info h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.simba-header-info span {
  font-size: 0.75rem;
  color: #a5b4fc;
}

.simba-chat-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.simba-chat-body {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simba-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.simba-msg-bot {
  background: #ffffff;
  color: #1e293b;
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  align-self: flex-start;
}

.simba-msg-user {
  background: var(--acharya-navy);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  align-self: flex-end;
}

.simba-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.simba-chip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: var(--acharya-navy);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.simba-chip:hover {
  background: var(--acharya-orange);
  color: #ffffff;
  border-color: var(--acharya-orange);
}

.simba-chat-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
}

.simba-chat-input {
  flex-grow: 1;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.88rem;
  outline: none;
}

.simba-chat-input:focus {
  border-color: var(--acharya-navy);
}

.simba-chat-send {
  background: var(--acharya-orange);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.simba-chat-send:hover {
  background: #d9770c;
  transform: scale(1.05);
}
