* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.container {
  display: flex;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* SIDEBAR */
.sidebar {
  width: 340px;
  background: white;
  padding: 32px 24px;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.profile {
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #6f93ff;
  margin: 0 auto 16px;
  display: block;
}

.profile h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #1a1a1a;
}

.profile .tagline {
  font-size: 14px;
  color: #6f93ff;
  font-weight: 600;
  margin-bottom: 16px;
}

.profile p {
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a4a;
  margin: 0;
  text-align: left;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e0e0e0, transparent);
  margin: 8px 0;
}

/* Mobile toggle button - hidden on desktop */
.mobile-toggle {
  display: none;
}

/* PRESET QUESTIONS IN SIDEBAR */
.preset-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.preset-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-btn {
  background: #f8f9fa;
  color: #2a2a2a;
  border: 2px solid #e8e8e8;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  line-height: 1.4;
}

.preset-btn:hover {
  background: #e8f0ff;
  border-color: #6f93ff;
  color: #1a1a1a;
  transform: translateX(4px);
}

.preset-btn:active {
  transform: translateX(2px);
}

/* CONTACT BUTTON IN SIDEBAR */
.sidebar-contact {
  margin-top: auto;
}

/* RESUME SECTION */
.resume-section {
  margin-top: 8px;
}

.resume-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.resume-downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resume-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  text-decoration: none;
  color: #2a2a2a;
  font-size: 13px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.resume-link:hover {
  background: #e8f0ff;
  border-color: #6f93ff;
  transform: translateX(4px);
}

.resume-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.resume-text {
  line-height: 1.3;
}

.contact-btn-sidebar {
  width: 100%;
  background: linear-gradient(135deg, #6f93ff 0%, #5a7cdb 100%);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(111, 147, 255, 0.3);
}

.contact-btn-sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 147, 255, 0.4);
}

/* MAIN CHAT AREA */
.main-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

/* CHAT HEADER */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
}

.chat-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.chat-utilities {
  display: flex;
  gap: 8px;
}

.util-btn {
  background: white;
  border: 2px solid #e0e0e0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
  font-weight: 500;
}

.util-btn:hover {
  background: #f5f7fa;
  border-color: #6f93ff;
  color: #6f93ff;
}

/* CHAT WINDOW */
.chat-window {
  flex: 1;
  background: white;
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar {
  width: 8px;
}

.chat-window::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-window::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-window::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* MESSAGE WRAPPERS */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 85%;
  animation: fadeSlideUp 0.4s ease-out;
}

.message-wrapper.user {
  align-self: flex-end;
}

.message-wrapper.bot {
  align-self: flex-start;
}

.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #6f93ff;
  flex-shrink: 0;
  margin-top: 4px;
}

/* BUBBLES */
.bubble {
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.6;
  font-size: 15px;
  position: relative;
  flex: 1;
}

.bubble.user {
  background: linear-gradient(135deg, #d7e7ff 0%, #c5d9ff 100%);
  color: #1a1a1a;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bubble.bot {
  background: #f8f9fa;
  color: #2a2a2a;
  border-bottom-left-radius: 4px;
  border-left: 3px solid #6f93ff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bubble p {
  margin: 0 0 12px 0;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.bubble ul:last-child {
  margin-bottom: 0;
}

.bubble li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.bubble li:last-child {
  margin-bottom: 0;
}

.bubble strong {
  font-weight: 600;
  color: #1a1a1a;
}

.bubble em {
  font-style: italic;
}

/* CITATIONS */
.citations {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  font-size: 13px;
  color: #666;
}

.citations-toggle {
  background: none;
  border: none;
  color: #6f93ff;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.citations-toggle:hover {
  color: #5a7cdb;
}

.citations-content {
  margin-top: 8px;
  padding: 10px;
  background: #f5f7fa;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.citation-item {
  margin-bottom: 6px;
}

.citation-item:last-child {
  margin-bottom: 0;
}

/* TYPING INDICATOR */
.typing-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 85%;
  align-self: flex-start;
  animation: fadeSlideUp 0.4s ease-out;
}

.typing {
  background: #f0f0f0;
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
  color: #666;
  border-left: 3px solid #6f93ff;
  flex: 1;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: blink 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* INPUT AREA */
.chat-input-area {
  display: flex;
  gap: 12px;
  background: white;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#userInput {
  flex: 1;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 12px;
  border: 2px solid #e8e8e8;
  transition: border-color 0.2s;
  font-family: inherit;
}

#userInput:focus {
  outline: none;
  border-color: #6f93ff;
}

#sendBtn {
  background: linear-gradient(135deg, #6f93ff 0%, #5a7cdb 100%);
  color: white;
  font-size: 15px;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(111, 147, 255, 0.3);
}

#sendBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(111, 147, 255, 0.4);
}

#sendBtn:active {
  transform: translateY(0);
}

/* TIMESTAMP */
.timestamp {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
  text-align: right;
}

/* CONTACT MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  color: #999;
  float: right;
  font-size: 28px;
  font-weight: bold;
  line-height: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #333;
}

.modal-content h2 {
  margin: 0 0 10px 0;
  color: #1a1a1a;
  font-size: 24px;
}

.modal-content p {
  margin: 0 0 20px 0;
  color: #666;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #2a2a2a;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6f93ff;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6f93ff 0%, #5a7cdb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(111, 147, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 147, 255, 0.4);
}

.btn-secondary {
  background: white;
  color: #666;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #f5f7fa;
  border-color: #6f93ff;
  color: #6f93ff;
}

.success-message {
  background: #e8f5e9;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-top: 20px;
}

.success-message p {
  margin: 0;
  color: #2e7d32;
  font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    max-height: none;
    padding: 20px 16px;
    overflow-y: visible;
    position: relative;
    transition: max-height 0.3s ease;
  }

  .sidebar.collapsed {
    max-height: 100px;
    overflow: hidden;
  }

  .sidebar.collapsed .profile p,
  .sidebar.collapsed .divider,
  .sidebar.collapsed .preset-section,
  .sidebar.collapsed .resume-section,
  .sidebar.collapsed .sidebar-contact {
    display: none;
  }

  .mobile-toggle {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    background: #6f93ff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(111, 147, 255, 0.3);
  }

  .mobile-toggle:active {
    transform: scale(0.95);
  }

  .avatar {
    width: 60px;
    height: 60px;
  }

  .profile h1 {
    font-size: 18px;
    padding-right: 80px;
  }

  .profile .tagline {
    font-size: 12px;
  }

  .profile p {
    font-size: 13px;
    line-height: 1.5;
  }

  .main-chat-area {
    flex: 1;
    padding: 12px;
    min-height: 60vh;
  }

  .chat-header {
    padding: 0 4px 8px 4px;
  }

  .chat-title {
    font-size: 16px;
  }

  .util-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .chat-window {
    padding: 16px 12px;
    min-height: 400px;
  }

  .message-wrapper {
    max-width: 95%;
  }

  .bubble {
    padding: 12px 14px;
    font-size: 14px;
  }

  .preset-questions {
    gap: 6px;
  }

  .preset-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .chat-input-area {
    padding: 12px;
    gap: 8px;
  }

  #userInput {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #sendBtn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .sidebar.collapsed {
    max-height: 90px;
  }

  .bot-avatar {
    width: 28px;
    height: 28px;
  }

  .bubble {
    font-size: 13px;
    padding: 10px 12px;
  }

  .modal-content {
    margin: 10% auto;
    padding: 20px;
    width: 95%;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}
