/* AutoDetective.ai - AI-Powered Automotive Mystery Solver */
/* "Elementary, my dear driver." */

/* CSS Variables - Detective Theme: Dark & Gold */
:root {
  --primary-color: #1a1a2e;
  --primary-dark: #16213e;
  --accent-color: #ffc107;
  --accent-dark: #e0a800;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --dark-color: #0f0f1a;
  --light-color: #f8f9fa;
  --border-radius: 0.5rem;
  --transition-speed: 0.2s;
}

/* Brand Styling */
.brand-text {
  font-family: 'Georgia', serif;
  letter-spacing: -0.5px;
}

.brand-ai {
  color: var(--accent-color);
  font-weight: 300;
}

/* Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
}

/* Hero Section - Detective Theme */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.hero-illustration {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Symptom Tags */
.symptom-tag {
  transition: all var(--transition-speed);
}

.symptom-tag.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.symptom-tag:hover {
  transform: translateY(-1px);
}

.symptom-categories {
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--light-color);
  border-radius: var(--border-radius);
}

/* Article Cards */
.article-card {
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid #e9ecef;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-card .card-title a:hover {
  color: var(--primary-color) !important;
}

/* Make and Category Cards */
.make-card,
.category-card {
  transition: all var(--transition-speed);
  border: 1px solid #e9ecef;
}

.make-card:hover,
.category-card:hover {
  background-color: var(--light-color);
  border-color: var(--primary-color);
}

.make-card .make-name {
  font-weight: 500;
  color: var(--dark-color);
}

.category-icon {
  flex-shrink: 0;
}

/* Case Card Styling */
.border-warning {
  border-width: 2px !important;
}

.card-header.bg-dark {
  border-bottom: 2px solid var(--accent-color);
}

/* Diagnosis Results - Case Report */
.diagnosis-results {
  animation: fadeIn 0.3s ease-in;
}

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

.severity-badge {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
}

.severity-low { background-color: #d1e7dd; color: #0f5132; }
.severity-medium { background-color: #fff3cd; color: #664d03; }
.severity-high { background-color: #f8d7da; color: #842029; }

.cause-card {
  border-left: 4px solid var(--accent-color);
  transition: all var(--transition-speed);
}

.cause-card:hover {
  background-color: var(--light-color);
}

.probability-bar {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.probability-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.probability-high .probability-fill { background-color: var(--danger-color); width: 90%; }
.probability-medium .probability-fill { background-color: var(--warning-color); width: 60%; }
.probability-low .probability-fill { background-color: var(--success-color); width: 30%; }

/* Article Page Styles */
.article-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light-color);
}

.article-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Diagnosis Summary Box */
.diagnosis-summary-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.summary-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-item .value {
  font-weight: 600;
  font-size: 1.1rem;
}

.summary-item .severity-low { color: var(--success-color); }
.summary-item .severity-medium { color: #e67e00; }
.summary-item .severity-high { color: var(--danger-color); }

/* Safety Warning Box */
.safety-warning-box {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid var(--danger-color);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.safety-warning-box h4 {
  color: var(--danger-color);
  margin-bottom: 0.5rem;
}

.safety-warning-box ul {
  margin-bottom: 0;
}

/* Table of Contents */
.table-of-contents {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.table-of-contents h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.table-of-contents ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.table-of-contents li {
  padding: 0.25rem 0;
}

.table-of-contents a {
  color: var(--secondary-color);
  text-decoration: none;
}

.table-of-contents a:hover {
  color: var(--primary-color);
}

/* FAQ Section */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--light-color);
}

.faq-item {
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: white;
  border: none;
  text-align: left;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.faq-question:hover {
  background-color: var(--light-color);
}

.faq-question[aria-expanded="true"] {
  background-color: var(--light-color);
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-icon {
  font-size: 1.25rem;
  font-weight: bold;
  transition: transform var(--transition-speed);
}

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-answer.show {
  padding: 1rem 1.25rem;
  max-height: 500px;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Utility Classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
  }

  .hero-illustration {
    display: none;
  }

  .symptom-categories {
    max-height: 200px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Chat Interface Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 550px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: #fafbfc;
}

.chat-message {
  max-width: 85%;
  padding: 0.875rem 1.125rem;
  border-radius: 1.25rem;
  animation: messageSlide 0.3s ease-out;
  line-height: 1.5;
}

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

.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  border-bottom-right-radius: 0.375rem;
}

.chat-message.assistant {
  align-self: flex-start;
  background-color: white;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 0.375rem;
}

.chat-message.system {
  align-self: center;
  background-color: #e8f4f8;
  font-size: 0.875rem;
  color: var(--secondary-color);
  border-radius: 0.5rem;
  max-width: 90%;
  text-align: center;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 1rem 1.25rem !important;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  animation: typing 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 typing {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Case Solved Card */
.diagnosis-ready-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-top: 0.5rem;
  color: white;
}

.diagnosis-ready-card h5 {
  color: var(--accent-color);
}

.diagnosis-ready-card ul {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.diagnosis-ready-card li {
  margin-bottom: 0.25rem;
}

/* Chat Input Area */
#chat-form {
  margin: 0;
}

#chat-input {
  border-radius: 1.5rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

#chat-form button[type="submit"] {
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Chat */
@media (max-width: 768px) {
  .chat-container {
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
  }

  .chat-message {
    max-width: 90%;
    padding: 0.75rem 1rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .diagnosis-ready-card {
    padding: 1rem;
  }

  .diagnosis-ready-card .d-flex.gap-2 {
    flex-direction: column;
  }

  .diagnosis-ready-card .btn {
    width: 100%;
  }
}

/* Cookie Consent Banner */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-top: 2px solid var(--accent-color);
  padding: 1rem 0;
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent.hiding {
  animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.cookie-text {
  color: #f8f9fa;
  font-size: 0.9rem;
}

.cookie-text a {
  text-decoration: underline;
}

.cookie-text a:hover {
  text-decoration: none;
}

@media (max-width: 768px) {
  .cookie-consent {
    padding: 1.25rem 0;
  }

  .cookie-text {
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .cookie-buttons {
    justify-content: center;
    width: 100%;
  }
}

/* Static Pages */
.static-page {
  min-height: 60vh;
}

.static-page h1 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.static-page h2 {
  color: var(--primary-dark);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.static-page h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.static-page p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.static-page ul, .static-page ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.static-page li {
  margin-bottom: 0.5rem;
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .share-section,
  .cta-section,
  .table-of-contents,
  .cookie-consent {
    display: none;
  }

  .article-content {
    max-width: 100%;
  }
}
