/* ============================================
   GLOBAL STYLES — assets/css/style.css
   Used by ALL pages on the website
============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- CSS Variables (Easy to change your color theme) --- */
:root {
  --primary:       #4F46E5;   /* Indigo — main brand color */
  --primary-dark:  #3730A3;   /* Darker indigo for hover */
  --primary-light: #EEF2FF;   /* Light indigo for backgrounds */
  --secondary:     #06B6D4;   /* Cyan accent */
  --text-dark:     #1E293B;   /* Main text */
  --text-mid:      #475569;   /* Subtext */
  --text-light:    #94A3B8;   /* Placeholder text */
  --bg:            #F8FAFC;   /* Page background */
  --white:         #FFFFFF;
  --border:        #E2E8F0;
  --shadow:        0 4px 6px -1px rgba(0,0,0,0.07);
  --shadow-md:     0 10px 25px -3px rgba(0,0,0,0.1);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    all 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

/* ============================================
   HEADER / NAVIGATION
============================================ */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo span {
  color: var(--text-dark);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: var(--text-mid);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Hamburger Menu (Mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}

.hamburger span {
  width: 25px;
  height: 2.5px;
  background: var(--text-dark);
  border-radius: 5px;
  transition: var(--transition);
}

/* Mobile Nav Menu */
.mobile-menu {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 15px 20px;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu a {
  color: var(--text-mid);
  font-size: 1rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu.open {
  display: flex;
}

/* ============================================
   AD BANNER AREA
============================================ */
.ad-banner {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  text-align: center;
}

.ad-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Placeholder styling for when AdSense isn't active yet */
.ad-placeholder {
  background: #f1f5f9;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  color: var(--text-light);
  font-size: 0.8rem;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   MAIN CONTENT WRAPPER
============================================ */
main {
  flex: 1; /* Pushes footer to bottom */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   HOMEPAGE — HERO SECTION
============================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 25px;
}

/* Search Bar */
.search-bar {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  box-shadow: var(--shadow-md);
}

.search-bar button {
  padding: 12px 22px;
  background: var(--text-dark);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-bar button:hover {
  background: #0f172a;
}

/* ============================================
   HOMEPAGE — CATEGORY SECTION
============================================ */
.tools-section {
  padding: 50px 20px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-mid);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.category-label {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 50px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--text-dark);
}

.tool-card-icon {
  font-size: 1.8rem;
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.tool-card p {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.tool-card-arrow {
  margin-top: auto;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   TOOL PAGE LAYOUT
============================================ */
.tool-page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 30px 20px;
}

.tool-page-header .breadcrumb {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.tool-page-header .breadcrumb a {
  color: var(--text-light);
}

.tool-page-header .breadcrumb a:hover {
  color: var(--primary);
}

.tool-page-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.tool-page-header p {
  color: var(--text-mid);
  font-size: 0.95rem;
  max-width: 700px;
}

/* Tool Body Layout */
.tool-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: start;
}

/* Tool Main Area */
.tool-main {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Tool Box */
.tool-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.tool-box h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: #10B981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

/* Textareas & Inputs */
textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', monospace;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--bg);
  resize: vertical;
  outline: none;
  transition: var(--transition);
  line-height: 1.6;
}

textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="text"],
input[type="number"],
input[type="url"],
select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 18px;
}

/* Stats / Result Display */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-top: 3px;
}

/* Sidebar Ad Area */
.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-ad {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  text-align: center;
  box-shadow: var(--shadow);
}

/* Related Tools in Sidebar */
.related-tools {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.related-tools h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.related-tools ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-tools ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-mid);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.related-tools ul li a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ============================================
   HOW TO USE SECTION (Below Tool)
============================================ */
.how-to-section,
.faq-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}

.how-to-section h2,
.faq-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.step-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-dark);
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-mid);
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-question {
  padding: 15px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
  background: var(--bg);
  transition: var(--transition);
  user-select: none;
}

.faq-question:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.faq-question.active {
  background: var(--primary-light);
  color: var(--primary);
}

.faq-icon {
  font-size: 1.2rem;
  transition: var(--transition);
}

.faq-question.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 15px 18px;
  font-size: 0.88rem;
  color: var(--text-mid);
  border-top: 1px solid var(--border);
  line-height: 1.7;
  background: white;
}

.faq-answer.open {
  display: block;
}

/* ============================================
   FOOTER
============================================ */
footer {
  background: var(--text-dark);
  color: #CBD5E1;
  padding: 50px 20px 20px;
  margin-top: auto;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #334155;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 15px;
  display: inline-flex;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #94A3B8;
}

.footer-col h4 {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col ul li a {
  color: #94A3B8;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================
   NOTIFICATION / TOAST
============================================ */
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #1E293B;
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #10B981;
}

.toast.error {
  border-left: 4px solid #EF4444;
}

/* ============================================
   RESPONSIVE — MOBILE STYLES
============================================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero h1 { font-size: 1.8rem; }
  .hero p  { font-size: 0.95rem; }

  .search-bar {
    flex-direction: column;
  }

  .tool-body {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    order: -1; /* Move sidebar above tool on mobile */
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 { font-size: 1.5rem; }
}