/* ============================================
   Main Stylesheet
   Mobile-first, AdSense-ready
============================================ */

:root {
  --green: #00C896;
  --green-dark: #00a87e;
  --green-light: #e6faf5;
  --dark: #0d1117;
  --dark-2: #161b22;
  --dark-3: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--green-dark); }

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: rgba(0,200,150,0.12);
  border: 1px solid rgba(0,200,150,0.3);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}
.logo-pk { color: var(--green); }

.main-nav { 
  display: flex; 
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-links > li > a {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links > li > a:hover {
  color: var(--text);
  background: var(--dark-3);
}

.has-dropdown { position: relative; }

.dropdown-icon {
  font-size: 0.6em;
  transition: transform 0.2s;
}

.has-dropdown:hover .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-container {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 200;
  width: min(820px, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
}

.has-dropdown:hover .dropdown-container { display: block; }

.nav-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
}

.category-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-column h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-tool-card {
  display: grid !important;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  min-height: auto;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm) !important;
  padding: 8px !important;
  color: var(--text) !important;
}

.menu-tool-card:hover {
  background: var(--dark-3) !important;
  border: none;
}

.menu-tool-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--green);
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.22);
}

.menu-tool-card span:not(.menu-tool-icon) {
  display: flex;
  flex-direction: column;
}

.menu-tool-card strong {
  display: block;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.25;
  font-weight: 600;
}

.menu-tool-card small {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}


/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, var(--dark-2) 0%, var(--dark) 100%);
  border-bottom: 1px solid var(--border);
  padding: 60px 20px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,200,150,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 680px; margin: 0 auto; }

.badge {
  display: inline-block;
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  color: var(--green);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--white);
  letter-spacing: 0;
}

.accent { color: var(--green); }

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ============ AD CONTAINERS ============ */
.ad-container {
  width: 100%;
  text-align: center;
  padding: 16px 20px;
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 10px;
}

.ad-container:empty { display: none; }

/* ============ TOOLS GRID ============ */
.tools-section { padding: 60px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--white);
}

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

.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,200,150,0.1);
  color: var(--text);
}

.tool-card.featured {
  border-color: rgba(0,200,150,0.4);
  background: linear-gradient(135deg, var(--dark-2), rgba(0,200,150,0.05));
}

.tool-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--green);
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-icon { font-size: 2rem; flex-shrink: 0; }

.tool-info h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--white);
}

.tool-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--green);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

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

/* ============ WHY SECTION ============ */
.why-section {
  padding: 60px 0;
  background: var(--dark-2);
  border-top: 1px solid var(--border);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.why-card {
  padding: 24px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.why-icon { font-size: 2rem; display: block; margin-bottom: 12px; }

.why-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--white);
}

.why-card p { font-size: 0.875rem; color: var(--text-muted); }

/* ============ CALCULATOR PAGES ============ */
.calc-page { padding: 40px 0 80px; }

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

.calc-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
}

.calc-header p { color: var(--text-muted); font-size: 1rem; }

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.calc-box {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.calc-box h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--white);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* FORM ELEMENTS */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.1);
}

.form-group select option { background: var(--dark-3); }

.input-prefix {
  position: relative;
}

.input-prefix span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-prefix input { padding-left: 36px; }

.btn-calc {
  width: 100%;
  background: var(--green);
  color: var(--dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-calc:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,200,150,0.3);
}

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

/* RESULT BOX */
.result-box { display: none; }
.result-box.show { display: block; }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.result-item:last-child { border-bottom: none; }

.result-label { color: var(--text-muted); }

.result-value {
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.result-item.highlight .result-value {
  color: var(--green);
  font-size: 1.2rem;
}

.result-item.negative .result-value { color: #f85149; }

/* INFO SECTION */
.info-section {
  margin-top: 48px;
  padding: 32px;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 12px;
}

.info-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.info-section p:last-child { margin-bottom: 0; }

/* AD SIDEBAR */
.ad-sidebar {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  min-height: 250px;
}

.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ============ ABOUT / STATIC PAGES ============ */
.static-page { padding: 60px 0; max-width: 720px; margin: 0 auto; }

.static-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 24px;
}

.static-page h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin: 32px 0 12px;
}

.static-page p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 60px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 12px;
  max-width: 280px;
}

.footer-links h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

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

.footer-links ul li { margin-bottom: 8px; }

.footer-links ul li a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links ul li a:hover { color: var(--green); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

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

/* ============ INVOICE ============ */
.invoice-preview {
  background: #fff;
  color: #111;
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 0;
}

.invoice-preview * { color: #111; }

.invoice-header { display: flex; justify-content: space-between; margin-bottom: 32px; }
.invoice-title { font-size: 2rem; font-weight: 800; color: #00C896 !important; }
.invoice-meta p { font-size: 0.875rem; margin-bottom: 4px; color: #555 !important; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.invoice-parties h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: #999 !important; margin-bottom: 8px; }
.invoice-parties p { font-size: 0.9rem; line-height: 1.6; }

.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.invoice-table th { background: #f5f5f5; padding: 10px 14px; text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: #666 !important; }
.invoice-table td { padding: 12px 14px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.invoice-table .total-row td { font-weight: 700; font-size: 1rem; border-bottom: none; }

.btn-print {
  background: var(--green);
  color: var(--dark);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-print:hover { background: var(--green-dark); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav-toggle { 
    display: flex;
    order: 2;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dark-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    z-index: 150;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    order: 1;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 16px; display: block; }
  
  .dropdown-container { 
    position: static; 
    box-shadow: none; 
    border: none; 
    background: var(--dark-3);
    width: 100%;
    max-height: none;
    padding: 8px;
  }

  .has-dropdown:hover .dropdown-container { display: none; }
  .has-dropdown.open .dropdown-container { display: block; }

  /* Homepage tools — 2 cols on tablet */
  .tools-grid { 
    grid-template-columns: repeat(2, 1fr);
  }
  /* Nav dropdown — single column on mobile */
  .nav-tools-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .invoice-header { flex-direction: column; gap: 16px; }
  .invoice-parties { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .why-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 20px 36px; }
  .calc-box { padding: 20px; }
  .invoice-preview { padding: 20px; }
  .tools-grid { 
    grid-template-columns: 1fr;
  }
}

/* ============ UTILITY ============ */
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* Print Styles */
@media print {
  .site-header, .site-footer, .calc-box, .ad-container, .btn-print { display: none !important; }
  .invoice-preview { box-shadow: none; }
  body { background: white; }
}
