/* ===== COMMON STYLES FOR ALL PAGES ===== */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  padding-top: 80px;
  /* Account for fixed navbar only */
  -webkit-overflow-scrolling: touch;
  position: relative;
  min-height: 100vh;
}

/* Custom Color Variables */
:root {
  --primary-color: #1e40af;
  --secondary-color: #dc2626;
  --accent-color: #fbbf24;
  --dark-color: #1f2937;
  --light-color: #f8fafc;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
}

/* Top Bar Styles */
.top-bar {
  background: linear-gradient(135deg, var(--primary-color), #2563eb) !important;
  font-size: 14px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1040;
  transition: all 0.3s ease;
}

.top-bar.scrolled {
  transform: translateY(-100%);
}

.contact-info span {
  display: inline-block;
}

.social-icons a {
  transition: all 0.3s ease;
  padding: 5px;
}

.social-icons a:hover {
  transform: translateY(-2px);
  color: var(--accent-color) !important;
}

/* Navigation Styles */
.navbar {
  transition: all 0.3s ease;
  padding: 0.4rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1030;
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

.navbar:not(.scrolled) {
  background-color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile Navigation Adjustments */
@media (max-width: 991.98px) {
  body {
    padding-top: 72px;
  }

  .navbar {
    padding: 0.6rem 0;
    top: 0;
    position: fixed !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .navbar.scrolled {
    padding: 0.4rem 0;
  }

  /* Mobile nav dropdown panel */
  .navbar-collapse {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 0 1rem;
    margin-top: 0.5rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  }

  .navbar-nav .nav-link {
    padding: 0.6rem 1.25rem !important;
    margin: 0.15rem 0.5rem;
    border-radius: 10px;
  }

  .navbar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
  }

  /* Make toggler button cleaner */
  .navbar-toggler {
    border: 2px solid rgba(30, 64, 175, .25);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, .15);
  }
}

@media (max-width: 767.98px) {
  body {
    padding-top: 68px;
  }

  .navbar {
    padding: 0.4rem 0;
  }
}

.navbar-brand {
  transition: all 0.3s ease;
}

/* Ensure navbar contents are aligned: logo left, menu right */
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Allow Bootstrap collapse to work — only override flex direction on expanded state */
@media (min-width: 992px) {
  .navbar .navbar-collapse {
    display: flex !important;
    justify-content: flex-end;
  }
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.logo-icon i {
  transition: all 0.3s ease;
}

.navbar-brand:hover .logo-icon i {
  color: var(--secondary-color) !important;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  background-color: var(--light-color);
  color: var(--primary-color) !important;
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white !important;
}

.nav-link.active:hover {
  background-color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  border: none;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
  background: linear-gradient(135deg, var(--secondary-color), #dc2626);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.2);
}

/* Cards */
.card {
  border: none;
  border-radius: 15px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  color: white;
  border-radius: 15px 15px 0 0 !important;
  padding: 1.25rem;
}

/* Section Styles */
.section {
  padding: 5rem 0;
}

.section-title {
  position: relative;
  margin-bottom: 3rem;
  text-align: center;
}

.section-title h2 {
  color: var(--dark-color);
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-title p {
  color: #6b7280;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Hero Sections */
.hero-section {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.9), rgba(37, 99, 235, 0.9));
  color: white;
  padding: 8rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></svg>') repeat;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  animation: slideInUp 1s ease-out;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: slideInUp 1s ease-out 0.3s both;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Statistics Section */
.stats-section {
  background: var(--light-color);
  padding: 4rem 0;
}

.stat-item {
  text-align: center;
  padding: 2rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--dark-color);
  margin-top: 0.5rem;
}

/* Features Section */
.feature-item {
  text-align: center;
  padding: 2rem;
  transition: all 0.3s ease;
  border-radius: 15px;
}

.feature-item:hover {
  transform: translateY(-10px);
  background: white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
  background: linear-gradient(135deg, var(--secondary-color), #dc2626);
  transform: scale(1.1);
}

.feature-icon i {
  font-size: 2rem;
  color: white;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

/* Footer Styles */
.footer {
  background: linear-gradient(135deg, var(--dark-color), #111827) !important;
  position: relative;
  width: 100%;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.footer-section h5,
.footer-section h6 {
  color: var(--primary-color) !important;
  font-weight: 600;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  transition: all 0.3s ease;
  color: #d1d5db !important;
}

.footer-links a:hover {
  color: var(--accent-color) !important;
  padding-left: 5px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  color: #d1d5db;
  font-size: 14px;
}

.contact-item i {
  margin-top: 2px;
  min-width: 20px;
}

.footer-bottom {
  background: #111827 !important;
}

.bg-darker {
  background-color: #0f172a !important;
}

/* Footer mobile centering */
@media (max-width: 767.98px) {
  .footer-section {
    text-align: center;
  }

  .footer-links {
    padding-left: 0;
  }

  .contact-item {
    justify-content: center;
    text-align: center;
  }

  .contact-item i {
    margin-top: 3px;
  }

  .social-icons {
    justify-content: center;
    display: flex;
  }

  .footer-links a:hover {
    padding-left: 0;
  }
}

/* Back to Top Button */
#btn-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1050;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  color: #fff;
  box-shadow: 0 4px 24px rgba(30, 64, 175, 0.15);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

#btn-back-to-top:hover {
  background: linear-gradient(135deg, var(--secondary-color), #dc2626);
  color: #fff;
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.18);
  transform: translateY(-3px) scale(1.08);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Styles */
.form-control {
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
}

.form-label {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .nav-link {
    margin: 0.25rem 0;
  }

  .contact-info span {
    display: block;
    margin-bottom: 5px;
  }

  /* Tables scroll on small screens */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Buttons stack on mobile */
  .d-flex.gap-3.flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .d-flex.gap-3.flex-wrap .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 6rem 0 4rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-title h2 {
    font-size: 1.75rem;
  }

  .feature-icon {
    width: 60px;
    height: 60px;
  }

  .feature-icon i {
    font-size: 1.5rem;
  }

  #btn-back-to-top {
    width: 45px;
    height: 45px;
    bottom: 15px;
    right: 15px;
    font-size: 1rem;
  }

  /* Container padding on very small screens */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Row gutters reduce on very small screens */
  .row.g-4 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }

  /* Additional mobile fixes for navbar */
  .navbar {
    position: fixed !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  body {
    padding-top: 68px;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
  }
}

/* Print Styles */
@media print {

  .top-bar,
  .navbar,
  .footer,
  #btn-back-to-top {
    display: none !important;
  }
}

/* Hide any remaining hero sections until recreated */
.hero-section,
.hero-section::before {
  display: none !important;
}

/* Fixed navbar adjustments */
#mainNav.fixed-top {
  z-index: 1060;
}

/* Ensure hero starts directly below navbar on all pages */
.hero-section {
  margin-top: 0 !important;
}