/* ===== BASE STYLES ===== */
:root {
  /* Header & Footer Colors */
  --header-bg-start: #3f51b5; /* Deeper blue for gradient start */
  --header-bg-end: #673ab7;   /* Purple for gradient end */
  --header-text-color: #ffffff;
  --footer-bg-color: #2c3e50; /* Dark blue-grey */
  --footer-text-color: #cccccc;
  --footer-link-color: #eeeeee;

  /* QR Code Generator Specific Colors */
  --body-bg: #f5f5f5;
  --calculator-bg: white;
  --calculator-shadow: rgba(0, 0, 0, 0.1);
  --title-color: #1c354e;
  --subtitle-color: #1c354e;
  --marquee-color: red;
  --stars-color: gold;
  --label-color: #333;
  --input-border: #ddd;
  --input-focus-border: #007bff;
  --button-bg: #007bff;
  --button-hover-bg: #0056b3;
  --button-text-color: white;
  --qr-label-color: #444;

  /* Related Tools Buttons */
  --barcode-btn-bg: #bef0f5;
  --barcode-btn-text: hsl(188, 92%, 5%);
  --barcode-btn-hover: #8fc6e3;

  --bar-reader-btn-bg: #f5f5be;
  --bar-reader-btn-text: hsl(53, 94%, 20%);
  --bar-reader-btn-hover: #ebe3bf;

  --currency-btn-bg: #bef5cc;
  --currency-btn-text: hsl(172, 94%, 20%);
  --currency-btn-hover: #bfebd7;

  /* Info Section Specific Colors */
  --info-section-bg: #ffffff;
  --info-section-shadow: rgba(0, 0, 0, 0.08);
  --info-h1-color: #1c3d5a; /* Main section title */
  --info-h2-color: #1c3d5a; /* Sub-section titles */
  --info-text-color: #333;
  --code-bg: #f1f1f1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Consistent font */
  background-color: var(--body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER STYLES ===== */
.main-header {
  background: linear-gradient(135deg, var(--header-bg-start), var(--header-bg-end));
  padding: 15px 30px;
  color: var(--header-text-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 100%;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
}

.header-logo-img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.918);
  padding: 2px;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
}

.main-nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.main-nav ul li a:hover {
  opacity: 0.8;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
}

.hamburger-menu .bar {
  width: 25px;
  height: 3px;
  background-color: var(--header-text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-nav {
  display: none;
  background: var(--header-bg-end);
  width: 100%;
  position: absolute;
  top: 70px; /* Adjust based on actual header height */
  left: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 999;
}

.mobile-nav.active {
  display: block;
  transform: translateY(0);
}

.mobile-nav ul {
  list-style: none;
  padding: 10px 0;
  text-align: center;
}

.mobile-nav ul li {
  padding: 12px 20px;
}

.mobile-nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  font-size: 18px;
  display: block;
}

.mobile-nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Hamburger animation */
.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ===== MAIN CONTENT WRAPPER ===== */
.content-wrapper {
  flex-grow: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* ===== CALCULATOR (Main QR Generator Area) STYLES ===== */
.calculator { /* Renamed from .container */
  max-width: 600px;
  width: 100%;
  margin: 20px auto; /* Centered with top/bottom margin */
  background: var(--calculator-bg);
  border-radius: 8px;
  box-shadow: 0 2px 10px var(--calculator-shadow);
  padding: 30px;
  text-align: center;
}

.document-header {
  margin-bottom: 20px;
}

.title {
  font-size: 26px;
  font-weight: bold;
  color: var(--title-color);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.icon-small {
  width: 50px;
  height: 50px;
  vertical-align: middle;
  margin-right: 16px;
}

.subtitle {
  font-size: 18px;
  color: var(--subtitle-color);
  text-align: center;
}

.marquee {
  color: var(--marquee-color);
  margin-top: 10px;
}

.blinking-stars {
  animation: blinkGlow 1s infinite;
  color: var(--stars-color);
  font-size: 14px;
  text-shadow: 0 0 0px var(--stars-color), 0 0 5px #ffeb3b;
}

.input-section {
  margin-top: 30px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--label-color);
  text-align: left;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--input-border);
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--input-focus-border);
}

.preview-section {
  margin: 30px 0;
}

canvas {
  margin: 10px auto;
  display: block;
}

.qr-label {
  font-weight: bold;
  color: var(--qr-label-color);
  margin-top: 10px;
}

button {
  padding: 10px 20px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--button-bg);
  color: var(--button-text-color);
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: var(--button-hover-bg);
}

@keyframes blinkGlow {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 0px var(--stars-color), 0 0 5px #ffeb3b;
  }
  50% {
    opacity: 0.2;
    text-shadow: none;
  }
}

/* ===== RELATED TOOLS SECTION ===== */
.interest_related {
  display: flex; /* Changed from inline-flex for better layout control */
  flex-direction: column; /* Stack heading and buttons */
  align-items: center; /* Center content */
  text-align: center; /* Center text */
  margin: 30px auto;
  padding: 25px;
  max-width: 850px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
  background-color: var(--info-section-bg); /* Use info section background */
}

.interest_related h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--title-color);
}

.related-buttons {
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap */
  justify-content: center; /* Center buttons */
  gap: 15px; /* Space between buttons */
}

.interest_related a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 16px;
}

.interest_related .icon-small {
  width: 30px; /* Smaller icon for buttons */
  height: 30px;
  margin-right: 8px;
}

.bttn_bar-code {
  background: var(--barcode-btn-bg);
  color: var(--barcode-btn-text);
}
.bttn_bar-code:hover {
  background: var(--barcode-btn-hover);
}

.bttn_bar_reader {
  background: var(--bar-reader-btn-bg);
  color: var(--bar-reader-btn-text);
}
.bttn_bar_reader:hover {
  background: var(--bar-reader-btn-hover);
}

.bttn_currency {
  background: var(--currency-btn-bg);
  color: var(--currency-btn-text);
}
.bttn_currency:hover {
  background: var(--currency-btn-hover);
}

/* ===== INFO SECTION STYLES ===== */
.info-section {
  background-color: var(--info-section-bg);
  margin: 30px auto;
  padding: 25px;
  max-width: 850px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
}

.info-section h1 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--info-h1-color);
  font-size: 28px;
  margin-bottom: 20px;
  text-align: left;
}

.info-section h2 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--info-h2-color);
  font-size: 26px;
  margin-bottom: 12px;
  margin-top: 20px;
  text-align: left;
}
.info-section h3 { /* For sub-sub-headings within info sections */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--info-h2-color);
  font-size: 22px;
  margin-bottom: 10px;
  margin-top: 15px;
  text-align: left;
}

.info-section p, .info-section li {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--info-text-color);
  font-size: 17px;
  line-height: 1.7;
  text-align: justify;
}

.info-section ol, .info-section ul {
  padding-left: 22px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.info-section ul li {
  list-style-type: disc; /* Ensure bullet points are visible */
}
.info-section ol li {
  list-style-type: decimal; /* Ensure numbered lists are visible */
}

.info-section code {
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
}

/* ===== FOOTER STYLES ===== */
.main-footer {
  background-color: var(--footer-bg-color);
  color: var(--footer-text-color);
  padding: 40px 20px 20px;
  margin-top: auto; /* Pushes footer to the bottom */
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section {
  padding: 10px;
  text-align: left;
}

.footer-logo-section {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.footer-logo-img {
  width: 35px;
  height: 35px;
  margin-right: 10px;
  border-radius: 0.5rem;
  background: #fefeff;
  padding: 2px;
}

.footer-site-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--footer-link-color);
}

.footer-section h3 { /* Changed from h4 to h3 for consistency with previous pages */
  color: var(--footer-link-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-section p {
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 0;
  color: var(--footer-text-color);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--footer-text-color);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--footer-link-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 14px;
  color: var(--footer-text-color);
}

/* Removed old footer-logo-icon styles as they are replaced by footer-logo-img */


/* ===== STICKY CHAT ICON STYLES ===== */
.sticky-chat-icon {
  display: inline-block;
  text-decoration: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  cursor: pointer;
}

.sticky-chat-icon > div:first-child {
  width: 50px;
  height: 50px;
  background-color: #8800f8;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.sticky-chat-icon svg {
  width: 25px;
  height: 25px;
  fill: white;
}

.sticky-chat-icon > div:last-child {
  position: absolute;
  width: 80px;
  height: 80px;
  background: #8800f8;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.4;
  animation: wave 2s infinite linear;
}

@keyframes wave {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.4;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .main-header {
    padding: 10px 20px;
  }

  .main-nav {
    display: none;
  }

  .hamburger-menu {
    display: flex;
  }

  .site-title {
    font-size: 20px;
  }

  .header-logo-img {
    width: 35px;
    height: 35px;
  }

  .content-wrapper {
    padding: 15px;
  }

  .calculator {
    padding: 20px;
    margin-top: 15px;
    margin-bottom: 1.5rem;
  }

  .title {
    font-size: 24px;
    flex-direction: column;
    gap: 10px;
  }

  .icon-small {
    margin-right: 0;
  }

  .subtitle {
    font-size: 16px;
  }

  .interest_related {
    padding: 20px;
    margin: 15px auto;
  }

  .interest_related h3 {
    font-size: 1.3rem;
  }

  .related-buttons {
    flex-direction: column; /* Stack buttons vertically on small screens */
    gap: 10px;
  }
  .interest_related a {
    width: 100%; /* Full width for stacked buttons */
    justify-content: center; /* Center content within button */
    padding: 0.6rem 1rem;
    font-size: 15px;
  }
  .interest_related .icon-small {
    width: 25px;
    height: 25px;
  }


  .info-section {
    padding: 20px;
    margin: 15px auto;
  }
  .info-section h1 {
    font-size: 24px;
    text-align: center;
  }
  .info-section h2 {
    font-size: 1.3rem;
    text-align: center;
  }
  .info-section h3 {
    font-size: 1.1rem;
    text-align: center;
  }
  .info-section p, .info-section ol, .info-section ul, .info-section li {
    font-size: 0.95rem;
    text-align: left;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-section {
    padding: 15px 0;
  }

  .footer-logo-section {
    justify-content: center;
  }

  .footer-section p, .footer-section ul {
    text-align: center;
  }

  .sticky-chat-icon {
    bottom: 20px !important;
    right: 20px !important;
  }

  .sticky-chat-icon > div:first-child {
    width: 45px !important;
    height: 45px !important;
  }

  .sticky-chat-icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  .sticky-chat-icon > div:last-child {
    width: 65px !important;
    height: 65px !important;
  }
}

@media (max-width: 480px) {
  .calculator {
    padding: 15px;
  }
  .title {
    font-size: 20px;
  }
  .icon-small {
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }
  .subtitle {
    font-size: 15px;
  }
  .input-section label {
    font-size: 0.9rem;
  }
  input[type="text"] {
    padding: 10px;
    font-size: 15px;
  }
  button {
    padding: 10px 15px;
    font-size: 14px;
  }

  .interest_related {
    padding: 15px;
  }
  .interest_related h3 {
    font-size: 1.2rem;
  }
  .interest_related a {
    font-size: 14px;
    padding: 0.5rem 0.8rem;
  }
  .interest_related .icon-small {
    width: 20px;
    height: 20px;
  }

  .info-section {
    padding: 15px;
  }
  .info-section h1 {
    font-size: 20px;
  }
  .info-section h2 {
    font-size: 1.2rem;
  }
  .info-section h3 {
    font-size: 1rem;
  }
  .info-section p, .info-section ol, .info-section ul, .info-section li {
    font-size: 0.88rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: none;
    padding: 0;
  }

  .main-header, .main-footer, .sticky-chat-icon, .mobile-nav, .hamburger-menu, .marquee, #downloadBtn {
    display: none !important;
  }

  .content-wrapper {
    padding: 0;
  }

  .calculator {
    box-shadow: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
  }

  .result {
    background: none;
    padding: 0;
    display: block !important;
  }

  .info-section, .interest_related {
    box-shadow: none;
    padding: 15px 0;
    margin: 15px auto;
  }

  /* Ensure text colors are readable on white print background */
  body, .calculator, .info-section, .interest_related {
    color: black;
  }
  .title, .subtitle, label, input, .qr-label, .interest_related h3,
  .interest_related a, .info-section h1, .info-section h2, .info-section h3,
  .info-section p, .info-section li, .info-section code {
    color: #000 !important; /* Force black for print */
    background: none !important;
    text-shadow: none !important;
  }
  .blinking-stars {
    animation: none !important;
    color: #000 !important;
    text-shadow: none !important;
  }
}