:root {
  --bg-color: #fafbfc;
  --bg-dots: rgba(231, 19, 20, 0.015);
  --surface-color: rgba(255, 255, 255, 0.85);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --surface-border: rgba(231, 19, 20, 0.06);
  --surface-border-hover: rgba(231, 19, 20, 0.25);
  --text-primary: #090d1f;
  --text-secondary: #4b5563;
  --text-muted: #828b9a;
  --primary: #e71314;
  --primary-rgb: 231, 19, 20;
  --accent: #0d0d0d;
  --accent-rgb: 13, 13, 13;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient-main: linear-gradient(135deg, #e71314 0%, #b91c1c 50%, #0d0d0d 100%);
  --gradient-hover: linear-gradient(135deg, #c21011 0%, #991b1b 50%, #000000 100%);
  --gradient-glow: linear-gradient(135deg, rgba(231, 19, 20, 0.12) 0%, rgba(13, 13, 13, 0.12) 100%);
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 12px 30px -10px rgba(0, 0, 0, 0.04), 0 4px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 20px 40px -15px rgba(231, 19, 20, 0.15), 0 0 0 1px rgba(231, 19, 20, 0.04);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(231, 19, 20, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(249, 115, 22, 0.04) 0%, transparent 45%),
    radial-gradient(var(--bg-dots) 1.5px, transparent 1.5px);
  background-size: 100% 100%, 100% 100%, 30px 30px;
  font-family: var(--font-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Background Aura Highlights (AI Fiesta style decoration matched to Logo Red) */
.aura-bg {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.6;
  pointer-events: none;
}

.aura-primary {
  top: 10%;
  right: 5%;
  background: rgba(231, 19, 20, 0.08);
}

.aura-accent {
  bottom: 15%;
  left: 5%;
  background: rgba(13, 13, 13, 0.04);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 {
  font-size: 2.75rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  font-weight: 900;
}

h2 {
  font-size: 1.85rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
  overflow-wrap: break-word;
  word-break: break-word;
}

a:hover {
  color: var(--accent);
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.glass-panel:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-2px);
}

/* Inputs & Form Controls */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
}

.input-control {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border: 1px solid rgba(231, 19, 20, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
  outline: none;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.01);
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(231, 19, 20, 0.08);
}

.input-control::placeholder {
  color: var(--text-muted);
}

/* Select element styling reset override for consistency */
select.input-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23e71314'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 1.25rem;
  padding-right: 2.75rem;
}

/* Button & Action controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 15px rgba(231, 19, 20, 0.25);
}

.btn-primary:hover {
  background: var(--gradient-hover);
  transform: translateY(-2.5px);
  box-shadow: 0 8px 25px rgba(231, 19, 20, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid rgba(231, 19, 20, 0.15);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #fdfdfd;
  color: var(--text-primary);
  border-color: rgba(231, 19, 20, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 19, 20, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.nav-logo img {
  height: 32px;
  transition: var(--transition-normal);
}

.nav-logo:hover {
  transform: scale(1.03);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-item a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
}

.nav-item a:hover, .nav-item.active a {
  color: var(--primary);
  background: rgba(231, 19, 20, 0.06);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Footer styling */
.footer {
  background: #f9fafb;
  border-top: 1px solid rgba(231, 19, 20, 0.08);
  padding: 4rem 1.5rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-about .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.footer-about .footer-logo img {
  height: 28px;
}

.footer-about p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-links h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.6rem;
}

.footer-links ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links ul li a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(231, 19, 20, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom-links a:hover {
  color: var(--text-secondary);
}

/* Layout Utilities */
.app-container {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

.input-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-row-grid-asymmetric {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .input-row-grid,
  .input-row-grid-asymmetric {
    grid-template-columns: 1fr;
  }
}

.calculator-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border-bottom: 1px solid rgba(231, 19, 20, 0.08);
    padding: 1.5rem;
    gap: 1.25rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  .nav-menu.open {
    display: flex;
  }
  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  h1 {
    font-size: 1.75rem !important;
  }
  h2 {
    font-size: 1.35rem !important;
  }
  h3 {
    font-size: 1.15rem !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .app-container {
    padding: 0 1rem;
  }
  .glass-panel, .seo-content-rich {
    padding: 1.5rem;
  }
  .tool-card {
    padding: 1.5rem;
  }
}

/* Expandable Grid Layout (for homepage & future extensions) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  margin-top: 2rem;
}

/* Card design for tools */
.tool-card {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-main);
  opacity: 0;
  transition: var(--transition-normal);
}

.tool-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(231, 19, 20, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
  transition: var(--transition-normal);
}

.tool-card:hover .tool-icon-wrapper {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 8px 20px rgba(231, 19, 20, 0.25);
}

.tool-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.tool-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  flex-grow: 1;
  line-height: 1.6;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: 65%;
}

.tool-tag {
  font-size: 0.72rem;
  background: var(--gradient-glow);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid rgba(231, 19, 20, 0.08);
}

/* Copy success toast notification */
.toast {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  background: var(--text-primary);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* SEO Content Area (Bottom of Page) */
.seo-section {
  margin-top: 6rem;
  border-top: 1px solid rgba(231, 19, 20, 0.08);
  padding-top: 5rem;
  margin-bottom: 4rem;
}

.seo-title {
  text-align: center;
  margin-bottom: 4rem;
}

.seo-title h2 {
  font-size: 2.4rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.seo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3.5rem;
}

@media (max-width: 900px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

.seo-content-rich {
  color: var(--text-secondary);
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.seo-content-rich::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.seo-content-rich:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.seo-content-rich p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.85;
  text-align: justify;
}

.seo-content-rich h3 {
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.seo-content-rich ul, .seo-content-rich ol {
  margin-bottom: 2rem;
  padding-left: 1.75rem;
}

.seo-content-rich li {
  margin-bottom: 0.65rem;
  font-size: 1.02rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: #ffffff;
  border: 1px solid rgba(231, 19, 20, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.5rem;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
  transition: var(--transition-fast);
}

.faq-item.active {
  border-color: var(--surface-border-hover);
  background: #ffffff;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.75;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding: 0 1.5rem 1.5rem;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

/* Print / PDF Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }
  .navbar, .footer, .btn, .form-group, .seo-section, .input-control, .toast {
    display: none !important;
  }
  .app-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .calculator-layout {
    grid-template-columns: 1fr !important;
  }
  .glass-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .print-only {
    display: block !important;
  }
}
.print-only {
  display: none;
}

/* Star Rating System Styles */
.rating-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px dashed var(--surface-border);
}
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.star-rating .star {
  font-size: 1.85rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color var(--transition-fast), transform 0.1s ease;
}
.star-rating .star:hover,
.star-rating .star:hover ~ .star,
.star-rating .star.active,
.star-rating .star.active ~ .star {
  color: #fbbf24;
}
.star-rating .star:active {
  transform: scale(0.9);
}
.star-rating.rated .star {
  cursor: default;
  pointer-events: none;
}

/* Article & Blog post responsive tweaks */
.article-container {
  max-width: 800px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .article-container {
    padding: 0 1rem !important; /* Matches homepage app-container side padding */
  }
  .article-container .glass-panel,
  .article-container article.glass-panel {
    padding: 1.5rem !important; /* Prevent text squishing on mobile */
  }
}
