/* New Color Palette: Futuristic Clarity (Deep Blue & Cyan/Teal) */
:root {
  /* Primary & Accents */
  --theme-primary: #2A3F8F; /* Deep Modern Blue */
  --theme-primary-light: #4E67C0; 
  --theme-primary-dark: #1E2E72;
  
  --theme-accent: #17A2B8;   /* Bright Cyan/Teal */
  --theme-accent-light: #50D8ED;
  --theme-accent-dark: #0F7C8A;
  
  /* Icon Colors */
  --primary-blue: #3498db; 
  --primary-blue-dark: #2980b9
  --accent-teal: #1abc9c
  --accent-teal-dark: #16a085
  --dark-gray: #2c3e50
  --medium-gray: #34495e
  --light-gray: #ecf0f1

  /* Gradients */
  --primary-gradient: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
  --hero-gradient: linear-gradient(135deg, var(--theme-primary-dark) 0%, var(--theme-primary) 70%, var(--theme-accent-light) 100%);
  --button-gradient: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-dark) 100%);
  --secondary-gradient: linear-gradient(135deg, var(--theme-accent-light) 0%, var(--theme-accent) 100%); /* For pricing buttons */

  /* Neutral Colors */
  --theme-bg-dark: #0d1226; /* Very Dark Blue - for body background */
  --theme-bg-light: #FFFFFF; /* White - for cards/light sections */
  --theme-card-bg: var(--theme-bg-light);
  --theme-text-on-dark: #E0E7FF; /* Light blueish gray for text on dark bg */
  --theme-text-on-light: #212529; /* Dark gray for text on light bg */
  --theme-text-secondary-on-light: #495057;
  --theme-text-muted-on-light: #6c757d;
  --theme-border-light: #DEE2E6;
  --theme-border-dark: #394B8A;

  /* Status Colors (can keep these, or adjust to fit new theme) */
  --success: #22c55e; /* Keep green for success */
  --warning: #f59e0b; /* Keep orange for warning */
  --error: #ef4444;   /* Keep red for error */

  /* UI & Fonts */
  --backdrop-blur: blur(10px);
  --default-font: 'Open Sans', sans-serif; 
  --heading-font: 'Poppins', sans-serif;

  /* New theme variables */
  --theme-bg-light-rgb: 248, 249, 250; /* Assuming --theme-bg-light is #F8F9FA for this example */
  /* If --theme-bg-light is pure white (#FFFFFF), then 255, 255, 255 */
  --theme-primary-rgb: 42, 63, 143; /* Corresponds to #2A3F8F */
  --theme-accent-rgb: 23, 162, 184;  /* Corresponds to #17A2B8 */
}

/* Global Styles */
body {
  font-family: var(--default-font);
  background: var(--theme-bg-dark);
  color: var(--theme-text-on-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Import Google Fonts (Poppins and Open Sans) - This should be in HTML head ideally */
/* @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700&display=swap'); */

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--theme-text-on-light); /* Default for light backgrounds */
}

.text-on-dark-bg h1,
.text-on-dark-bg h2,
.text-on-dark-bg h3,
.text-on-dark-bg h4,
.text-on-dark-bg h5,
.text-on-dark-bg h6 {
  color: var(--theme-text-on-dark);
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.9) !important; /* Slightly transparent white */
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--theme-border-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--theme-primary) !important; /* Use theme primary for brand */
}

.nav-link {
  color: var(--theme-text-secondary-on-light) !important;
  font-weight: 500;
}
.nav-link:hover, .nav-link.active {
  color: var(--theme-primary) !important;
}
.navbar .btn-primary {
  background: var(--button-gradient);
  border: none;
  color: white !important;
}
.navbar .btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}


/* Hero Section */
.hero {
  background: var(--hero-gradient);
  color: white;
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
  /* min-height: 45vh; remove fixed min height or adjust */
  display: flex;
  align-items: center;
}

.hero::before { /* Optional: subtle pattern */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle at top left, rgba(255,255,255,0.05) 0%, transparent 30%), 
                    radial-gradient(circle at bottom right, rgba(var(--theme-accent-rgb, 23, 162, 184),0.1) 0%, transparent 30%);
  opacity: 0.7;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-weight: 700;
  font-size: 3rem; /* Adjusted */
  margin-bottom: 1rem;
  color: white; /* Explicitly white */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero .lead {
  font-size: 1.2rem; /* Adjusted */
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  color: var(--theme-text-on-dark); /* Lighter text */
}

.hero .btn-light {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  color: white;
  font-weight: 600;
  padding: 12px 30px; /* Adjusted */
  border-radius: 8px; /* Modern border radius */
  transition: all 0.3s ease;
}

.hero .btn-light:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Main Section General Style */
#main-section, .main-content-area {
  background: var(--theme-bg-light); /* This might be better set on individual page containers if layouts vary */
  color: var(--theme-text-on-light);
  flex-grow: 1;
  display: flex; /* Ensure it's a flex container if its children need to align/grow */
  flex-direction: column; /* Stack children vertically */
}

/* Footer */
.footer-gradient {
  background: var(--theme-primary-dark);
  color: var(--theme-text-on-dark);
  padding: 2rem 0;
}
.footer-gradient a {
  color: var(--theme-accent-light);
}
.footer-gradient a:hover {
  color: white;
}

.footer-nav-links .list-inline-item {
  margin-right: 0.5rem; /* Adjust spacing between links */
}

.footer-nav-links .nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}

.footer-nav-links .nav-link:hover {
  color: white;
  text-decoration: underline;
}

/* Ensure placeholder text has good contrast */
.form-control::placeholder {
  color: var(--theme-text-muted-on-light); /* Adjusted to new theme */
  opacity: 1; /* Firefox Fix */
}

/* Buttons (General - to be updated with new theme) */
.btn {
  border-radius: 8px; /* Modern border radius */
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

.btn-primary {
  background: var(--button-gradient);
  border: none;
  color: white !important; 
  /* padding: 15px 30px; */ /* Use general .btn padding or customize */
  /* font-size: 1.1rem; */
  transition: all 0.3s ease;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--theme-accent-rgb, 23, 162, 184), 0.3);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: white !important;
}
.btn-success:hover {
  opacity: 0.9;
}

/* Output Card (example of refactoring) */
.output-card {
  background: var(--theme-card-bg);
  backdrop-filter: var(--backdrop-blur);
  border-radius: 12px; /* Softer radius */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.output-header {
  background: var(--theme-bg-light); /* Clean light background */
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--theme-border-light);
}

.output-header h5 {
  color: var(--theme-primary-dark);
  font-weight: 600;
  font-size: 1.25rem; /* Adjusted */
  margin: 0;
}

.output-content {
  flex-grow: 1;
  padding: 0; /* Padding will be in .markdown-content or specific divs */
  position: relative;
}

/* Markdown Content */
.markdown-content {
  background: var(--theme-bg-light);
  padding: 1.5rem; /* Consistent padding */
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--theme-text-on-light);
}

.markdown-content ul,
.markdown-content ol {
  text-align: left;
  padding-left: 2rem; /* Ensure default padding for lists */
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  color: var(--theme-primary-dark);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

.markdown-content h1 { font-size: 1.6rem; }
.markdown-content h2 { font-size: 1.4rem; }
.markdown-content h3 { font-size: 1.2rem; }

/* Features Grid in Hero (example) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* More responsive */
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.08); /* More subtle */
  backdrop-filter: blur(5px);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--theme-text-on-dark); /* Ensure text is light */
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2rem; /* Slightly smaller */
  color: var(--theme-accent-light); /* Use accent for icons on dark */
  margin-bottom: 0.75rem;
}

.feature-card h6 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.feature-card p {
  color: white;
}

.feature-card p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* Premium Overlay */
.premium-overlay {
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb, 42, 63, 143), 0.1) 0%, rgba(var(--theme-accent-rgb, 23, 162, 184), 0.1) 100%);
  /* ... existing styles, ensure text colors contrast with this new background ... */
  padding: 2rem;
  border-radius: 10px;
}

.premium-overlay h4 {
  color: var(--theme-primary-dark);
}

.premium-overlay p {
  color: var(--theme-text-on-light); /* This should be on a light card, so text-on-light is fine */
}

.premium-overlay .btn-premium {
  background: var(--button-gradient);
  color: white;
  /* ... other styles ... */
}

/* File Item in list */
.file-item {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border-light);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item:hover {
  border-color: var(--theme-accent);
  background: var(--theme-accent-light-translucent, rgba(23, 162, 184, 0.05)); 
  transform: translateX(2px);
  box-shadow: 0 3px 12px rgba(var(--theme-accent-rgb, 23, 162, 184), 0.1);
}

.file-item.selected {
  border-color: var(--theme-accent-dark);
  background: var(--theme-accent-light-translucent-strong, rgba(23, 162, 184, 0.1));
  box-shadow: 0 5px 15px rgba(var(--theme-accent-rgb, 23, 162, 184), 0.2);
  transform: translateX(0);
}

.file-item .file-name {
  font-weight: 600;
  color: var(--theme-text-on-light);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.file-item .file-name i {
  color: var(--theme-primary);
  margin-right: 0.5rem;
}

.file-item .file-meta {
  font-size: 0.75rem;
  color: var(--theme-text-muted-on-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.file-status {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-status.processed {
  background-color: rgba(var(--success-rgb, 34, 197, 94), 0.15);
  color: var(--success, #22c55e);
}

.file-status.processing {
  background-color: rgba(var(--theme-accent-rgb, 23, 162, 184), 0.15);
  color: var(--theme-accent-dark, #0F7C8A);
  animation: pulse-light 1.8s infinite ease-in-out;
}

.file-status.error {
  background-color: rgba(var(--error-rgb, 239, 68, 68), 0.15);
  color: var(--error, #ef4444);
}

.empty-files {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--theme-text-muted-on-light);
}
.empty-files i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--theme-border-light);
}

/* Add RGB for status colors if not already there */
:root {
  /* ... existing theme vars ... */
  --success-rgb: 34, 197, 94;
  --warning-rgb: 245, 159, 11;
  --error-rgb: 239, 68, 68;
}

@keyframes pulse-light {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
}

/* General Card Style (can be applied to #doc-form, .files-section, etc.) */
.card-styled {
  background: var(--theme-card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--theme-border-light);
  padding: 2rem;
}

#doc-form.card-styled::before { /* If it still has this top border */
  background: var(--primary-gradient);
}

/* Update specific sections like upload form, files list with card-styled or direct styling */

/* Login/Register page cards should also adopt this .card-styled */

/* Original Color Variables (TO BE REMOVED/REPLACED) */
/* 
:root {
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --primary-light: #818cf8;
  --primary-dark: #4338ca;
  
  --secondary-gradient: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  --secondary-light: #2dd4bf;
  --secondary-dark: #0f766e;
  
  --bg-dark: #0f172a;
  --bg-light: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  
  --status-colors ... 
  --card-bg: rgba(255, 255, 255, 0.98);
}
*/

/* Progress Indicator */
.progress-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(99, 102, 241, 0.2);
  z-index: 9999;
  display: none;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.3s ease;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: var(--backdrop-blur);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 2.5rem;
  color: white;
  margin-bottom: 0.75rem;
}

.feature-card h6 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Output Card for Non-authenticated Users */
#result-content.output-card {
  overflow-y: auto;
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Added for non-authenticated view layout */
.non-auth-content-column {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

/* Responsive Design */
@media (max-width: 992px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .right-column {
    order: -1;
  }
  
  .files-section {
    max-height: 300px;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero .lead {
    font-size: 1.1rem;
  }
  
  .markdown-content {
    padding: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #result-content.output-card {
    max-height: 60vh;
  }
}

/* Custom Scrollbar */
.markdown-content::-webkit-scrollbar,
.files-section::-webkit-scrollbar {
  width: 8px;
}

.markdown-content::-webkit-scrollbar-track,
.files-section::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb,
.files-section::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb:hover,
.files-section::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}

/* Output Placeholder */
.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%; /* Ensure it fills the container if needed */
  padding: 2rem;
  text-align: center;
  color: var(--theme-text-muted-on-light);
  background-color: var(--theme-bg-light); /* Match card background */
  border-radius: 8px; /* Optional: if used as a standalone card */
}

.output-placeholder i {
  font-size: 3rem; /* Adjusted size */
  color: var(--theme-accent-light); /* Use a lighter accent color */
  margin-bottom: 1rem;
  opacity: 0.8;
}

.output-placeholder h6 {
  color: var(--theme-text-on-light);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.output-placeholder p {
  font-size: 0.9rem;
}


/* Premium Content Blur & Overlay (in non-auth view) */
.premium-content-container {
  margin-top: 2rem;
  position: relative;
  border: 1px solid var(--theme-border-light);
  border-radius: 8px;
  padding: 1.5rem;
  background-color: var(--theme-bg-light);
}

.premium-content-container h5 {
  color: var(--theme-primary-dark);
  font-weight: 600;
}
.premium-content-container h5 i {
  color: var(--warning); /* Warning icon color */
}

.premium-content-blur {
  filter: blur(5px);
  opacity: 0.7;
  font-size: 0.9rem;
  color: var(--theme-text-secondary-on-light);
  /* Ensure it doesn't get too tall */
  max-height: 100px; 
  overflow: hidden;
  position: relative; /* For potential ::after gradient if needed */
}

.premium-overlay { /* This is the blocking overlay */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--theme-bg-light-rgb, 255, 255, 255), 0.85); /* Semi-transparent light background */
  backdrop-filter: blur(3px); /* Slight blur for text behind */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: 8px; /* Match container if it had one */
  z-index: 10; /* Ensure it's on top of the blurred content */
}

.premium-overlay h4 {
  color: var(--theme-primary-dark);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.premium-overlay h4 i {
  color: var(--theme-primary);
}

.premium-overlay p {
  color: var(--theme-text-on-light);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  max-width: 400px;
}

.premium-overlay .btn-premium {
  background: var(--button-gradient);
  color: white !important;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.premium-overlay .btn-premium:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(var(--theme-accent-rgb, 23, 162, 184), 0.25);
}

.premium-overlay .small a {
  color: var(--theme-accent-dark);
  font-weight: 500;
}

/* Pricing Page Styles */
.pricing-header {
  padding: 4rem 0;
  background: var(--hero-gradient); /* Use hero gradient for consistency or a new one */
  color: white;
}

.pricing-header h1 {
  font-weight: 700;
  font-size: 2.8rem;
  color: white; /* Ensure text is white on gradient */
}

.pricing-header p {
  color: var(--theme-text-on-dark);
  opacity: 0.9;
}

.plan-card {
  background: var(--theme-card-bg);
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.08);
  border: 1px solid var(--theme-border-light);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure cards are same height in a row */
  transition: all 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 45px rgba(var(--theme-primary-rgb, 42, 63, 143), 0.15);
}

.plan-card.popular {
  border-color: var(--theme-accent);
  box-shadow: 0 15px 45px rgba(var(--theme-accent-rgb, 23, 162, 184), 0.2);
}

.plan-card .plan-name {
  color: var(--theme-primary-dark);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.plan-card .plan-price {
  color: var(--theme-accent-dark);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.plan-card .plan-price .text-muted {
  font-size: 1rem;
  font-weight: 400;
  color: var(--theme-text-muted-on-light) !important;
}

.plan-card .plan-description {
  color: var(--theme-text-secondary-on-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  min-height: 40px; /* Give some space for description */
}

.plan-features {
  list-style: none;
  padding-left: 0;
  margin-bottom: 2rem;
  flex-grow: 1; /* Makes features list take available space */
}

.plan-features li {
  color: var(--theme-text-on-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
}

.plan-features li i {
  color: var(--theme-accent);
  margin-right: 0.75rem;
  margin-top: 4px; /* Align icon with text */
}

.plan-card .btn-subscribe {
  background: var(--button-gradient);
  color: white !important;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: block;
  width: 100%;
  transition: all 0.3s ease;
}

.plan-card .btn-subscribe:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--theme-accent-rgb), 0.4);
}

/* Commenting out to make all buttons uniform
.plan-card.popular .btn-subscribe {
    background: var(--primary-gradient); 
}
.plan-card.popular .btn-subscribe:hover {
    box-shadow: 0 8px 25px rgba(var(--theme-primary-rgb), 0.3);
}
*/

/* Alert Styles */
.alert {
  border-radius: 8px; /* Consistent border-radius */
  padding: 1rem 1.25rem;
  border-width: 1px; /* Ensure border is visible if not default */
  border-style: solid;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(var(--success-rgb, 34, 197, 94), 0.1);
  border-color: rgba(var(--success-rgb, 34, 197, 94), 0.3);
  color: var(--success, #22c55e);
}
.alert-success .alert-link {
  color: darken(var(--success, #22c55e), 10%); /* Needs a SASS-like function or manual color */
  /* For now, let's use a slightly darker variant if success-dark is defined, or primary text */
  color: var(--theme-text-on-light); 
}

.alert-danger {
  background-color: rgba(var(--error-rgb, 239, 68, 68), 0.1);
  border-color: rgba(var(--error-rgb, 239, 68, 68), 0.3);
  color: var(--error, #ef4444);
}
.alert-danger .alert-link {
  color: var(--theme-text-on-light); 
}

.alert-warning {
  background-color: rgba(var(--warning-rgb, 245, 159, 11), 0.1);
  border-color: rgba(var(--warning-rgb, 245, 159, 11), 0.3);
  color: var(--warning, #f59e0b);
}
.alert-warning .alert-link {
  color: var(--theme-text-on-light); 
}

.alert-info {
  background-color: rgba(var(--theme-accent-rgb, 23, 162, 184), 0.1);
  border-color: rgba(var(--theme-accent-rgb, 23, 162, 184), 0.3);
  color: var(--theme-accent-dark, #0F7C8A);
}
.alert-info .alert-link {
   color: var(--theme-text-on-light); 
}

.alert .btn-close {
  filter: none; /* Remove default Bootstrap filter if it clashes with new colors */
}

/* FAQ Section */
.accordion-button {
  font-weight: 600;
  color: var(--theme-primary-dark);
}

.accordion-button:not(.collapsed) {
  background-color: var(--theme-primary-light);
  color: white;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(var(--theme-primary-rgb), 0.3); /* Use your primary color RGB */
}

.accordion-item {
  border-color: var(--theme-border-light);
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden; /* Ensures border-radius is respected by content */
}

/* Blog Styles */
.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.blog-post-content pre {
  background-color: #f8f9fa; /* Light background for code blocks */
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto; /* Scroll for wide code blocks */
  border: 1px solid var(--theme-border-light);
}

.blog-post-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.9em;
  color: #d63384; /* A common color for inline code */
}

.blog-post-content pre code {
  color: inherit; /* Code inside pre should inherit its color */
}

.blog-post-content blockquote {
  border-left: 4px solid var(--theme-accent);
  padding-left: 1rem;
  margin-left: 0;
  font-style: italic;
  color: var(--theme-text-secondary-on-light);
}

/* Card styles for blog index */
.card.h-100.shadow-sm {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border-light);
}

.card-title {
    color: var(--theme-primary-dark);
}

.card-text {
    color: var(--theme-text-secondary-on-light);
}

.card-text.text-muted.small {
    color: var(--theme-text-muted-on-light) !important;
}

/* Ensure headings within blog content also use the theme colors */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
  color: var(--theme-text-on-light);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}


/* Ensure main content area for FAQ and Blog also has light background */
.faq-page-container .container,
.blog-index-container .container,
.blog-post-container .container {
    background-color: var(--theme-bg-light);
    padding-top: 2rem; /* Add some padding */
    padding-bottom: 2rem;
    border-radius: 8px; /* Optional: match card radius */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Optional: subtle shadow */
}

/* Ensure headings within these containers are dark */
.faq-page-container h1,
.blog-index-container h1,
.blog-post-container h1 {
    color: var(--theme-primary-dark);
}

/* Main Layout & Sections */
section.section-shaped {
  padding: 5rem 0;
  position: relative;
}

section.section-shaped.bg-light {
  background-color: #f8f9fa;
}

section.section-shaped.bg-primary-soft {
  background-color: rgba(13, 110, 253, 0.05);
}

.section-title {
  margin-bottom: 3rem;
  position: relative;
}

.section-title:after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #0dcaf0);
  margin: 1rem auto 0;
  border-radius: 2px;
}

.section-title h2 {
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: #6c757d;
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Solutions Cards */
.solution-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 2.5rem 1.5rem;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.solution-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.solution-card:before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: linear-gradient(225deg, rgba(13, 110, 253, 0.1), transparent);
  border-radius: 0 0 0 100%;
  z-index: -1;
}

.solution-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #0d6efd, #0dcaf0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.solution-icon i {
  font-size: 2rem;
  color: white;
}

.solution-card h4 {
  margin-bottom: 1rem;
  font-weight: 600;
  color: #343a40;
}

.solution-card p {
  color: #6c757d;
  margin-bottom: 1.5rem;
}

/* Product Demo Section */
.product-demo {
  position: relative;
}

.product-demo-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-demo-image img {
  width: 100%;
  height: auto;
  display: block;
}

.product-demo-content {
  padding: 2rem;
}

.product-demo-content h3 {
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.product-demo-content p {
  color: #6c757d;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.demo-feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.demo-feature-item i {
  color: #0d6efd;
  margin-right: 1rem;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Why Us Section */
.why-us-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  height: 100%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.why-us-card:hover {
  transform: translateY(-5px);
}

.why-us-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.why-us-card-icon {
  width: 60px;
  height: 60px;
  background: rgba(13, 110, 253, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.why-us-card-icon i {
  font-size: 1.5rem;
  color: #0d6efd;
}

.why-us-card-title {
  margin: 0;
  font-weight: 600;
  color: #343a40;
}

.why-us-card ul {
  padding-left: 1.5rem;
  margin-bottom: 0;
}

.why-us-card ul li {
  margin-bottom: 0.5rem;
  color: #6c757d;
}

.why-us-card ul li:last-child {
  margin-bottom: 0;
}

/* Analysis Interface Styles */
.analysis-container {
  margin-bottom: 3rem;
}

.analysis-card {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Step Process Header */
.analysis-card-header {
  display: flex;
  background-color: #f8f9fa;
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.analysis-step {
  flex: 1;
  text-align: center;
  padding: 1.25rem 0.5rem;
  position: relative;
  color: #6c757d;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  font-weight: 500;
}

.analysis-step:not(:last-child):after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 20px;
  height: 2px;
  background-color: #dee2e6;
  transform: translateY(-50%);
}

.analysis-step.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.05);
}

.analysis-step .step-number {
  width: 28px;
  height: 28px;
  background-color: #e9ecef;
  color: #6c757d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.analysis-step.active .step-number {
  background-color: #0d6efd;
  color: #ffffff;
}

.analysis-step .step-text {
  font-size: 0.85rem;
}

.analysis-card-body {
  padding: 0;
  position: relative;
  min-height: 400px;
}

/* Panel System */
.analysis-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow: hidden;
  padding: 2rem;
}

.analysis-panel.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  height: auto;
  overflow: visible;
}

/* Upload Area */
.upload-area {
  text-align: center;
  padding: 1rem;
}

.upload-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.2));
  color: #0d6efd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}

.file-drop-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  margin: 1.5rem 0;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  position: relative;
}

.file-drop-area:hover {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.05);
}

.file-message {
  color: #6c757d;
  font-size: 1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.selected-file-info {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.file-preview {
  width: 40px;
  height: 40px;
  background-color: #e9ecef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #6c757d;
}

.file-name {
  font-weight: 500;
  color: #343a40;
  margin-bottom: 0.25rem;
}

.upload-security {
  color: #6c757d;
  font-size: 0.875rem;
}

.quota-info {
  font-size: 0.875rem;
}

/* Processing Animation */
.processing-status {
  padding: 2rem;
}

.processing-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.processing-brain-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: #0d6efd;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
}

.processing-progress {
  height: 10px;
  border-radius: 5px;
  background-color: #e9ecef;
  overflow: hidden;
}

.processing-steps {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.processing-step {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  color: #6c757d;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  opacity: 0.6;
}

.processing-step.active {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
  font-weight: 500;
  opacity: 1;
}

.processing-step.completed {
  color: #198754;
  background-color: rgba(25, 135, 84, 0.1);
  opacity: 0.8;
}

.processing-step.completed i {
  color: #198754;
}

/* Results Panel & Enhancement */
.results-panel-container {
  padding: 1.5rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.results-title {
  display: flex;
  align-items: center;
  margin: 0;
}

.results-title i {
  font-size: 1.5rem;
  color: #198754;
  margin-right: 0.75rem;
}

.results-title-text {
  font-weight: 600;
  color: #343a40;
}

.results-actions {
  display: flex;
  gap: 0.5rem;
}

.results-body {
  padding: 0.5rem 0;
}

.output-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.output-actions {
  display: flex;
  gap: 0.5rem;
}

/* Document Preview Enhancements */
.output-content-grid {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  margin: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.document-preview-pane {
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  position: relative;
}

.page-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 15px;
  background-color: #f4f7f9;
}

.page-canvas-container {
  flex: 0 0 60%;
  margin-right: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #dee2e6;
  background-color: #fff;
  position: relative;
  align-self: stretch;
}

.page-canvas-container canvas,
.page-canvas-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}

.page-analysis-bubble {
  flex: 1;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  max-height: 75vh;
  overflow-y: auto;
  align-self: stretch;
}

.page-analysis-bubble .output-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-analysis-bubble h6.page-analysis-title {
  font-weight: bold;
  color: #0056b3;
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #bce0fd;
  font-size: 1.1rem;
  background-color: #fff;
  position: sticky;
  top: -20px;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  z-index: 5;
}

.page-analysis-bubble strong {
  color: #333;
}

.page-analysis-bubble ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.page-analysis-bubble ul li {
  margin-bottom: 8px;
}

/* File drop area error state */
.file-drop-area.error {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
  animation: shake 0.5s linear;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Highlight style for file drop */
.file-drop-area.highlight {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.05);
}

/* Slider Navigation Buttons */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  border: none;
  background-color: rgba(255, 255, 255, 0.8);
  color: #333;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.slider-nav:hover {
  opacity: 1;
  background-color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
  left: 10px;
}

.slider-nav.next {
  right: 10px;
}

.slider-nav:disabled, .slider-nav.swiper-button-disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  box-shadow: none;
  transform: translateY(-50%);
}

/* Results Summary Section */
.results-summary {
  margin-top: 2rem;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.results-summary-header {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.results-summary-header h5 {
  margin-bottom: 0;
  font-weight: 600;
  color: #343a40;
}

.results-summary-body {
  padding: 1.5rem;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.summary-stat {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 1.25rem 0.75rem;
  position: relative;
}

.summary-stat:not(:last-child):after {
  content: '';
  position: absolute;
  top: 20%;
  right: 0;
  height: 60%;
  width: 1px;
  background-color: rgba(0, 0, 0, 0.05);
}

.summary-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #0d6efd, #0dcaf0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.summary-stat-value.text-danger {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-stat-value.text-success {
  background: linear-gradient(135deg, #198754, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-stat-label {
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
}

.summary-recommendations {
  background-color: rgba(13, 110, 253, 0.03);
  border-radius: 8px;
  padding: 1.25rem;
}

.summary-recommendations h6 {
  margin-bottom: 1rem;
  color: #343a40;
  font-weight: 600;
}

.recommendation-list {
  padding-left: 0;
  list-style-type: none;
  margin-bottom: 0;
}

.recommendation-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.recommendation-list li:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #0d6efd;
}

.recommendation-list li:last-child {
  margin-bottom: 0;
}

/* Animation effects */
.fade-in-up {
  animation: fadeInUp 0.6s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.fade-in-up-delay-1 {
  animation-delay: 0.2s;
}

.fade-in-up-delay-2 {
  animation-delay: 0.4s;
}

.fade-in-up-delay-3 {
  animation-delay: 0.6s;
}

/* Analysis Sections Collapsible */
.analysis-section {
  margin-bottom: 10px;
}

.analysis-section .analysis-toggle-link {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #343a40;
  background-color: #f8f9fa;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid #dee2e6;
}

.analysis-section .analysis-toggle-link:hover {
  background-color: #e9ecef;
}

.analysis-section .analysis-toggle-link span strong {
  font-weight: 600;
  color: #0056b3;
}

.analysis-section .analysis-toggle-link .toggle-icon {
  transition: transform 0.2s ease-in-out;
  font-size: 0.9em;
}

.analysis-section .analysis-toggle-link[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.analysis-section .collapse .analysis-items-list {
  padding: 10px 12px 5px 12px;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 5px 5px;
  font-size: 0.875rem;
}

.analysis-section .collapse .analysis-items-list li {
  padding: 4px 0;
  line-height: 1.5;
}

.analysis-section .simple-info p {
  padding: 10px 12px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin-bottom: 0;
}

.analysis-section .simple-info p strong {
  color: #0056b3;
}

/* Mobile Responsive Fixes for Analysis Results */

/* Improve mobile layout for page container */
@media (max-width: 768px) {
  /* Fix for results-body container */
  .results-body {
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
  }
  
  /* Fix output-content-grid to prevent horizontal overflow */
  .output-content-grid {
    padding: 10px;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
  }
  
  /* Fix document preview pane */
  .document-preview-pane {
    width: 100%;
    overflow: hidden; /* Prevent horizontal scrolling */
  }
  
  /* Fix Swiper container to show only one slide at a time */
  .swiper-container {
    width: 100% !important;
    overflow: hidden;
    padding-bottom: 30px;
  }
  
  .swiper-wrapper {
    display: flex;
    width: 100%;
  }
  
  .swiper-slide {
    width: 100% !important; /* Force slides to take full width */
    flex-shrink: 0;
  }
  
  .page-container {
    flex-direction: column;
    padding: 10px;
    width: 100%;
  }
  
  .page-canvas-container {
    flex: 0 0 auto;
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
    max-height: none;
  }
  
  .page-canvas-container canvas,
  .page-canvas-container img {
    max-height: 50vh;
    width: 100%;
    object-fit: contain;
  }
  
  .page-analysis-bubble {
    width: 100%;
    max-height: none;
    padding: 15px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
  }
  
  /* Fix analysis buttons to prevent overflow */
  .analysis-action-button {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .analysis-action-button .btn-analysis {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    font-size: 0.9rem;
    white-space: normal; /* Allow text to wrap */
    text-align: left;
    justify-content: flex-start;
  }
  
  /* Ensure button text doesn't overflow */
  .btn-analysis span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .slider-nav {
    top: 25%; /* Position navigation buttons higher in mobile view */
    width: 35px;
    height: 35px;
    line-height: 35px;
  }
  
  /* Improve modal display on mobile */
  .modal-dialog.risk-modal,
  .modal-dialog.opportunity-modal {
    margin: 10px;
  }
  
  /* Improve results header on mobile */
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .results-title {
    margin-bottom: 10px;
  }
  
  .results-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  
  /* Adjust summary stats for mobile */
  .summary-stats {
    display: flex;
    flex-wrap: wrap;
  }
  
  .summary-stat {
    flex: 1 0 50%;
    padding: 10px;
  }
  
  /* Adjust modal content for mobile */
  #analysisModal .modal-body {
    padding: 1rem;
    max-height: 60vh;
  }
  
  .item-number {
    min-width: 40px;
    font-size: 0.9rem;
  }
  
  .item-content {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  #analysisModal .modal-title {
    font-size: 1.1rem;
  }
  
  /* Make mobile page indicator more visible */
  .mobile-page-indicator {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 1rem;
    background-color: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
  }
  
  /* Ensure the analysis buttons don't overflow */
  .btn-analysis {
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
    height: auto;
    min-height: 44px;
    padding-right: 30px; /* Space for icon */
    position: relative;
  }
  
  .btn-analysis i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .btn-analysis span {
    padding-left: 25px; /* Space for icon */
    display: block;
    width: 100%;
  }
}

/* Further improvements for very small screens */
@media (max-width: 480px) {
  .page-canvas-container canvas,
  .page-canvas-container img {
    max-height: 40vh;
  }
  
  .summary-stat {
    flex: 1 0 100%;
  }
  
  .slider-nav {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 0.9rem;
  }
  
  /* Better button layout for very small screens */
  .results-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .results-actions button {
    width: 100%;
  }
}

/* Analysis Action Buttons */
.analysis-action-button {
  margin-bottom: 1rem;
}

.btn-analysis {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  border-width: 2px;
}

.btn-analysis i {
  font-size: 1.1rem;
  margin-right: 10px;
}

.btn-outline-danger.btn-analysis {
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.3);
  background-color: rgba(220, 53, 69, 0.05);
}

.btn-outline-danger.btn-analysis:hover {
  color: white;
  background-color: #dc3545;
  border-color: #dc3545;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.2);
}

.btn-outline-warning.btn-analysis {
  color: #ff9500;
  border-color: rgba(255, 149, 0, 0.3);
  background-color: rgba(255, 149, 0, 0.05);
}

.btn-outline-warning.btn-analysis:hover {
  color: #212529;
  background-color: #ff9500;
  border-color: #ff9500;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 149, 0, 0.2);
}

/* Analysis Modal Styles */
#analysisModal .modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

#analysisModal .modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#analysisModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

#analysisModal .modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

#analysisModal .modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.analysis-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.analysis-item-card {
  display: flex;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.analysis-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.risk-card .item-number {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
}

.opportunity-card .item-number {
  background: linear-gradient(135deg, #ff9500, #ffcc00);
}

.item-content {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  border-left: 3px solid rgba(0, 0, 0, 0.05);
  color: #343a40;
}

.risk-card .item-content {
  border-left-color: rgba(220, 53, 69, 0.3);
}

.opportunity-card .item-content {
  border-left-color: rgba(255, 149, 0, 0.3);
}

.risk-modal .modal-header {
  background-color: rgba(220, 53, 69, 0.05);
  border-bottom: 3px solid #dc3545;
}

.risk-modal .modal-title {
  color: #dc3545;
}

.opportunity-modal .modal-header {
  background-color: rgba(255, 149, 0, 0.05);
  border-bottom: 3px solid #ff9500;
}

.opportunity-modal .modal-title {
  color: #ff9500;
}

/* Enhance summary statistics with gradient text */
.summary-stat-value {
  background: linear-gradient(135deg, #0d6efd, #0dcaf0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  font-weight: 700;
  display: inline-block;
}

.summary-stat-value.text-danger {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.summary-stat-value.text-success {
  background: linear-gradient(135deg, #198754, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

/* Responsive layout for larger screens */
@media (min-width: 768px) {
  .analysis-items {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  }
}

/* Mobile page indicator styling */
.mobile-page-indicator {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
  margin: 10px auto;
  text-align: center;
  width: auto;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-page-indicator .current-page {
  color: #0d6efd;
  font-weight: 700;
}

/* Hide default Swiper pagination on mobile */
@media (max-width: 768px) {
  .swiper-pagination {
    display: none;
  }
  
  /* Center the mobile page indicator */
  .mobile-page-indicator {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 1rem;
    background-color: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
  }
  
  /* Ensure the analysis buttons don't overflow */
  .btn-analysis {
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
    height: auto;
    min-height: 44px;
    padding-right: 30px; /* Space for icon */
    position: relative;
  }
  
  .btn-analysis i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .btn-analysis span {
    padding-left: 25px; /* Space for icon */
    display: block;
    width: 100%;
  }
}

/* Fix desktop view issues */
@media (min-width: 769px) {
  /* Fix container sizing */
  .output-content-grid {
    width: auto; /* Reset any width constraints */
    max-width: 100%; /* Ensure it doesn't exceed container */
  }
  
  /* Fix document preview pane */
  .document-preview-pane {
    width: auto; /* Reset any explicit width */
    max-width: 100%; /* Prevent overflow */
  }
  
  /* Fix canvas sizing */
  .page-canvas-container canvas,
  .page-canvas-container img {
    width: auto; /* Don't force width to 100% on desktop */
    max-width: 100%; /* But still constrain if needed */
    height: auto;
    max-height: 75vh;
    object-fit: contain;
  }
  
  /* Fix page container */
  .page-container {
    width: auto; /* Reset width constraint */
  }
  
  /* Reset any mobile-specific button styling */
  .btn-analysis {
    white-space: nowrap;
    padding-right: 1rem;
    position: static;
  }
  
  .btn-analysis i {
    position: static;
    transform: none;
  }
  
  .btn-analysis span {
    padding-left: 0;
    display: inline;
    width: auto;
  }
}