/* Modern Red/Black Minimal Design for Graxo Chatbot */

:root {
  --primary-red: #890339;
  --dark-red: #4b0c24;
  --light-red: #a90544;
  --accent-red: #c86d90;
  --black: #000000;
  --dark-gray: #1f1f1f;
  --medium-gray: #374151;
  --light-gray: #6b7280;
  --white: #ffffff;
  --off-white: #f9fafb;
  --border-light: #e5e7eb;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 20px 25px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--medium-gray);
}

.logo-container {
  display: inline-block;
}

.logo {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.3));
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(220, 38, 38, 0.4));
}

/* Navigation */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 2rem 1rem 0;
  background: var(--dark-gray);
  border-radius: var(--border-radius);
  padding: 4px;
  box-shadow: var(--shadow-medium);
}

.nav-tab {
  flex: 1;
  max-width: 200px;
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  color: var(--light-gray);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-radius: calc(var(--border-radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.nav-tab:hover {
  color: var(--white);
  background: rgba(220, 38, 38, 0.1);
}

.nav-tab.active {
  background: var(--primary-red);
  color: var(--white);
  box-shadow: var(--shadow-light);
}

.nav-tab i {
  font-size: 1.1rem;
}

/* Sections */
.section {
  display: none;
  flex: 1;
  padding: 2rem 1rem;
}

.section.active {
  display: flex;
  flex-direction: column;
}

/* Chatbot Container */
.chatbot-container {
  background: var(--dark-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-heavy);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 600px;
  margin-bottom: 2rem;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--black);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--dark-gray);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 3px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.message.bot .message-avatar {
  background: var(--primary-red);
  color: var(--white);
}

.message.user .message-avatar {
  background: var(--white);
  color: var(--black);
}

.message-content {
  max-width: 80%;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  position: relative;
  word-wrap: break-word;
}

.message.bot .message-content {
  background: var(--medium-gray);
  color: var(--white);
  border-bottom-left-radius: 0.25rem;
}

.message.user .message-content {
  background: var(--primary-red);
  color: var(--white);
  border-bottom-right-radius: 0.25rem;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.option-btn {
  background: var(--primary-red);
  color: var(--white);
  border: 2px solid var(--primary-red);

  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-weight: 500;
}

.option-btn:hover {
  background: var(--light-red);
  color: var(--white);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(169, 5, 68, 0.6), 0 0 20px rgba(169, 5, 68, 0.3),
    var(--shadow-heavy);
  border-color: var(--light-red);
}

.option-btn.selected {
  background: var(--primary-red);
  color: var(--white);
}

/* Chat Input */
.chat-input-container {
  padding: 1.5rem;
  border-top: 1px solid var(--medium-gray);
  background: var(--dark-gray);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--light-gray);
  font-size: 0.9rem;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary-red);
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

#userInput {
  flex: 1;
  padding: 1rem 1.25rem;
  border: 2px solid var(--medium-gray);
  border-radius: 2rem;
  background: var(--black);
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

#userInput:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#userInput::placeholder {
  color: var(--light-gray);
}

#sendButton {
  width: 48px;
  height: 48px;
  background: var(--primary-red);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

#sendButton:hover:not(:disabled) {
  background: var(--dark-red);
  transform: scale(1.05);
}

#sendButton:disabled {
  background: var(--medium-gray);
  cursor: not-allowed;
  transform: none;
}

/* Progress Bar */
.progress-container {
  background: var(--dark-gray);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--medium-gray);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-red) 0%,
    var(--light-red) 100%
  );
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
}

/* Start Button */
.start-btn {
  align-self: center;
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  border-radius: 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.start-btn:hover {
  background: var(--dark-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.start-btn i {
  font-size: 1.2rem;
}

/* Responses Section */
.responses-container {
  flex: 1;
}

.responses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--medium-gray);
}

.responses-header h2 {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
}

.responses-actions {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-red);
  background: transparent;
  color: var(--primary-red);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  background: var(--primary-red);
  color: var(--white);
}

.action-btn.danger {
  border-color: var(--light-red);
  color: var(--light-red);
}

.action-btn.danger:hover {
  background: var(--light-red);
  color: var(--white);
}

/* Stats Cards */
.responses-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--dark-gray);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--medium-gray);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--light-gray);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Responses List */
.responses-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.response-item {
  background: var(--dark-gray);
  border: 1px solid var(--medium-gray);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.response-item:hover {
  border-color: var(--primary-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.response-header {
  display: flex;
  justify-content: between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.response-title {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.response-meta {
  color: var(--light-gray);
  font-size: 0.9rem;
}

.response-preview {
  color: var(--light-gray);
  font-size: 0.9rem;
  line-height: 1.4;
}

.response-status {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: auto;
}

.response-status.completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.response-status.incomplete {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--dark-gray);
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--medium-gray);
}

.modal-header h3 {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--light-gray);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--medium-gray);
  color: var(--white);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 60vh;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--white);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius);
  background: var(--black);
  color: var(--white);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--light-gray);
}

.submit-btn {
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.submit-btn:hover {
  background: var(--dark-red);
  transform: translateY(-1px);
}

/* Contact Form in Chat */
.contact-form {
  background: var(--dark-gray);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--primary-red);
  margin-top: 1rem;
}

.contact-form h3 {
  color: var(--white);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-form p {
  color: var(--light-gray);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingAnimation {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-container {
    padding: 0;
  }

  .header {
    padding: 1.5rem 1rem;
  }

  .logo {
    height: 60px;
  }

  .nav-tabs {
    margin: 1rem;
  }

  .nav-tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .section {
    padding: 1rem;
  }

  .chatbot-container {
    max-height: 500px;
  }

  .message-content {
    max-width: 90%;
  }

  .responses-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .responses-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .responses-stats {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  .nav-tab span {
    display: none;
  }

  .action-btn span {
    display: none;
  }

  .start-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--light-gray);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--medium-gray);
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--white);
}

/* Additional Modal Styles */
.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--medium-gray);
}

.section-group {
  margin-bottom: 2rem;
}

.section-group h4 {
  color: var(--primary-red);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item label {
  color: var(--light-gray);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-item span {
  color: var(--white);
  font-size: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--medium-gray);
}

.assessment-details {
  color: var(--white);
}

/* Security Notice */
.security-notice {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--primary-red);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--accent-red);
  font-size: 0.9rem;
}

.security-notice i {
  margin-right: 0.5rem;
}
