/* ============================================
   P3Webs.com - Free AI Tools Website
   Global Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --primary-bg: #f0fdfa;
  --secondary: #1e293b;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text: #334155;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
  --max-width: 1200px;
  --header-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  position: relative;
}

.main-nav a:hover {
  color: var(--primary);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.nav-cta {
  background: var(--primary);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--primary-dark);
}

.nav-cta::after {
  display: none !important;
}

/* Mobile menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-toggle .bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-dark);
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.mobile-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 40%, #14b8a6 100%);
  color: white;
  padding: 4rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 1; }
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 1;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-search input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-right: 3.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
  outline: none;
}

.hero-search input:focus {
  box-shadow: 0 0 0 3px rgba(13,148,136,0.3), var(--shadow-lg);
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 44px;
  background: var(--primary-dark);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.hero-search button:hover {
  background: var(--secondary);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-stats .stat {
  text-align: center;
}

.hero-stats .stat-number {
  font-size: 1.75rem;
  font-weight: 800;
}

.hero-stats .stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* --- Ad Placeholder --- */
.ad-placeholder {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 1.5rem 0;
}

.ad-placeholder.top-banner {
  margin: 1rem auto;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder.in-content {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder.bottom {
  min-height: 90px;
  max-width: 728px;
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Section Styles --- */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* --- Tool Card Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.tool-card-icon.ai { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); }
.tool-card-icon.resume { background: linear-gradient(135deg, #fefce8, #fef9c3); }
.tool-card-icon.social { background: linear-gradient(135deg, #fdf2f8, #fce7f3); }
.tool-card-icon.utility { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); }
.tool-card-icon.business { background: linear-gradient(135deg, #fff7ed, #ffedd5); }
.tool-card-icon.seo { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.tool-card-icon.student { background: linear-gradient(135deg, #faf5ff, #f3e8ff); }

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  flex-grow: 1;
}

.tool-card-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 1rem;
}

.badge-free {
  background: #dcfce7;
  color: #166534;
}

.badge-ai {
  background: #f0fdfa;
  color: #0f766e;
}

.tool-card-arrow {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  color: var(--text-light);
  transition: var(--transition);
}

.tool-card:hover .tool-card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* --- Category Section on Homepage --- */
.category-section {
  padding: 3rem 0;
}

.category-section:nth-child(even) {
  background: var(--bg-secondary);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-header .view-all {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

/* --- Tool Page Styles --- */
.tool-page {
  padding-top: 2rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - var(--header-height) - 200px);
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.tool-breadcrumb a {
  color: var(--text-light);
}

.tool-breadcrumb a:hover {
  color: var(--primary);
}

.tool-breadcrumb .separator {
  color: var(--border);
}

.tool-breadcrumb .current {
  color: var(--text-dark);
  font-weight: 500;
}

.tool-page-header {
  margin-bottom: 2rem;
}

.tool-page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.tool-page-header p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 700px;
}

/* --- Tool Interface --- */
.tool-interface {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.tool-interface label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.tool-interface textarea,
.tool-interface input[type="text"],
.tool-interface input[type="number"],
.tool-interface select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg);
  transition: var(--transition);
  resize: vertical;
}

.tool-interface textarea:focus,
.tool-interface input[type="text"]:focus,
.tool-interface input[type="number"]:focus,
.tool-interface select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

.tool-interface textarea {
  min-height: 120px;
}

.form-group {
  margin-bottom: 1.25rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--primary);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-group .btn {
  flex-shrink: 0;
}

/* --- Output Area --- */
.output-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1.5rem;
  min-height: 120px;
  position: relative;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.95rem;
}

.output-area:empty::before {
  content: 'Results will appear here...';
  color: var(--text-light);
  font-style: italic;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.output-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.copy-btn.copied {
  background: #dcfce7;
  border-color: var(--success);
  color: #166534;
}

/* --- Loading Spinner --- */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.loading.active {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* --- Error Message --- */
.error-msg {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.error-msg.active {
  display: block;
}

/* --- Terms / Legal Page Content --- */
.terms-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-bg);
}

.terms-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.terms-content ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.terms-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  line-height: 1.7;
  color: var(--text);
}

.terms-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* --- FAQ Section --- */
.faq-section {
  margin: 3rem 0;
}

.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--bg-secondary);
}

.faq-question .faq-toggle {
  font-size: 1.25rem;
  color: var(--text-light);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.open .faq-toggle {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  color: var(--text);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

/* --- Related Tools --- */
.related-tools {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-tools h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.related-tool-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.related-tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.related-tool-card .rt-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.related-tool-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.related-tool-card p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- Footer --- */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-col h4 {
  color: white;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

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

.footer-bottom-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}

.footer-bottom-links a:hover {
  color: white;
}

/* --- Features Section --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.feature-card .feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* --- Checkbox / Toggle Group --- */
.toggle-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* --- Password Generator Specific --- */
.password-display {
  font-family: 'Courier New', monospace;
  font-size: 1.25rem;
  letter-spacing: 1px;
  padding: 1.25rem;
  background: var(--secondary);
  color: #a5f3fc;
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strength-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin-top: 0.75rem;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

/* --- Range Slider --- */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

/* --- Stats Display --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* --- Invoice / Printable --- */
.print-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--text-dark);
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.invoice-table th,
.invoice-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.invoice-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
  text-transform: uppercase;
}

.invoice-total {
  text-align: right;
  margin-top: 1rem;
}

.invoice-total .total-row {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding: 0.5rem 0;
}

.invoice-total .total-row.grand {
  font-weight: 800;
  font-size: 1.2rem;
  border-top: 2px solid var(--text-dark);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* --- QR Code --- */
.qr-output {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.qr-output canvas,
.qr-output img {
  border: 4px solid var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 0;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .mobile-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .hero-stats .stat-number {
    font-size: 1.3rem;
  }

  .section {
    padding: 3rem 0;
  }

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

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .tool-interface {
    padding: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .tool-page-header h1 {
    font-size: 1.5rem;
  }
}

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

  .hero {
    padding: 2.5rem 0 3rem;
  }

  .hero h1 {
    font-size: 1.65rem;
  }

  .tool-card {
    padding: 1.25rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Print Styles --- */
@media print {
  .site-header,
  .site-footer,
  .ad-placeholder,
  .related-tools,
  .faq-section,
  .no-print {
    display: none !important;
  }

  .tool-page {
    padding-top: 0;
  }

  .print-container {
    border: none;
    padding: 0;
    box-shadow: none;
  }
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--secondary);
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-xl);
  animation: slideInRight 0.3s ease;
  max-width: 350px;
}

.toast.success {
  background: #166534;
}

.toast.error {
  background: #991b1b;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* --- About Page --- */
.about-content-section {
  margin-bottom: 2.5rem;
}

.about-content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-bg);
}

.about-content-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.about-content-section p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 0.85rem;
  font-size: 1rem;
}

.about-content-section a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.about-content-section a:hover {
  color: var(--primary-dark);
}

.about-content-section strong {
  color: var(--text-dark);
}

/* --- Blog Styles --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.blog-card-category {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  width: fit-content;
}

.blog-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.blog-card h2 a {
  color: var(--text-dark);
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: var(--primary);
}

.blog-card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.blog-read-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.blog-read-more:hover {
  color: var(--primary-dark);
  gap: 0.5rem;
}

/* Blog Article Page */
.blog-article {
  max-width: 800px;
  margin: 0 auto;
}

.blog-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.blog-article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.3;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.blog-article-meta {
  font-size: 0.9rem;
  color: var(--text-light);
}

.blog-article-body {
  margin-bottom: 2rem;
}

.blog-cta-box {
  background: linear-gradient(135deg, var(--primary-bg), #ccfbf1);
  border: 1px solid rgba(13,148,136,0.2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
}

.blog-cta-box h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.blog-cta-box p {
  color: var(--text);
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

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

  .blog-article-header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .blog-card {
    padding: 1.25rem;
  }

  .blog-card h2 {
    font-size: 1.1rem;
  }
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
