/* Blue Fermion Consulting - Combined Styles */
/* Combines main site styles with article-specific enhancements */

/* ========================================
   CSS VARIABLES & ROOT STYLES
   ======================================== */
:root {
  --mdc-theme-primary: #1DA7A0;
  --mdc-theme-secondary: #123C6B;
  --mdc-theme-surface: #F8FAFC;
  --mdc-theme-background: #FFFFFF;
  --mdc-theme-on-primary: #FFFFFF;
  --mdc-theme-on-secondary: #FFFFFF;
  --mdc-theme-on-surface: #212121;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  background-color: var(--mdc-theme-surface);
  color: var(--mdc-theme-on-surface);
  line-height: 1.6;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

/* Custom Material Design Header */
.mdc-top-app-bar {
  background-color: var(--mdc-theme-secondary);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.mdc-top-app-bar__title {
  display: flex;
  align-items: center;
  font-weight: 500;
}

.logo {
  height: 32px;
  margin-right: 12px;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: auto;
}

.nav-menu li {
  margin-left: 24px;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  margin-left: auto;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--mdc-theme-secondary);
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-menu li {
    margin: 8px 0;
  }

  .mobile-nav-toggle {
    display: block;
  }
}

/* ========================================
   ARTICLE PAGE SPECIFIC STYLES
   ======================================== */

/* Article Page Layout */
.article-page {
  background-color: #ffffff;
  line-height: 1.7;
}

.article-page .logo-text {
  font-weight: 500;
  margin-left: 8px;
}

/* Article Hero Section */
.article-hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 80px 0 40px;
  position: relative;
}

.article-hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}

.breadcrumb a {
  color: var(--mdc-theme-primary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .material-icons {
  font-size: 16px;
  color: #999;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.article-category {
  background: linear-gradient(135deg, var(--mdc-theme-primary), #16a085);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-reading-time {
  color: var(--mdc-theme-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-reading-time::before {
  content: "schedule";
  font-family: "Material Icons";
  font-size: 16px;
}

/* Main Article Layout */
.article-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  position: relative;
}

@media (min-width: 1024px) {
  .article-main {
    grid-template-columns: 1fr 300px;
    padding: 0 24px 0 320px; /* Make room for fixed TOC */
  }
}

/* Table of Contents */
.toc-sidebar {
  display: none;
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-height: 60vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  z-index: 100;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .toc-sidebar {
    display: block;
  }
}

.toc-container {
  padding: 24px;
}

.toc-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mdc-theme-secondary);
}

.toc-title .material-icons {
  font-size: 20px;
}

.toc-nav {
  font-size: 14px;
}

.toc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-nav li {
  margin: 0;
  padding: 0;
}

.toc-nav a {
  display: block;
  padding: 8px 0;
  color: #666;
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: 12px;
  transition: all 0.3s ease;
  line-height: 1.4;
}

.toc-nav a:hover {
  color: var(--mdc-theme-primary);
  border-left-color: var(--mdc-theme-primary);
  background-color: rgba(29, 167, 160, 0.05);
}

.toc-nav a.active {
  color: var(--mdc-theme-primary);
  border-left-color: var(--mdc-theme-primary);
  background-color: rgba(29, 167, 160, 0.1);
  font-weight: 500;
}

.toc-nav .toc-h3 a {
  padding-left: 24px;
  font-size: 13px;
}

.toc-nav .toc-h4 a {
  padding-left: 36px;
  font-size: 12px;
}

/* Article Content */
.article-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.article-body {
  padding: 48px;
}

@media (max-width: 768px) {
  .article-body {
    padding: 32px 24px;
  }
}

/* ========================================
   HERO SECTION (MAIN SITE)
   ======================================== */

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--mdc-theme-primary), var(--mdc-theme-secondary));
  color: white;
  padding: 120px 0 80px;
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/static/assets/hero.png') center/cover;
  opacity: 0.1;
  z-index: -1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  margin-bottom: 24px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 32px;
  opacity: 0.9;
}

/* ========================================
   MARKDOWN TYPOGRAPHY
   ======================================== */

/* Enhanced Markdown Typography */
.markdown-body {
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: #2c3e50;
}

.markdown-body h1 {
  font-family: 'Roboto Slab', serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 32px 0;
  color: var(--mdc-theme-secondary);
  position: relative;
}

.markdown-body h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, var(--mdc-theme-primary), #16a085);
  border-radius: 2px;
}

.markdown-body h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 48px 0 24px 0;
  color: var(--mdc-theme-secondary);
  position: relative;
}

.markdown-body h2::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--mdc-theme-primary);
  border-radius: 2px;
}

.markdown-body h3 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 32px 0 16px 0;
  color: var(--mdc-theme-secondary);
}

.markdown-body h4 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 24px 0 12px 0;
  color: var(--mdc-theme-secondary);
}

.markdown-body p {
  margin: 0 0 24px 0;
  text-align: justify;
}

.markdown-body strong {
  font-weight: 600;
  color: var(--mdc-theme-secondary);
}

.markdown-body em {
  font-style: italic;
  color: #555;
}

.markdown-body a {
  color: var(--mdc-theme-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.markdown-body a:hover {
  border-bottom-color: var(--mdc-theme-primary);
}

/* Enhanced Lists */
.markdown-body ul,
.markdown-body ol {
  margin: 24px 0;
  padding-left: 32px;
}

.markdown-body li {
  margin: 12px 0;
  line-height: 1.7;
}

.markdown-body ul li::marker {
  color: var(--mdc-theme-primary);
}

.markdown-body ol li::marker {
  color: var(--mdc-theme-primary);
  font-weight: 600;
}

/* Enhanced Blockquotes */
.markdown-body blockquote {
  margin: 32px 0;
  padding: 24px 32px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-left: 4px solid var(--mdc-theme-primary);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  position: relative;
}

.markdown-body blockquote::before {
  content: '"';
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 48px;
  color: var(--mdc-theme-primary);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.markdown-body blockquote p {
  margin: 0;
  padding-left: 24px;
}

/* Enhanced Code Blocks */
.markdown-body code {
  background: #f1f2f6;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  color: #e74c3c;
  font-weight: 500;
}

.markdown-body pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 32px 0;
  position: relative;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.6;
}

/* Enhanced Images */
.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin: 32px 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.markdown-body img:hover {
  transform: scale(1.02);
}

/* Enhanced Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 32px 0;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 16px;
  background: white;
  min-width: 600px;
}

.markdown-body th {
  background: linear-gradient(135deg, var(--mdc-theme-primary), #16a085);
  color: white;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  border: none;
}

.markdown-body td {
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
  border-left: none;
  border-right: none;
}

.markdown-body tr:nth-child(even) {
  background: #f8f9fa;
}

.markdown-body tr:hover {
  background: rgba(29, 167, 160, 0.05);
}

/* ========================================
   MATERIAL DESIGN CARDS & FEATURES
   ======================================== */

/* Material Design Cards */
.features-section {
  padding: 80px 24px;
  background-color: var(--mdc-theme-background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.mdc-card {
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mdc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.feature-card {
  padding: 32px 24px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background-color: var(--mdc-theme-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: white;
  font-size: 28px;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--mdc-theme-secondary);
}

.feature-card p {
  color: #666;
  line-height: 1.6;
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

/* Form Styles */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
}

.form-field {
  position: relative;
  margin-bottom: 32px;
}

.form-label {
  position: absolute;
  top: 16px;
  left: 0;
  font-size: 16px;
  color: #666;
  transition: all 0.3s ease;
  pointer-events: none;
  background-color: var(--mdc-theme-surface);
  padding: 0 4px;
}

.form-input {
  width: 100%;
  padding: 16px 0 8px 0;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #e0e0e0;
  background-color: transparent;
  outline: none;
  transition: border-color 0.3s ease;
  font-family: 'Roboto', sans-serif;
}

.form-input:focus {
  border-bottom-color: var(--mdc-theme-primary);
}

.form-input:focus + .form-underline::after {
  transform: scaleX(1);
}

/* When the field is focused OR has content, float the label */
.form-field.focused .form-label,
.form-field.filled .form-label {
  top: -8px;
  font-size: 12px;
  color: var(--mdc-theme-primary);
  font-weight: 500;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  padding-top: 24px;
}

.form-underline {
  position: relative;
  height: 2px;
  margin-top: -2px;
}

.form-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--mdc-theme-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.form-actions {
  text-align: center;
  margin-top: 40px;
}

.submit-button {
  background: linear-gradient(135deg, var(--mdc-theme-primary), #16a085);
  color: white;
  border: none;
  padding: 16px 48px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(29, 167, 160, 0.3);
  position: relative;
  overflow: hidden;
  min-width: 200px;
  font-family: 'Roboto', sans-serif;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 167, 160, 0.4);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.form-message {
  display: none;
  padding: 20px;
  border-radius: 8px;
  margin-top: 24px;
  align-items: flex-start;
  gap: 12px;
}

.form-message.show {
  display: flex;
}

.success-message {
  background-color: #e8f5e8;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.error-message {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.form-message .material-icons {
  margin-top: 2px;
}

.form-message strong {
  display: block;
  margin-bottom: 4px;
}

.form-message p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

/* Form Divider */
.form-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: #666;
  font-size: 14px;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.form-divider span {
  padding: 0 16px;
}

/* Form validation styles */
.form-input:invalid:not(:focus):not(:placeholder-shown) {
  border-bottom-color: #f44336;
}

.form-input:invalid:not(:focus):not(:placeholder-shown) ~ .form-label {
  color: #f44336;
}

/* ========================================
   AI CHAT WIDGET STYLES
   ======================================== */

/* AI Agent Widget Styles */
.ai-response, .ai-error {
  animation: slideIn 0.5s ease-out;
}

/* Base chat window and input styling */
.chat-window {
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  max-width: 70%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;  
}
.chat-message p {
  margin: 0 0 0.5rem;
}
.chat-message p:last-child {
  margin-bottom: 0;
}
.chat-message ul,
.chat-message ol {
  margin: 0 0 0.5rem 1.25rem;
  padding-left: 1rem;
}
.chat-message ul:last-child,
.chat-message ol:last-child {
  margin-bottom: 0;
}
.chat-message li {
  margin-bottom: 0.25rem;
}
.chat-message li:last-child {
  margin-bottom: 0;
}
.chat-message.user {
  align-self: flex-end;
  background: #DCF8C6;
}
.chat-message.agent {
  align-self: flex-start;
  background: #F1F0F0;
}

.chat-category {
  font-size: 0.65rem;
  color: #666;
  margin-top: 4px;
  text-align: right;
}

.chat-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 20px;
  resize: none;
  font-size: 1rem;
  min-height: 44px; /* Ensure minimum touch target size */
}

.chat-send-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 20px;
  background: var(--mdc-theme-primary);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  min-height: 44px; /* Ensure minimum touch target size */
  min-width: 80px;
  flex-shrink: 0;
}

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

.form-input select {
  cursor: pointer;
}

.form-input select:focus {
  outline: none;
}

/* Chat Fullscreen Toggle - MOBILE INTERACTION FIXED */
.ai-chat-card {
  position: relative;
  transition: all 0.3s ease;
  padding: 1rem;
}

.chat-size-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 10;
  color: #666;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Desktop hover effect */
@media (hover: hover) and (pointer: fine) {
  .chat-size-btn:hover {
    background-color: rgba(0,0,0,0.1);
  }
}

/* Mobile touch effect - only show background briefly on active/focus */
@media (hover: none) and (pointer: coarse) {
  .chat-size-btn:active,
  .chat-size-btn:focus {
    background-color: rgba(0,0,0,0.15);
  }
}

/* Fullscreen styles with better mobile support */
.ai-chat-card.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  z-index: 2000 !important;
  border-radius: 0 !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  max-width: none !important;
  padding: 20px !important;
  box-shadow: none !important;
}

.ai-chat-card.fullscreen .chat-window {
  flex: 1 !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 1rem !important;
}

.ai-chat-card.fullscreen .chat-input-container {
  flex-shrink: 0 !important;
  margin-top: auto !important;
  position: relative !important;
  bottom: 0 !important;
}

/* Fixed button dimensions for fullscreen mode - NO permanent background */
.ai-chat-card.fullscreen .chat-size-btn {
  width: 48px !important;
  height: 48px !important;
  top: 16px !important;
  right: 16px !important;
  background: none !important; /* No permanent background */
  font-size: 1.5rem !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  color: #333 !important; /* Darker color for better visibility */
}

/* Desktop hover for fullscreen button */
@media (hover: hover) and (pointer: fine) {
  .ai-chat-card.fullscreen .chat-size-btn:hover {
    background-color: rgba(0,0,0,0.1) !important;
  }
}

/* Mobile touch effect for fullscreen button - permanent background for visibility */
@media (hover: none) and (pointer: coarse) {
  .ai-chat-card.fullscreen .chat-size-btn {
    background-color: rgba(0,0,0,0.1) !important; /* Permanent background on mobile */
  }
  
  .ai-chat-card.fullscreen .chat-size-btn:active,
  .ai-chat-card.fullscreen .chat-size-btn:focus {
    background-color: rgba(0,0,0,0.2) !important; /* Darker when pressed */
  }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .ai-chat-card.fullscreen {
    padding: 16px !important;
    padding-top: 60px !important;
  }
  
  .ai-chat-card.fullscreen .chat-size-btn {
    width: 48px !important;
    height: 48px !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(0,0,0,0.1) !important; /* Permanent background on mobile for visibility */
    font-size: 1.5rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    min-width: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    color: #333 !important;
  }
  
  .ai-chat-card.fullscreen .chat-input-container {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    padding: 16px 0 !important;
    margin: 0 !important;
    border-top: 1px solid #eee !important;
  }
  
  .ai-chat-card.fullscreen .chat-window {
    height: calc(100% - 140px) !important;
    max-height: calc(100vh - 220px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .chat-input {
    font-size: 16px !important;
    min-height: 48px !important;
  }
  
  .chat-send-btn {
    min-height: 48px !important;
    min-width: 80px !important;
    padding: 12px 20px !important;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .ai-chat-card.fullscreen {
    height: 100vh !important;
    height: -webkit-fill-available !important;
  }
  
  @media (max-width: 768px) {
    .ai-chat-card.fullscreen .chat-window {
      height: calc(100vh - 220px) !important;
      height: calc(-webkit-fill-available - 220px) !important;
    }
  }
}

body.chat-fullscreen {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 768px) {
  body.chat-fullscreen {
    touch-action: none !important;
  }
  
  .ai-chat-card.fullscreen * {
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Floating Chat Button */
.chat-float-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1500;
  background: var(--mdc-theme-primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
}

/* Full Screen Chat Modal */
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.chat-modal.show {
  display: flex;
}

.chat-modal-content {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 1rem;
}

.chat-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========================================
   ARTICLE FOOTER & SHARING
   ======================================== */

/* Article Footer */
.article-footer {
  background: #f8f9fa;
  padding: 48px;
  border-top: 1px solid #e0e0e0;
}

.article-footer p {
  color: var(--mdc-theme-on-surface);
}

.article-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 48px;
}

.social-share {
  display: flex;
  align-items: center;
  gap: 16px;
}

.share-label {
  font-weight: 500;
  color: var(--mdc-theme-secondary);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: white;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
  background: var(--mdc-theme-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 167, 160, 0.3);
}

/* Offering Signup Notice */
.offering-signup p {
  color: var(--mdc-theme-secondary);
  font-weight: 500;
  margin-bottom: 16px;
}

/* Call to Action Section */
.article-cta {
  background: linear-gradient(135deg, var(--mdc-theme-primary), #16a085);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: white;
}

.article-cta h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.article-cta p {
  font-size: 1.1rem;
  margin: 0 0 32px;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 24px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 160px;
  justify-content: center;
  box-sizing: border-box;
}

.cta-btn-primary {
  background: white;
  color: var(--mdc-theme-primary);
}

.cta-btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cta-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
}

.cta-btn-secondary:hover {
  background: white;
  color: var(--mdc-theme-primary);
  transform: translateY(-2px);
}

/* Related Articles */
.related-articles {
  margin-top: 64px;
  padding: 48px;
  background: #f8f9fa;
  border-radius: 12px;
}

.related-articles h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 32px;
  color: var(--mdc-theme-secondary);
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.related-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.related-card:hover {
  transform: translateY(-4px);
}

.related-card h4 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.related-card h4 a {
  color: var(--mdc-theme-secondary);
  text-decoration: none;
}

.related-card h4 a:hover {
  color: var(--mdc-theme-primary);
}

.related-card p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ========================================
   READING PROGRESS & FLOATING ELEMENTS
   ======================================== */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--mdc-theme-primary), #16a085);
  width: 0%;
  transition: width 0.3s ease;
}

/* Floating Action Button */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--mdc-theme-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 167, 160, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
}

.fab.visible {
  opacity: 1;
  transform: scale(1);
}

.fab:hover {
  background: #16a085;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(29, 167, 160, 0.4);
}

/* Sticky Sign Up Button */
.signup-fixed-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1001;
}

.signup-fixed-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  background: var(--mdc-theme-primary);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 167, 160, 0.3);
  transition: background 0.3s ease;
}

.signup-fixed-btn:hover {
  background: #16a085;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

/* Footer */
footer {
  background-color: var(--mdc-theme-secondary);
  color: white;
  padding: 32px 24px;
  text-align: center;
  margin-top: 80px;
}

/* Enhanced Footer */
.site-footer {
  background: var(--mdc-theme-secondary);
  color: white;
  margin-top: 80px;
  padding: 48px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 32px;
}

.footer-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--mdc-theme-primary);
}

.footer-section p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-section ul li {
  margin: 8px 0;
}

.footer-section ul li a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-section ul li a:hover {
  opacity: 1;
  color: var(--mdc-theme-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  text-align: center;
  opacity: 0.8;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

/* Responsive Typography */
.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 24px;
  color: var(--mdc-theme-secondary);
}

.section-subtitle {
  font-size: 1.125rem;
  text-align: center;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   UTILITY CLASSES & ANIMATIONS
   ======================================== */

/* Button Animations */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.mdc-button--raised {
  position: relative;
  overflow: hidden;
}

.mdc-button--raised::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mdc-button--raised:active::before {
  width: 300px;
  height: 300px;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

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

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Code Copy Button */
.code-block {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 14px;
}

.code-block:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Utility Classes */
.elevation-2 {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.elevation-4 {
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.text-center {
  text-align: center;
}

.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }
.py-5 { padding: 40px 0; }

/* Page Specific Styles */
.page-content {
  padding-top: 80px;
  min-height: calc(100vh - 200px);
}

.about-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.values-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 32px 0;
}

.value-chip {
  background-color: var(--mdc-theme-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 16px;
  font-weight: 500;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Responsive form adjustments */
@media (max-width: 600px) {
  .contact-form {
    padding: 20px 16px;
  }
  
  .submit-button {
    width: 100%;
    padding: 16px 24px;
  }
}

/* Responsive adjustments for AI widget */
@media (max-width: 600px) {
  .ai-agent-form {
    padding: 20px 16px;
  }
  
  .ai-agent-form .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Mobile Responsive Adjustments for Articles */
@media (max-width: 768px) {
  .article-main {
    padding: 0 16px;
  }
  
  .article-hero {
    padding: 100px 0 24px;
  }
  
  .article-hero-content {
    padding: 0 16px;
  }
  
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .markdown-body {
    font-size: 16px;
  }
  
  .markdown-body h1 {
    font-size: 2rem;
  }
  
  .markdown-body h2 {
    font-size: 1.5rem;
    margin: 32px 0 16px 0;
  }
  
  .markdown-body h2::before {
    display: none;
  }
  
  .article-footer {
    padding: 32px 24px;
  }
  
  .article-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .social-share {
    justify-content: center;
    width: 100%;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  .cta-btn {
    width: 100%;
    box-sizing: border-box;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .fab-container {
    bottom: 16px;
    right: 16px;
  }

  .fab {
    width: 48px;
    height: 48px;
  }

  .signup-fixed-container {
    top: 72px;
    right: 16px;
  }
  
  .table-wrapper {
    margin: 24px -24px; /* Extend to screen edges on mobile */
    border-radius: 0;
  }
  
  .markdown-body table {
    min-width: 500px; /* Ensure horizontal scroll on mobile */
  }
}


/* ========================================
   PRINT STYLES
   ======================================== */

/* Print Styles */
@media print {
  .mdc-top-app-bar,
  .toc-sidebar,
  .fab-container,
  .signup-fixed-container,
  .reading-progress,
  .article-footer,
  .related-articles,
  .site-footer {
    display: none !important;
  }
  
  .article-main {
    grid-template-columns: 1fr;
    padding: 0;
    max-width: none;
  }
  
  .article-content {
    box-shadow: none;
    border: none;
  }
  
  .article-body {
    padding: 0;
  }
  
  .markdown-body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .markdown-body h1 {
    font-size: 18pt;
    page-break-after: avoid;
  }
  
  .markdown-body h2 {
    font-size: 16pt;
    page-break-after: avoid;
  }
  
  .markdown-body h3 {
    font-size: 14pt;
    page-break-after: avoid;
  }
  
  .markdown-body img {
    max-width: 100%;
    page-break-inside: avoid;
  }
  
  .markdown-body table {
    page-break-inside: avoid;
  }
  
  .markdown-body blockquote {
    page-break-inside: avoid;
  }
}
/* Mini Chat Prompt Widget */
.mini-chat-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.mini-chat-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.mini-chat-button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: var(--mdc-theme-primary);
  color: #fff;
  cursor: pointer;
}
