/* ============================================
   UNTOD ERP - Common Styles
   Navbar, Footer, Typography, Utilities
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-family);
  color: var(--untod-text);
  background: var(--untod-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--untod-text);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
}

.text-gradient {
  background: linear-gradient(135deg, var(--untod-primary), var(--untod-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead-text {
  font-size: 1.125rem;
  color: var(--untod-text-muted);
  line-height: 1.7;
}

/* --- Navbar --- */
.navbar-untod {
  padding: 1rem 0;
  transition: all var(--transition-base);
  z-index: 1050;
}

.navbar-untod.transparent {
  background: transparent !important;
}

.navbar-untod.scrolled {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.5rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-untod .navbar-brand img {
  height: 38px;
  transition: height var(--transition-base);
}

.navbar-untod.scrolled .navbar-brand img {
  height: 32px;
}

.navbar-untod .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem !important;
  transition: color var(--transition-fast);
  position: relative;
}

.navbar-untod .nav-link:hover,
.navbar-untod .nav-link.active {
  color: #fff !important;
}

.navbar-untod .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--untod-accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.navbar-untod .nav-link:hover::after,
.navbar-untod .nav-link.active::after {
  transform: scaleX(1);
}

.navbar-untod .dropdown-menu {
  background: var(--untod-dark-lighter);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 220px;
}

.navbar-untod .dropdown-item {
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.navbar-untod .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.navbar-untod .dropdown-item i {
  width: 20px;
  text-align: center;
  margin-right: 0.5rem;
}

/* --- Mobile Menu Fullscreen --- */
@media (max-width: 991.98px) {
  /* Keep brand and toggler above the fullscreen overlay */
  .navbar-untod .navbar-brand,
  .navbar-untod .navbar-toggler {
    position: relative;
    z-index: 2;
  }

  /* Fullscreen overlay panel */
  .navbar-untod .navbar-collapse {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh !important;
    background: var(--untod-dark);
    padding: 5rem 1.5rem 2rem;
    z-index: 1;
    flex-direction: column;
    transition: opacity var(--transition-base) !important;
  }

  /* Hidden state — override Bootstrap display:none */
  .navbar-untod .navbar-collapse.collapse:not(.show) {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
  }

  /* Transition state */
  .navbar-untod .navbar-collapse.collapsing {
    height: 100vh !important;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden !important;
  }

  /* Visible state */
  .navbar-untod .navbar-collapse.collapse.show {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Nav items layout */
  .navbar-untod .navbar-nav {
    align-items: stretch !important;
    width: 100%;
  }

  .navbar-untod .navbar-nav .nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 0.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Remove all ::after on nav-links (underline + Bootstrap caret) */
  .navbar-untod .nav-link::after {
    display: none !important;
  }

  /* Dropdown items: split layout (link + arrow) */
  .navbar-untod .nav-item.dropdown {
    display: flex;
    flex-wrap: wrap;
  }

  .navbar-untod .nav-item.dropdown .nav-link.dropdown-toggle {
    flex: 1;
    min-width: 0;
  }

  /* Arrow toggle button (mobile only) */
  .dropdown-arrow-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
  }

  .dropdown-arrow-mobile:hover {
    color: #fff;
  }

  .dropdown-arrow-mobile i {
    transition: transform var(--transition-base);
    font-size: 0.85rem;
  }

  .nav-item.dropdown.show > .dropdown-arrow-mobile i {
    transform: rotate(180deg);
  }

  /* Static dropdown menus on mobile */
  .navbar-untod .dropdown-menu {
    position: static !important;
    float: none;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    box-shadow: none;
    padding: 0 0 0.5rem 1rem;
    min-width: auto;
    width: 100%;
  }

  /* Full-width CTA button */
  .navbar-untod .navbar-collapse .btn-untod {
    margin-top: 1.5rem;
    justify-content: center;
    width: 100%;
  }

  /* Body scroll lock when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* Admin bar offset for mobile menu */
@media (max-width: 991.98px) {
  body.admin-bar .navbar-untod .navbar-collapse {
    padding-top: calc(5rem + 32px);
  }
}
@media (max-width: 782px) {
  body.admin-bar .navbar-untod .navbar-collapse {
    padding-top: calc(5rem + 46px);
  }
}

/* Hide mobile arrow on desktop */
@media (min-width: 992px) {
  .dropdown-arrow-mobile {
    display: none !important;
  }
}

/* --- Buttons --- */
.btn-untod {
  background: var(--untod-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-untod:hover {
  background: var(--untod-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-untod-accent {
  background: var(--untod-accent);
  color: var(--untod-dark);
}

.btn-untod-accent:hover {
  background: var(--untod-accent-hover);
  color: var(--untod-dark);
}

.btn-untod-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-untod-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

.btn-untod-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

/* --- Cards --- */
.card-untod {
  background: var(--untod-white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-base);
}

.card-untod:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.card-untod .card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card-untod h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-untod p {
  font-size: 0.9rem;
  color: var(--untod-text-muted);
  margin-bottom: 0;
}

/* --- Section Utilities --- */
.section-padding {
  padding: var(--section-py) 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: var(--section-py-sm) 0;
  }
}

.section-dark {
  background: var(--untod-dark);
  color: var(--untod-text-on-dark);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: #fff;
}

.section-light {
  background: var(--untod-light);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section-header .badge-label {
  display: inline-block;
  background: var(--untod-primary-light);
  color: var(--untod-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-dark .section-header .badge-label {
  background: rgba(26, 86, 219, 0.2);
  color: #93b4f5;
}

/* --- Image Placeholder --- */
.img-placeholder {
  background: var(--untod-light-alt);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  min-height: 240px;
  color: var(--untod-text-muted);
  text-align: center;
  transition: all var(--transition-base);
}

.img-placeholder:hover {
  border-color: var(--untod-primary);
  background: var(--untod-primary-light);
}

.img-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.img-placeholder span {
  font-size: 0.85rem;
  font-weight: 500;
}

.section-dark .img-placeholder {
  background: var(--untod-dark-card);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--untod-text-on-dark-muted);
}

.section-dark .img-placeholder:hover {
  border-color: var(--untod-primary);
  background: rgba(26, 86, 219, 0.1);
}

/* --- Hero Module (Detail pages) --- */
.hero-module {
  padding: 7rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-module::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,0,0,0.3));
  z-index: 1;
}

.hero-module .container {
  position: relative;
  z-index: 2;
}

.hero-module .breadcrumb {
  margin-bottom: 1rem;
}

.hero-module .breadcrumb-item,
.hero-module .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-decoration: none;
}

.hero-module .breadcrumb-item.active {
  color: #fff;
}

.hero-module .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.5);
}

.hero-module h1 {
  color: #fff;
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.hero-module .lead {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  max-width: 600px;
}

@media (max-width: 768px) {
  .hero-module {
    padding: 6rem 0 2rem;
  }
  .hero-module h1 {
    font-size: 2rem;
  }
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--untod-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--untod-text-muted);
  font-weight: 500;
}

.section-dark .stat-item .stat-number {
  color: var(--untod-accent);
}

.section-dark .stat-item .stat-label {
  color: var(--untod-text-on-dark-muted);
}

/* --- Feature Grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

/* --- Workflow Steps --- */
.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 2rem 0;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--untod-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.workflow-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--untod-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.workflow-arrow {
  color: var(--untod-text-light);
  font-size: 1.25rem;
}

/* --- Footer --- */
.footer-untod {
  background: var(--untod-dark);
  color: var(--untod-text-on-dark-muted);
  padding: 3.5rem 0 1.5rem;
}

.footer-untod .footer-brand img {
  height: 36px;
  margin-bottom: 1rem;
}

.footer-untod .footer-desc {
  font-size: 0.9rem;
  max-width: 300px;
  line-height: 1.6;
}

.footer-untod h6 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-untod .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-untod .footer-links li {
  margin-bottom: 0.5rem;
}

.footer-untod .footer-links a {
  color: var(--untod-text-on-dark-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-untod .footer-links a:hover {
  color: #fff;
}

.footer-untod .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--untod-text-light);
}

/* --- Module Badge --- */
.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.module-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--untod-primary), var(--untod-secondary));
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.cta-banner h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.cta-banner p {
  opacity: 0.9;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--untod-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 1040;
  box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* --- Misc --- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--untod-primary);
  border-radius: 3px;
  margin: 1rem auto;
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.text-balance {
  text-wrap: balance;
}

/* AOS custom duration */
[data-aos] {
  transition-duration: 600ms !important;
}

/* --- WordPress Admin Bar offset --- */
body.admin-bar .navbar-untod.fixed-top {
  top: 32px;
}
body.admin-bar .hero-module,
body.admin-bar .hero-home,
body.admin-bar .feature-detail-hero {
  padding-top: calc(7rem + 32px);
}
@media (max-width: 782px) {
  body.admin-bar .navbar-untod.fixed-top {
    top: 46px;
  }
  body.admin-bar .hero-module,
  body.admin-bar .hero-home,
  body.admin-bar .feature-detail-hero {
    padding-top: calc(6rem + 46px);
  }
}
