/* AI Assistant Styles - St. Lawrence Junior School Branding */
:root {
  /* School Brand Colors */
  --school-primary: #0b57d0;  /* Main blue color */
  --school-accent: #1a66d6;   /* Blue accent color */
  --school-light: #e3f0ff;    /* Light blue background */
  --school-dark: #333;     /* Dark text color */
  --school-white: #ffffff;    /* White background */
  
  /* Assistant Specific */
  --assistant-primary: var(--school-primary);
  --assistant-accent: var(--school-accent);
  --assistant-bg: var(--school-white);
  --assistant-text: var(--school-dark);
  --assistant-shadow: 0 8px 32px rgba(11, 87, 208, 0.15);
  --assistant-border: 1px solid rgba(11, 87, 208, 0.1);
  --assistant-radius: 12px;
  --assistant-spacing: 16px;
  --font-primary: 'Poppins', sans-serif;
}

/* Assistant Container */
.ai-assistant-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  font-family: var(--font-primary);
  max-width: 380px;
  width: 90%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 12px rgba(11, 87, 208, 0.2));
}

/* Assistant Toggle Button */
.assistant-toggle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--assistant-primary), var(--assistant-accent));
  color: white;
  border: 3px solid white;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(11, 87, 208, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  outline: none;
}

.assistant-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 30px rgba(26, 102, 214, 0.4);
}

.assistant-toggle i {
  font-size: 28px;
  transition: transform 0.3s ease;
}

.assistant-toggle.active {
  transform: rotate(90deg);
}

.assistant-toggle.active:hover {
  transform: rotate(90deg) scale(1.1);
}

/* Assistant Chat Window */
.assistant-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 100%;
  max-height: 70vh;
  background: var(--assistant-bg);
  border-radius: var(--assistant-radius);
  border: 1px solid rgba(11, 87, 208, 0.1);
  box-shadow: var(--assistant-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

.assistant-window.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Assistant Header with School Logo */
.assistant-header {
  background: linear-gradient(135deg, var(--assistant-primary), #1a66d6);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.assistant-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--assistant-accent), #1a66d6);
}

.assistant-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.assistant-header .school-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Messages Area */
.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--assistant-primary) transparent;
}

.assistant-messages::-webkit-scrollbar {
  width: 6px;
}

.assistant-messages::-webkit-scrollbar-track {
  background: transparent;
}

.assistant-messages::-webkit-scrollbar-thumb {
  background-color: var(--assistant-primary);
  border-radius: 3px;
}

/* Message Styling *//* Message Styling */
.message {
  margin: 8px 0;
  padding: 14px 18px;
  border-radius: 14px;
  line-height: 1.6;
  max-width: 85%;
  font-size: 15px;
  position: relative;
  word-wrap: break-word;
  animation: messageIn 0.3s ease-out forwards;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Assistant Message Styling */
.message.assistant {
  align-self: flex-start;
  background: #f8f9ff;
  color: #2c3e50;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(11, 87, 208, 0.15);
  margin-right: auto;
  margin-left: 12px;
}

/* User Message Styling */
.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b57d0, #1a66d6);
  color: white;
  border-bottom-right-radius: 6px;
  margin-left: auto;
  margin-right: 12px;
  box-shadow: 0 2px 12px rgba(11, 87, 208, 0.2);
}

/* Typography */
.message p {
  margin: 0.8em 0;
  line-height: 1.6;
}

.message p:first-child {
  margin-top: 0;
}

.message p:last-child {
  margin-bottom: 0;
}

/* Lists */
.message ul, 
.message ol {
  margin: 0.8em 0;
  padding-left: 24px;
}

.message li {
  margin-bottom: 6px;
  position: relative;
  line-height: 1.5;
}

.message ul li::before {
  content: '•';
  color: #0b57d0;
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* Headers */
.message h3, 
.message h4 {
  color: #0b57d0;
  margin: 1.2em 0 0.6em 0;
  font-weight: 600;
  position: relative;
}

.message h3 {
  font-size: 1.2em;
  border-bottom: 2px solid rgba(11, 87, 208, 0.1);
  padding-bottom: 6px;
  display: inline-block;
}

/* Animation */
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timestamp */
.message-time {
  display: block;
  font-size: 0.75em;
  opacity: 0.7;
  margin-top: 6px;
  text-align: right;
}

/* Special formatting for different content types */
.message .important {
  background: #fff8e6;
  border-left: 3px solid #ffc107;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}

.message .quote {
  border-left: 3px solid #0b57d0;
  padding-left: 14px;
  color: #555;
  font-style: italic;
  margin: 10px 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .message {
    max-width: 90%;
    font-size: 14px;
    padding: 12px 16px;
  }
}
.message {
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  max-width: 85%;
  font-size: 15px;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  animation: messageIn 0.3s ease-out forwards;
}

.message.assistant {
  align-self: flex-start;
  background: #f8f8f8;
  color: var(--school-dark);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(11, 87, 208, 0.1);
}

.message.assistant p {
  margin: 0.8em 0;
  line-height: 1.6;
}

.message.assistant p:first-child {
  margin-top: 0;
}

.message.assistant p:last-child {
  margin-bottom: 0;
}

.message.assistant h3,
.message.assistant h4 {
  color: var(--assistant-primary);
  margin: 1.2em 0 0.6em 0;
  font-weight: 600;
  font-size: 1.1em;
  position: relative;
  padding-bottom: 4px;
}

.message.assistant h3 {
  font-size: 1.2em;
  border-bottom: 2px solid var(--school-light);
  display: inline-block;
  padding-right: 12px;
}

.message.assistant ul,
.message.assistant ol {
  margin: 0.8em 0;
  padding-left: 24px;
}

.message.assistant li {
  margin-bottom: 6px;
  position: relative;
  line-height: 1.5;
}

.message.assistant ul li::before {
  content: '•';
  color: var(--assistant-primary);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.message.assistant .info-block {
  background: rgba(11, 87, 208, 0.05);
  border-left: 3px solid var(--assistant-primary);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

.message.assistant a {
  color: var(--assistant-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.message.assistant a:hover {
  border-bottom-color: var(--assistant-primary);
}

/* Staff List Styling */
.staff-list {
  margin: 12px 0;
}

.staff-category {
  margin-bottom: 15px;
}

.staff-category h4 {
  color: var(--assistant-primary);
  margin: 12px 0 8px 0;
  font-size: 1em;
  font-weight: 600;
}

.staff-member {
  display: flex;
  margin-bottom: 6px;
  align-items: flex-start;
}

.staff-role {
  font-weight: 600;
  color: var(--school-dark);
  min-width: 120px;
}

.staff-name {
  color: #555;
}

/* Subject List Styling */
.subject-category {
  margin-bottom: 15px;
}

.subject-category h4 {
  color: var(--assistant-primary);
  margin: 12px 0 8px 0;
  font-size: 1em;
  font-weight: 600;
}

.subject-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.subject-tag {
  background: rgba(11, 87, 208, 0.1);
  color: var(--assistant-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .message {
    max-width: 90%;
    font-size: 14px;
    padding: 10px 14px;
  }
  
  .staff-member {
    flex-direction: column;
  }
  
  .staff-role {
    margin-bottom: 2px;
  }
}

/* Typing Indicator */
.message.typing {
  background: #f8f8f8;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--assistant-primary);
  display: inline-block;
  animation: typingAnimation 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.assistant-input-area {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid rgba(11, 87, 208, 0.1);
  position: relative;
}

.assistant-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 4px 4px 4px 16px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(11, 87, 208, 0.1);
  transition: all 0.2s ease;
}

.assistant-input-wrapper:focus-within {
  border-color: var(--assistant-primary);
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.15);
}

.assistant-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--school-dark);
  outline: none;
}

.assistant-input::placeholder {
  color: #9e9e9e;
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--assistant-primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-button:hover {
  background: var(--assistant-accent);
  transform: translateY(-1px);
}

.send-button:active {
  transform: translateY(0);
}

.send-button i {
  font-size: 16px;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(11, 87, 208, 0.05);
  margin-bottom: 8px;
}

.quick-action {
  background: rgba(26, 102, 214, 0.05);
  border: 1px solid rgba(26, 102, 214, 0.1);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 12px;
  color: #1a66d6;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-action:hover {
  background: rgba(26, 102, 214, 0.1);
  transform: translateY(-1px);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .ai-assistant-container {
    right: 15px;
    bottom: 15px;
    width: calc(100% - 30px);
    max-width: none;
  }
  
  .assistant-toggle {
    width: 56px;
    height: 56px;
  }
  
  .assistant-window {
    max-height: 80vh;
    bottom: 70px;
  }
  
  .message {
    max-width: 90%;
    font-size: 15px;
  }
  
  .quick-actions {
    padding: 0 12px 10px;
  }
  
  .quick-action {
    font-size: 11px;
    padding: 5px 12px;
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
