* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Times New Roman', Times, serif;
  background: linear-gradient(135deg, #f5f1e8 0%, #ede7d9 100%);
  min-height: 100vh;
  padding: 20px;
  padding-top: 50px;
}

.beta-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #2c2416;
  color: #f5f1e8;
  text-align: center;
  padding: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 2000;
  font-family: 'Times New Roman', Times, serif;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #f5f1e8;
  padding: 40px;
  border-radius: 16px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  color: #2c2416;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.modal-content p {
  color: #4a4238;
  margin-bottom: 15px;
  line-height: 1.8;
}

#app {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: #2c2416;
  margin-bottom: 30px;
}

.header-logo {
  max-width: 350px;
  height: auto;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  color: #5a5047;
  font-style: italic;
}

.quick-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.action-btn {
  padding: 14px 28px;
  border: 2px solid #2c2416;
  border-radius: 0;
  background: transparent;
  color: #2c2416;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #2c2416;
  color: #f5f1e8;
}

.action-btn.active {
  background: #2c2416;
  color: #f5f1e8;
}

.primary-btn {
  padding: 12px 30px;
  border: 2px solid #2c2416;
  border-radius: 0;
  background: #2c2416;
  color: #f5f1e8;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  background: #f5f1e8;
  color: #2c2416;
}

.secondary-btn {
  padding: 8px 16px;
  border: 2px solid #2c2416;
  border-radius: 0;
  background: transparent;
  color: #2c2416;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  background: #2c2416;
  color: #f5f1e8;
}

#lecture-selector {
  background: #f5f1e8;
  padding: 25px;
  border-radius: 0;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #d4cec0;
}

#lecture-selector h3 {
  color: #2c2416;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

#lecture-dropdown {
  width: 100%;
  padding: 12px;
  border: 2px solid #2c2416;
  border-radius: 0;
  font-size: 1rem;
  font-family: 'Times New Roman', Times, serif;
  margin-bottom: 15px;
  cursor: pointer;
  background: white;
  color: #2c2416;
}

#lecture-dropdown:focus {
  border-color: #8b6f47;
  outline: none;
}

#current-lecture {
  background: rgba(245, 241, 232, 0.95);
  padding: 15px 20px;
  border-radius: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid #d4cec0;
}

#lecture-name {
  font-weight: 600;
  color: #2c2416;
}

.chat-container {
  background: white;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
  border: 2px solid #d4cec0;
}

#chat-messages {
  height: 450px;
  overflow-y: auto;
  padding: 20px;
  background: #faf8f3;
}

.message {
  margin-bottom: 15px;
  padding: 15px 20px;
  border-radius: 0;
  max-width: 85%;
  line-height: 1.8;
  animation: fadeIn 0.3s ease;
  font-family: 'Times New Roman', Times, serif;
}

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

.message.user {
  background: #2c2416;
  color: #f5f1e8;
  margin-left: auto;
  border-radius: 0;
}

.message.assistant {
  background: white;
  color: #2c2416;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 90%;
  padding: 0;
  border: 1px solid #e0dcd4;
}

.assistant-wrapper {
  display: flex;
  gap: 12px;
  padding: 15px;
}

.message-avatar {
  width: 40px;
  height: 40px;
  background: #2c2416;
  color: #f5f1e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-content p {
  margin-bottom: 12px;
}

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

.gigiano-opener {
  color: #8b6f47;
  font-weight: 600;
}

.topic-change {
  background: #8b6f47;
  color: #f5f1e8;
  padding: 2px 8px;
  border-radius: 0;
  font-weight: 600;
  display: inline-block;
  margin: 2px 0;
}

.emphasis {
  background: #ede7d9;
  padding: 2px 6px;
  border-radius: 0;
  font-weight: 600;
}

.list-item {
  background: #faf8f3;
  padding: 10px 15px;
  margin: 8px 0;
  border-left: 3px solid #8b6f47;
  border-radius: 0;
}

.message.system {
  background: #ede7d9;
  color: #5a5047;
  text-align: center;
  max-width: 100%;
  font-size: 0.9rem;
  border: 1px solid #d4cec0;
}

.message.error {
  background: #f8e0e0;
  color: #6b2c2c;
  text-align: center;
  max-width: 100%;
  border: 1px solid #d4a9a9;
}

.input-container {
  display: flex;
  padding: 15px;
  background: white;
  border-top: 2px solid #d4cec0;
}

#message-input {
  flex: 1;
  padding: 15px;
  border: 2px solid #2c2416;
  border-radius: 0;
  font-size: 1rem;
  font-family: 'Times New Roman', Times, serif;
  margin-right: 10px;
  transition: border-color 0.3s ease;
}

#message-input:focus {
  border-color: #8b6f47;
  outline: none;
}

#message-input:disabled {
  background: #f5f1e8;
  cursor: not-allowed;
}

#send-btn {
  padding: 15px 30px;
  border: 2px solid #2c2416;
  border-radius: 0;
  background: #2c2416;
  color: #f5f1e8;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

#send-btn:hover:not(:disabled) {
  background: #8b6f47;
  border-color: #8b6f47;
}

#send-btn:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 15px 20px;
  background: white;
  border-radius: 0;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0dcd4;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #2c2416;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

footer {
  text-align: center;
  color: #5a5047;
  font-size: 0.85rem;
  margin-top: 30px;
}

footer p {
  margin-bottom: 5px;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  
  header h1 {
    font-size: 2.5rem;
  }

  .header-logo {
    max-width: 250px;
  }
  
  .quick-actions {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
  
  #chat-messages {
    height: 350px;
  }
  
  .message {
    max-width: 95%;
  }
}
