/* ===== GOOGLE FONTS + BASE LAYOUT ===== */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/...) format('woff2');
}


body {
  font-family: "Roboto", sans-serif;
  display: flex;
  height: 100%;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
}

main {
  flex: 1 0 auto; /* grow to fill space between header and footer */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px; /* enough to push footer down if little content */
  padding: 20px 40px 60px 40px;
}

/* === container === */
.container {
  width: 90% !important;
  max-width: 1440px !important;
  /*margin: 0 auto;*/
}

/* container width & centering */
.chart-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 0 12px;
}

/* the key: control the height via container, not the canvas attrs */
.chart-frame {
  width: 100%;
  height: clamp(280px, 55vh, 600px); /* min 280px, max 600px, scalable in between */
  position: relative; /* Chart.js needs this */
}

.ai-icon {
  font-size: 100px;
}

/* ============ FEATURED TOOLSTOOLS SECTION - FIXED WITH PROPER ZIGZAG ============ */

/* Section background */
.features-section {
  background: #f5f5f5;
  padding: 60px 20px;
  text-align: center;
}

/* Container */
.features-container {
  max-width: 1200px;
  margin: 0 auto;
}

.features-container h3 {
  font-size: 1.5rem;
  margin-bottom: -0.5rem;
  font-weight: 600;
}

.features-container p {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* FIXED: Feature Card */
.feature-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin: 60px auto;
  max-width: 1100px;
  width: 100%;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* FIXED: Two Column Layout with proper flex order */
.two-col {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px;
  min-height: 350px;
}

/* FIXED: Content and Image Columns */
.content-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  order: 1; /* Default: content first */
}

.image-column {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  order: 2; /* Default: image second */
}

/* FIXED: Reverse layout for zigzag effect */
.feature-card.reverse .content-column {
  order: 2; /* Content second in reverse cards */
}

.feature-card.reverse .image-column {
  order: 1; /* Image first in reverse cards */
}

/* Image styling */
.image-column img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.feature-card:hover .image-column img {
  transform: scale(1.02);
}

/* Header (icon + title) */
.tool-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.tool-header .material-icons {
  font-size: 32px;
  color: #ff3f4a;
}

.tool-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* Description */
.tool-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 25px;
}

/* Features list */
.tool-features {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
}

.tool-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 1rem;
  color: #333;
  font-weight: 500;
}

.tool-features .material-icons {
  font-size: 20px;
  color: #ff3f4a;
  flex-shrink: 0;
}

/* ADDED: Tool Button Styling */
/* === 2. FEATURED TOOL SECTION BUTTONS === */
.tool-btn {
  background-color: #ff3f4a !important;
  color: white !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  box-shadow: 0 4px 12px rgba(255, 63, 74, 0.3) !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  margin-top: 10px;
  max-width: 300px;
  border: none !important;
  cursor: pointer;
}

.tool-btn:hover {
  background-color: #ff3f4a !important;
  box-shadow: 0 6px 16px rgba(255, 63, 74, 0.4) !important;
  transform: translateY(-2px) !important;
}

.tool-btn .material-icons {
  font-size: 18px !important;
  margin-left: 4px !important;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .features-section {
    padding: 40px 15px;
  }

  .features-container h3 {
    font-size: 2rem;
  }

  /* FIXED: Mobile stacking - ALWAYS content first, image second */
  .two-col {
    flex-direction: column;
    gap: 30px;
    padding: 30px 20px;
    text-align: center;
    min-height: auto;
  }

  /* FIXED: On mobile, ALWAYS show content first, image second for ALL cards */
  .content-column,
  .feature-card.reverse .content-column {
    order: 1 !important; /* Content always first on mobile */
    text-align: center;
  }

  .image-column,
  .feature-card.reverse .image-column {
    order: 2 !important; /* Image always second on mobile */
  }

  .tool-header {
    justify-content: center;
  }

  .tool-title {
    font-size: 1.6rem;
  }

  .tool-description {
    font-size: 1rem;
  }

  .feature-card {
    margin: 40px auto;
  }

  .tool-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .tool-header .material-icons {
    font-size: 28px;
  }

  .tool-title {
    font-size: 1.4rem;
  }

  .tool-features li {
    font-size: 0.9rem;
  }

  .two-col {
    padding: 20px 15px;
  }
}

/* ENSURE NO CONFLICTS WITH EXISTING TOOL CARDS */
/* Keep your existing .tool-card styles for the grid section */
.tool-grid-spacing .tool-card {
  /* Your existing grid card styles remain unchanged */
  display: block;
  padding: 20px;
  margin-bottom: 24px;
  border-radius: 10px;
  position: relative;
}

.tool-grid-spacing .tool-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.btn {
  /* FIXED: Proper centering and styling */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ff3f4a;
  color: #fff !important;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 1rem;
  font-weight: 500;
  text-transform: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 63, 74, 0.3);
  line-height: 1;
  min-height: 44px; /* Consistent height */
}

.btn:hover {
  background-color: #ff3f4a !important;
  box-shadow: 0 6px 16px rgba(255, 63, 74, 0.4);
  transform: translateY(-2px);
  color: #fff !important;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 63, 74, 0.3);
}

.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

/* let Chart.js stretch to container size */
#myChart {
  width: 100% !important;
  height: 100% !important;
}

/* slightly shorter charts on very small screens */
@media (max-width: 600px) {
  .chart-frame {
    height: clamp(280px, 55vh, 600px);
  }
}

/* === nav wrapper container ===*/
.brand-logo {
  padding-top: 20px;
  padding-left: -10px;
  padding-bottom: 20px;
}

/* === button style ===*/
.btn {
  border-radius: 10px;
}

/* === 4. GREY BUTTON VARIANT === */
.btn.grey {
  background-color: #999 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(158, 158, 158, 0.3) !important;
}

.btn.grey:hover {
  background-color: #666 !important;
  box-shadow: 0 6px 16px rgba(158, 158, 158, 0.4) !important;
  transform: translateY(-2px);
  color: white !important;
}

/* === Upload container === */
.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.upload-box {
  width: 100%;
  margin-bottom: 0;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #ddd;
  background-color: #fafafa;
  box-shadow: none;
  text-align: center;
}

/* Template download section - force it below upload area */
.template-download-section {
  width: 100%;
  display: block;
  clear: both;
  margin-top: 30px;
  text-align: center;
  padding: 0 20px;
}

.template-download-section p {
  margin: 0;
  font-size: 1rem;
  color: #666;
}

.template-download-section a {
  text-decoration: none;
  font-weight: 500;
}

.template-download-section a:hover {
  text-decoration: underline;
}

/* Ensure proper stacking on all screen sizes */
@media (max-width: 768px) {
  .upload-container {
    padding: 15px;
  }

  .template-download-section {
    margin-top: 25px;
    padding: 0 15px;
  }

  .template-download-section p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .upload-container {
    padding: 10px;
  }

  .template-download-section {
    margin-top: 20px;
    padding: 0 10px;
  }

  .template-download-section p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}

.upload-box .btn {
  margin-bottom: 20px;
}

.drag-text {
  font-size: 14px;
  color: #777;
}

.drop-area.drag-over {
  background-color: #fff;
  border-color: #ff3f4a;
}

.drop-area {
  margin-top: 20px;
  padding: 40px 20px;
  border: 2px dashed #e6e6e6;
  border-radius: 10px;
  background-color: #fff;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.upload-info {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.error-msg {
  margin-top: 10px;
  font-weight: 500;
}

.file-info {
  margin-top: 10px;
}

#fileFeedback {
  display: block;
  margin-top: 10px;
  color: green;
  font-size: 0.95rem;
}

.upload-info {
  text-align: center;
  margin-bottom: 1em;
  font-size: 0.9em;
  color: #333;
}

/*==== chart controls ===*/
.chart-wrapper {
  max-width: 1440px;
  width: 90%;
  margin: 0 auto;
  padding: 20px 0;
}

#chartContainer {
  width: 90%;
  max-width: 1440px;
  margin: 40px auto;
}

/* Remove green underline on input focus */
input:focus {
  border-bottom: 1px solid #ccc !important;
  box-shadow: none !important;
}

canvas {
  width: 100% !important;
  height: auto !important;
  min-height: 300px;
}

canvas#lineChart {
  width: 100% !important;
  height: auto !important;
  min-height: 300px;
}

.card-panel input[type="color"] {
  padding: 0;
  height: 2.5rem;
}

/* ===== NAVBAR ===== */
nav {
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
  border-bottom: solid 1px #e6e6e6;
  padding: 0 -10px;
  position: relative; /* FIXED: Ensure navbar is positioned */
  z-index: 10000; /* FIXED: High z-index for navbar */
}

.logo-img {
  height: 40px;
  margin-top: 10px;
}

/* ===== FIXED: DROPDOWN MENU Z-INDEX - HIGHEST PRIORITY ===== */
.dropdown-trigger {
  position: relative !important;
  z-index: 10001 !important; /* FIXED: Even higher than navbar */
}

.dropdown-content {
  min-width: 250px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important; /* FIXED: Enhanced shadow */
  z-index: 10002 !important; /* FIXED: Highest z-index of all */
  position: absolute !important;
  background: white !important; /* FIXED: Ensure solid background */
  border: 1px solid #e0e0e0 !important; /* FIXED: Add border for definition */
}

/* FIXED: Ensure dropdown content stays above everything */
.dropdown-content li {
  position: relative !important;
  z-index: 10003 !important;
  background: white !important;
}

.dropdown-content li a {
  position: relative !important;
  z-index: 10004 !important;
  background: white !important;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 60px 0;
  position: relative; /* FIXED: Ensure proper stacking context */
  z-index: 1; /* FIXED: Lower z-index than dropdown */
}

/* ===== AI HERO SECTION - ENSURE LOWER Z-INDEX ===== */
.ai-hero-section {
  position: relative;
  height: 90vh;
  min-height: 80vh;
  background-color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #333;
  z-index: 1; /* FIXED: Much lower than dropdown */
}

/* FIXED: Ensure all hero content has lower z-index */
.ai-hero-content {
  position: relative;
  z-index: 2; /* FIXED: Still lower than dropdown */
  max-width: 800px;
  padding: 2rem;
}

/* FIXED: Blur blobs should be even lower */
.blur-blob {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: 0; /* FIXED: Lowest z-index */
  opacity: 0.15;
}

.blob-red {
  background: #ff3f4a;
  top: -10%;
  left: -10%;
}

.blob-grey {
  background: #e6e6e6;
  bottom: -10%;
  right: -10%;
}

/* ===== TOOL CARDS (INDEX GRID) ===== */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 20px;
}

.tool-grid-spacing {
  margin-top: 40px; /* adjust as needed */
}

.tool-card {
  display: block;
  padding: 20px;
  margin-bottom: 24px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tool-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.tool-card-content {
  position: relative;
  height: 100%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.tool-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.chart-icon {
  font-size: 40px !important;
  color: #ff3f4a;
  opacity: 1;
  transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
  .chart-icon {
    font-size: 40px !important;
  }
}

@media (max-width: 768px) {
  header .container {
    padding-left: -10px;
    padding-right: -10px;
  }
}

.tool-card:hover .chart-icon {
  opacity: 1;
}

.tool-description {
  margin-top: 10px;
  font-size: 1.1rem;
  color: #555;
  line-height: 1.4;
}

/* ===== DROPDOWN & SIDENAV ===== */
.dropdown-content li a {
  display: flex !important;
  align-items: center;
  color: #333 !important;
  padding: 14px 20px !important;
  border-bottom: 2px solid #e0e0e0 !important;
}
.dropdown-content li:last-child a {
  border-bottom: none !important;
}
.dropdown-content li a:hover {
  background-color: #f5f5f5 !important;
}
.dropdown-content i {
  margin-right: 16px;
  color: #ff3f4a !important;
}

.sidenav {
  position: fixed !important;
  top: 0;
  bottom: 0;
  height: 100%;
  z-index: 10000 !important;
}

.sidenav-overlay {
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4) !important;
  z-index: 9998;
}
body.sidenav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
.sidenav li a {
  color: #333 !important;
  border-bottom: 1px solid #eee !important;
  padding: 16px 32px !important;
  display: flex !important;
  align-items: center;
}
.sidenav li a:hover {
  background-color: #f5f5f5 !important;
}
.sidenav li a i {
  margin-right: 16px;
  min-width: 24px;
}
.sidenav .subheader {
  color: #ff3f4a !important;
  padding: 16px 32px 8px !important;
  font-weight: 500;
  border-bottom: none !important;
}
.sidenav .collapsible-body li a {
  padding-left: 64px !important;
}
.sidenav li:last-child a,
.sidenav .collapsible-body li:last-child a {
  border-bottom: none !important;
}

/* ===== CONTACT PAGE ===== */
.contact-card {
  padding: 20px;
  height: 100%;
  border-radius: 10px;
  transition: all 0.3s;
}
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}
.contact-icon {
  font-size: 2rem;
  color: #ff3f4a;
  margin: 15px 0;
}
/* === 6. CONTACT BUTTON === */
.contact-btn {
  background-color: #9e9e9e !important;
  color: white !important;
  margin-top: 20px;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 20px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(158, 158, 158, 0.3) !important;
  text-decoration: none !important;
}

.contact-btn:hover {
  background-color: #757575 !important;
  box-shadow: 0 6px 16px rgba(158, 158, 158, 0.4) !important;
  transform: translateY(-2px);
  color: white !important;
}

/* ===== FOOTER ===== */
.page-footer {
  background-color: #f5f5f5 !important;
  padding: 20px 0;
}
.page-footer p,
.page-footer a {
  color: #616161 !important;
}

/* ===== FILE DROP HIGHLIGHT ===== */
.input-panel.drag-over {
  border: 2px dashed #999;
  background-color: #f9f9f9;
}

/* === footer links hover color === */
.page-footer a:hover {
  color: #ff3f4a !important; /* Material red */
}

/* ===== MATERIAL SYMBOL SUPPORT (OPTIONAL) ===== */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 42px;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.dropdown-content li span {
  color: #555;
}
.control-panel .row > .col {
  min-width: 160px;
}
/* Style for line color dropdown items */
#lineColorDropdown li {
  border-bottom: 1px solid #e0e0e0;
}

#lineColorDropdown li:last-child {
  border-bottom: none;
}

#lineColorDropdown li:hover {
  background-color: #f5f5f5 !important;
}

/*=== Grid opacity slider knob color ==*/
input[type="range"]::-webkit-slider-thumb {
  background-color: #ff3f4a;
}

input[type="range"]::-moz-range-thumb {
  background-color: #ff3f4a;
}

input[type="range"]::-ms-thumb {
  background-color: #ff3f4a;
}

/* ==== Range Label bubble ==== */
/* Hide the floating value bubble from Materialize sliders */
.thumb,
.thumb .value {
  display: none !important;
}

.control-panel {
  background-color: #f5f5f5;
  border: solid 1px #e6e6e6;
  border-radius: 10px;
  align-items: center; /* keep items vertically aligned */
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px; /* less padding */
  margin-bottom: 16px; /* tighter spacing before chart */
}

.control-panel > * {
  flex: 0 1 auto; /* prevent giant stretching */
}

/* Remove wave animation inside control panel */
.control-panel .btn {
  background-image: none !important;
  box-shadow: none !important;
}

.control-panel .btn::before,
.control-panel .btn::after {
  display: none !important;
}

/* Switch track and thumb color override */
.switch input:checked + .lever {
  background-color: #ff3f4a !important; /* track */
}
.switch input:checked + .lever::after {
  background-color: #ff3f4a !important; /* thumb */
}

/* === legend box size === */
canvas {
  --chartjs-legend-box-width: 18px;
  --chartjs-legend-box-height: 18px;
}

/* In your styles.css */
.custom-slider {
  width: 80px;
}

/* styled slider */
/* Slider Wrapper for Layout */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Label Styling */
.slider-label {
  font-size: 15px;
  color: #333;
  white-space: nowrap;
}

/* Styled Slider */
.styled-slider {
  -webkit-appearance: none;
  width: 100%;
  max-width: 200px;
  height: 6px;
  border-radius: 6px;
  background: #ddd;
  outline: none;
  transition: background 0.3s;
}

/* Track */
.styled-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: #ddd;
}

/* Thumb */
.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ff3f4a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  margin-top: -5px;
  transition: background 0.3s;
}

.styled-slider:active::-webkit-slider-thumb {
  background: #d32f2f;
}

/* Firefox support */
.styled-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ff3f4a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.styled-slider::-moz-range-track {
  height: 6px;
  background: #ddd;
  border-radius: 6px;
}

/* Icon */
.ai-icon {
  font-size: 100px;
  color: #ff3f4a;
  margin-bottom: 1.5rem;
}

/* Headline */
.ai-heading {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.text-dark {
  color: #444;
}

.text-gradient {
  background: linear-gradient(45deg, #ff3f4a, #ff8e85);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Subheading */
.ai-subheading {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* AI Chart Button */
.ai-chart-btn {
  line-height: normal;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: bold;
  border: 2px solid #ff3f4a;
  color: #ff3f4a;
  background-color: transparent;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  text-decoration: none;
}

.ai-chart-btn:hover {
  background-color: #ff3f4a;
  color: #fff;
  box-shadow: 0 8px 16px rgba(229, 57, 53, 0.3);
  transform: translateY(-2px);
}

.scroll-down-icon {
  text-align: center;
  margin-top: 40px;
  animation: bounce 3s infinite;
  color: #666;
}

.scroll-down-icon i {
  font-size: 36px;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(8px);
  }

  60% {
    transform: translateY(4px);
  }
}

/* === AI chrt page css == */
/* Hero Section */
.ai-hero {
  background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
  padding: 80px 20px;
  color: white;
  position: relative;
}

.ai-title {
  font-size: 2.5rem;
  font-weight: bold;
}

.ai-subtitle {
  font-size: 1.25rem;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.scroll-indicator {
  margin-top: 20px;
  animation: bounce 2s infinite;
}

.scroll-indicator .material-icons {
  font-size: 36px;
  color: white;
}

/* Upload & Chart Section */
input[type="file"] {
  margin-top: 15px;
}

.card-panel {
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
}

/* Animation */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

/* AI PAGE STURUCTURE */
/* ONLY apply this layout fix to the AI Chart page */
body[data-chart-type="ai"] .main-section {
  display: flex;
  flex-direction: column;
}

body[data-chart-type="ai"] .step-content h2 {
  text-align: center;
  font-size: 2rem; /* adjust as needed */
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333; /* or your primary text color */
}

body[data-chart-type="ai"] .stepper-wrapper,
body[data-chart-type="ai"] .step-content,
body[data-chart-type="ai"] .step-nav {
  width: 90%;
}

/* ----------- AI Chart Input ----------- */

/* Prompt Input */
.ai-prompt-area {
  width: 100%;
  margin-top: 30px;
}

.prompt-inner {
  width: 100%;
  max-width: 700px;
  margin: auto;
  text-align: center;
}

.prompt-inner label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 22px;
}

.prompt-inner textarea {
  width: 100%;
  height: 100px;
  max-width: 700px; /* match your upload box width */
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ccc;
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}

/* FIXED: Generate Chart Button Spacing */
#generateChartBtn {
  margin-top: 15px;
  margin-bottom: 30px !important; /* ADDED: Space under the button */
}

/* Chart Wrapper */
.ai-chart-wrapper {
  display: none;
  margin-top: 50px;
  text-align: center;
}

#chartCanvas {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* Export Section */
.export-controls {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.ai-chart-wrapper {
  max-width: 90%;
  margin: 40px auto;
  display: none;
}

#chartCanvas {
  width: 100% !important;
  height: Auto !important;
}

/* ----------------- Upload Box -------------------- */
.upload-box {
  border: 2px dashed #ccc;
  padding: 20px;
  text-align: center;
  background-color: #f9f9f9;
  cursor: pointer;
  transition: 0.3s;
}

.upload-box:hover {
  background-color: #f1f1f1;
}

/* ----------------- chart title input ---------- */
#chartTitleInput {
  height: 40px !important;
  padding: 0 10px;
  border-radius: 12px; /* matches dropdowns if styled */
  box-sizing: border-box;
}

/* -------------- Drop downs ------------------ */
select {
  height: 40px !important;
  border-radius: 12px !important;
}

/* --------------- color box ----------------*/
input[type="color"] {
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

/* ----------- horizontal alignment control tools ----- */
.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.input-field input,
.input-field select {
  height: 40px !important;
  border-radius: 10px;
}

/* Smooth Materialize Select Styling */
.input-field select {
  background-color: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  height: 40px !important;
  display: block !important;
  box-shadow: none !important;
  font-size: 15px;
  color: #333;
}

/* Fix focus appearance */
.input-field select:focus {
  border-color: #ff3f4a !important;
  box-shadow: 0 0 0 1px #ff3f4a3a;
}

/* Remove underline only style */
.input-field .select-wrapper input.select-dropdown {
  border: none !important;
  box-shadow: none !important;
}

/* -------------------------------- CHART ERROR ----------*/
.chart-error {
  max-width: 500px;
  margin: 40px auto;
  padding: 20px;
  color: #b30000;
  font-weight: bold;
  background: #ffe6e6;
  border: 1px solid #b30000;
  border-radius: 5px;
  text-align: center;
}
.chart-message {
  text-align: center;
  padding: 20px;
  color: #555;
}

/*------------------------------------reverse zigzag card ----------*/
@media (max-width: 768px) {
  .tool-card,
  .tool-card.reverse {
    flex-direction: column;
    text-align: center;
  }

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

  .tool-card img {
    margin-bottom: 15px;
  }
}

/*-------------------------RESPONSIVE CHART RENDERIG ---------- */
/* Add this to your shared styles.css */

/* RESPONSIVE CHART CONTAINER - Works for all individual chart pages */
.chart-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Responsive chart canvas */
.chart-container canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 70vh; /* Fits screen height */
  min-height: 300px; /* Minimum readable size */
}

/* For specific chart IDs if needed */
#lineChart,
#barChart,
#pieChart,
#scatterChart,
#areaChart,
#ganttChart,
#bubbleChart,
#radarChart,
#histogramChart {
  width: 100% !important;
  height: auto !important;
  max-height: 70vh !important;
  min-height: 300px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .chart-container canvas,
  #lineChart,
  #barChart,
  #pieChart,
  #scatterChart,
  #areaChart,
  #ganttChart,
  #bubbleChart,
  #radarChart,
  #histogramChart {
    max-height: 60vh !important;
    min-height: 250px !important;
  }
}

/* ---------------- FAQs ----------------------------*/
/* FAQ Section Styles */
.faq-section {
  padding: 80px 0;
  position: relative;
}

.faq-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.5;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.faq-header {
  text-align: center;
  margin-bottom: 60px;
}

.faq-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ff3f4a;
  margin-bottom: 16px;
  background-clip: text;
}

.faq-header p {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

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

.faq-item {
  background: white;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e6e6e6;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.faq-question {
  padding: 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
}

.faq-question:hover {
  background: #f5f5f5;
}

.faq-question h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #666;
  margin: 0;
  padding-right: 20px;
  line-height: 1.4;
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: #ff3f4a;
  transition: all 0.3s ease;
  min-width: 24px;
  text-align: center;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: #ff3f4a;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  background: #fff;
}

.faq-item.active .faq-answer {
  padding: 0px;
}

.faq-answer p {
  color: #666;
  line-height: 1.7;
  margin: 0;
  font-size: 0.95rem;
  padding: 24px; /* Move padding to the paragraph element */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .faq-section {
    padding: 60px 0;
  }

  .container {
    padding: 0 16px;
  }

  .faq-header {
    margin-bottom: 40px;
  }

  .faq-header h2 {
    font-size: 2rem;
  }

  .faq-header p {
    font-size: 1rem;
  }

  .faq-question {
    padding: 20px;
  }

  .faq-question h3 {
    font-size: 1rem;
    padding-right: 16px;
  }

  .faq-icon {
    font-size: 1.3rem;
  }

  .faq-answer p {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .faq-section {
    padding: 40px 0;
  }

  .faq-header h2 {
    font-size: 1.5rem;
  }

  .faq-question {
    padding: 16px;
  }

  .faq-question h3 {
    font-size: 0.95rem;
  }

  .faq-answer p {
    padding: 16px;
  }
}

/* Animation for smooth opening */
.faq-item.active {
  border: dashed 1px #ccc;
}

.faq-item.active .faq-question {
  background: #f5f5f5;
  border-bottom: 1px dashed #ccc;
}

/* Accessibility improvements */
.faq-question:focus {
  outline: 2px solid #e6e6e6;
  outline-offset: 2px;
}

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

/* -------------------- TEMPLATES PAGE -------------*/

/* Templates Page Fixed Styles */

/* Hero Section Stats - 4 highlights with proper styling */
/* FIXED: Enhanced Stats Section with Card Design */
.template-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 40px auto;
  max-width: 1000px;
  padding: 0 20px;
}

.stat-item {
  background: white;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff3f4a, #ff6b6b);
}

.stat-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-small {
  font-size: 1.2rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-big {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff3f4a;
  letter-spacing: 1px;
  line-height: 1;
}





/* --- New Stat Cards --- */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e6e6e6;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  background: #fff5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff3f4a;
  font-size: 28px;
  box-shadow: 0 2px 6px rgba(255, 63, 74, 0.25);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ff3f4a;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 40px auto;
  max-width: 1200px;
  padding: 0 20px;
}













/* FIXED: Search Container - Proper Icon Positioning */
.search-container {
  max-width: 400px;
  margin: 0 auto 30px auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.search-container .input-field {
  margin-bottom: 0;
  width: 100%;
  position: relative;
}

/* FIXED: Search Input with Proper Icon Inside */
.search-container .input-field input {
  border-radius: 25px !important;
  padding-left: 50px !important;
  padding-right: 20px !important;
  background: #f8f9fa !important;
  border: 2px solid #e9ecef !important;
  width: 100% !important;
  box-sizing: border-box !important;
  height: 48px !important;
  font-size: 16px !important;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

.search-container .input-field input:focus {
  border-color: #ff3f4a !important;
  box-shadow: 0 0 0 3px rgba(255, 63, 74, 0.1) !important;
  background: white !important;
}

/* FIXED: Search Icon Properly Positioned Inside Input */
.search-container .input-field .prefix {
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #6c757d !important;
  font-size: 20px !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

/* FIXED: Filter Chips - Keep Original Styling */
.template-filters {
  padding: 20px 0;
  width: 100%;
}

.chip-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.chip-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  height: 44px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
  border-radius: 22px;
  background: white;
  color: #495057;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 14px;
}

.chip-filter:hover {
  background-color: #fff5f5;
  color: #ff3f4a;
  border-color: #ff3f4a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 63, 74, 0.2);
}

.chip-filter.active {
  background-color: #ff3f4a !important;
  color: white !important;
  border-color: #ff3f4a !important;
  box-shadow: 0 4px 12px rgba(255, 63, 74, 0.3);
}

.chip-filter i {
  font-size: 18px;
}

.chip-filter span {
  font-size: 14px;
  font-weight: 500;
}

/* Templates Grid - Same as your existing card design */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.template-card {
  transition: all 0.3s ease;
}

.template-card.hidden {
  display: none;
}

.template-card .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e6e6e6;
}

.template-card .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.template-card .card-content {
  flex-grow: 1;
  position: relative;
  padding: 24px;
}

/* Template Badge - Smaller and positioned properly */
.template-badge {
  position: absolute;
  top: 30px;
  right: 24px;
}

.badge-small {
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Card Title - Properly positioned */
.template-card .card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 20px;
  padding-right: 80px; /* Space for badge */
  line-height: 1;
}

/* Card Description */
.template-card .card-content p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

/* Template Details - More elaborate information */
.template-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 0.85rem;
}

.detail-item .material-icons.tiny {
  font-size: 16px;
  color: #ff3f4a;
}

.detail-item span {
  font-weight: 500;
}

/* Card Actions - Two equal buttons */
.template-card .card-action {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #f5f5f5;
  border-top: 1px solid #e6e6e6;
}

.template-card .card-action .btn {
  flex: 1;
  height: 40px;
  line-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

.template-card .card-action .btn i {
  font-size: 18px;
  margin-right: 6px;
}


/* ------------- UPWARDS TEMPLATE CARDS */

/* FIXED: Mobile Responsive Design */
@media (max-width: 768px) {
  /* Search Container Mobile */
  .search-container {
    max-width: 100%;
    padding: 0 20px;
    margin: 0 auto 30px auto;
  }

  .search-container .input-field input {
    padding-left: 45px !important;
    font-size: 16px !important;
    height: 44px !important;
  }

  .search-container .input-field .prefix {
    left: 15px !important;
    font-size: 18px !important;
  }

  /* Stats Mobile */
  .template-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 15px;
  }

  .stat-item {
    padding: 20px 15px;
  }

  .stat-big {
    font-size: 1.5rem;
  }

  .stat-small {
    font-size: 0.8rem;
  }

  /* Filter Chips Mobile */
  .chip-container {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 20px 10px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .chip-container::-webkit-scrollbar {
    display: none;
  }

  .chip-filter {
    flex-shrink: 0;
    padding: 8px 14px;
    height: 40px;
    margin-right: 8px;
    font-size: 13px;
  }

  .chip-filter:last-child {
    margin-right: 20px;
  }
}

@media (max-width: 480px) {
  .search-container {
    padding: 0 15px;
  }

  .search-container .input-field input {
    height: 42px !important;
    padding-left: 40px !important;
  }

  .search-container .input-field .prefix {
    left: 12px !important;
    font-size: 16px !important;
  }

  .template-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 10px;
  }

  .stat-item {
    padding: 18px 12px;
  }

  .stat-big {
    font-size: 1.3rem;
  }

  .chip-container {
    padding: 0 15px 10px 15px;
  }

  .chip-filter {
    padding: 6px 12px;
    height: 36px;
    font-size: 12px;
  }

  .chip-filter i {
    font-size: 16px;
  }
}

/* FIXED: No Results Message */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.no-results i {
  font-size: 64px;
  color: #dee2e6;
  margin-bottom: 20px;
}

.no-results h5 {
  color: #495057;
  margin-bottom: 10px;
  font-weight: 600;
}

.no-results p {
  color: #6c757d;
  font-size: 0.9rem;
}
/* Ensure cards match your existing design system */
.template-card .card.hoverable:hover {
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}


.custom-rounded {
  border-radius: 12px !important;
  overflow: hidden; /* keeps corners clean */
}

.custom-btn-rounded {
  background-color: #666 !important;
  border: solid 1px #fff !important;
  font-weight: bold;
  border-radius: 8px !important;
}

.value-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e6e6e6;
  transition: all 0.3s ease;
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.value-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  background: #fff5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff3f4a;
  font-size: 28px;
  box-shadow: 0 2px 6px rgba(255, 63, 74, 0.25);
}

.value-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ff3f4a;
  margin-bottom: 4px;
}

.value-label {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
}

/* Stats Grid */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 40px auto;
  max-width: 1200px;
  padding: 0 20px;
}



