/* ============================================
   Paibon Scale — Shared Stylesheet
   Used by all pages
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --dark: #0f172a;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --light: #f8fafc;
  --white: #fff;
  --border: #e2e8f0;
  --radius: 8px;
  --success: #16a34a;
  --danger: #dc2626;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header .container {
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 52px; width: auto; display: block; }

.nav { display: flex; gap: 32px; list-style: none; }
.nav a {
  color: var(--gray); font-size: 15px; font-weight: 500; transition: color 0.2s;
  position: relative;
}
.nav a:hover, .nav a.active { color: var(--primary); }
.nav a.active::after {
  content: ''; position: absolute; bottom: -6px; left: 0; right: 0;
  height: 2px; background: var(--primary); border-radius: 2px;
}

/* Mobile hamburger */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 3px; background: var(--dark); border-radius: 2px;
  transition: all 0.3s; display: block;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
  border: none; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: var(--white); color: var(--primary); }
.btn-light:hover { background: #f1f5f9; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* ============================================
   Hero Sections
   ============================================ */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a4a7a 100%);
  color: #fff; padding: 100px 0 80px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -10%; top: 10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; max-width: 700px; }
.hero p { font-size: 18px; color: var(--gray-light); max-width: 520px; margin-bottom: 36px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 48px; margin-top: 60px; }
.hero-stats .stat-num { font-size: 36px; font-weight: 800; color: var(--primary); display: block; }
.hero-stats .stat-label { font-size: 14px; color: var(--gray-light); }

.page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff; padding: 60px 0 40px;
}
.page-hero h1 { font-size: 40px; font-weight: 800; margin-bottom: 12px; }
.page-hero p { color: var(--gray-light); font-size: 16px; max-width: 560px; }

/* ============================================
   Sections
   ============================================ */
.section { padding: 80px 0; }
.section-light { background: var(--light); }
.section-dark { background: var(--dark); color: #fff; }

.section-label {
  display: inline-block; padding: 4px 12px; background: var(--primary-light);
  color: var(--primary); font-size: 12px; font-weight: 700; border-radius: 20px;
  text-transform: uppercase; margin-bottom: 12px;
}
.section-title { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.section-subtitle { color: var(--gray); font-size: 16px; max-width: 560px; margin-bottom: 48px; }

/* ============================================
   Cards & Grids
   ============================================ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.cat-card {
  background: var(--white); border-radius: 12px; padding: 32px 24px;
  text-align: center; transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border); cursor: pointer; display: block; color: inherit;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }
.cat-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--primary-light); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.cat-img {
  width: 100%; height: 160px; margin: 0 auto 16px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--light);
}
.cat-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}
.cat-card:hover .cat-img img {
  transform: scale(1.05);
}
.cat-card h3 { font-size: 18px; margin-bottom: 8px; }
.cat-card p { color: var(--gray); font-size: 14px; }

.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.adv-card { padding: 28px; border-radius: 12px; background: var(--light); border: 1px solid var(--border); }
.adv-card .adv-num { font-size: 48px; font-weight: 800; color: var(--primary-light); line-height: 1; margin-bottom: 8px; }
.adv-card h3 { font-size: 18px; margin-bottom: 8px; }
.adv-card p { color: var(--gray); font-size: 14px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-grid img, .about-grid .img-placeholder { width: 100%; border-radius: 12px; }
.img-placeholder {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); font-size: 14px; text-align: center;
  border: 2px dashed var(--border);
}
.about-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.about-tags span {
  padding: 6px 14px; background: var(--primary-light); color: var(--primary);
  font-size: 13px; font-weight: 600; border-radius: 6px;
}

/* Stats */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 40px 0; }
.stat-box { text-align: center; padding: 24px; background: var(--light); border-radius: 12px; }
.stat-box .num { font-size: 36px; font-weight: 800; color: var(--primary); }
.stat-box .label { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary);
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.timeline-item p { color: var(--gray); font-size: 14px; }

/* Certifications */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.cert-item {
  text-align: center; padding: 24px; background: rgba(255,255,255,0.05);
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
}
.cert-item .cert-name { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.cert-item .cert-desc { font-size: 13px; color: var(--gray-light); }

/* CTA */
.cta { background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%); color: #fff; text-align: center; }
.cta .section-subtitle { color: #c7d2fe; margin-left: auto; margin-right: auto; }
.cta h2 { color: #fff; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================
   Contact Form
   ============================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-info h2 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.contact-item { display: flex; gap: 16px; margin-bottom: 24px; }
.contact-icon {
  width: 48px; height: 48px; background: var(--primary-light); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.contact-item h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.contact-item p { color: var(--gray); font-size: 14px; }
.contact-item a { color: var(--primary); font-weight: 600; }

.form-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 32px; }
.form-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input.error, .form-group textarea.error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-success {
  display: none; padding: 16px; background: #dcfce7; color: #166534;
  border-radius: var(--radius); margin-bottom: 20px; font-size: 14px;
}
.form-success.show { display: block; animation: fadeIn 0.3s ease; }

.map-container {
  border-radius: 12px; overflow: hidden;
  height: 350px; border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.map-container iframe { display: block; width: 100%; height: 100%; }

/* ============================================
   Blog
   ============================================ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.blog-card {
  background: var(--white); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.08); }
.blog-card .blog-img {
  height: 200px; background: linear-gradient(135deg, var(--primary), #1e3a5f);
  display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.blog-card .blog-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card .blog-meta { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.blog-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.blog-card p { color: var(--gray); font-size: 14px; flex: 1; }
.blog-card .blog-read-more { color: var(--primary); font-weight: 600; font-size: 14px; margin-top: 16px; }

.blog-article { max-width: 800px; margin: 0 auto; }
.blog-article h2 { font-size: 28px; font-weight: 800; margin: 24px 0 12px; }
.blog-article h3 { font-size: 20px; font-weight: 700; margin: 20px 0 10px; }
.blog-article p { color: var(--gray); margin-bottom: 16px; line-height: 1.8; }
.blog-article ul { margin-bottom: 16px; padding-left: 20px; color: var(--gray); }
.blog-article ul li { margin-bottom: 8px; }

/* ============================================
   FAQ
   ============================================ */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 20px 24px; font-size: 16px; font-weight: 600; color: var(--dark);
  display: flex; justify-content: space-between; align-items: center; font-family: inherit;
}
.faq-question:hover { color: var(--primary); }
.faq-question .faq-icon {
  width: 28px; height: 28px; background: var(--primary-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  transition: transform 0.3s; flex-shrink: 0; color: var(--primary);
}
.faq-item.open .faq-question .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 24px 20px; }
.faq-answer p { color: var(--gray); font-size: 14px; line-height: 1.8; }

/* ============================================
   Footer
   ============================================ */
.footer { background: #0f172a; color: var(--gray-light); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer h3 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer a { color: var(--gray-light); text-decoration: none; font-size: 14px; display: block; margin: 6px 0; transition: color 0.2s; }
.footer a:hover { color: var(--primary); }
.footer-logo { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--primary); }
.footer-contact p { font-size: 14px; margin: 4px 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px;
  padding-top: 20px; text-align: center; font-size: 13px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; flex-direction: column; gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    padding: 8px 0;
  }
  .nav.open { display: flex; animation: fadeIn 0.2s ease; }
  .nav li { width: 100%; }
  .nav a { display: block; padding: 12px 24px; font-size: 16px; }
  .nav a.active::after { display: none; }
  .nav-toggle { display: flex; }
  .header .btn { display: none; }

  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stats .stat-num { font-size: 28px; }

  .page-hero h1 { font-size: 30px; }

  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 28px; }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { text-align: center; }
  .logo img { height: 44px; }
}

/* ============================================
   Language Switcher — Dropdown
   ============================================ */
.lang-switcher {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--primary-light);
  border: 1px solid var(--primary-light);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.lang-trigger:hover {
  background: var(--primary);
  color: #fff;
}
.lang-trigger .lang-arrow {
  font-size: 10px;
  transition: transform 0.2s;
}
.lang-switcher.open .lang-arrow {
  transform: rotate(180deg);
}
.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 140px;
  z-index: 1000;
}
.lang-switcher.open .lang-dropdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-dropdown a,
.lang-dropdown .lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.lang-dropdown a {
  color: var(--gray);
}
.lang-dropdown a:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.lang-dropdown .lang-current {
  color: var(--primary);
  background: var(--primary-light);
  cursor: default;
}
@media (max-width: 768px) {
  .lang-switcher {
    order: -1;
    margin-bottom: 8px;
  }
  .lang-dropdown {
    right: auto;
    left: 0;
  }
}

/* ============================================
   RTL Support (Arabic)
   ============================================ */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .header .container {
  flex-direction: row-reverse;
}
[dir="rtl"] .nav {
  flex-direction: row-reverse;
}
[dir="rtl"] .footer-grid {
  text-align: right;
}
