/* ========================================
   ADVANCECRED GLOBAL RESPONSIVE STYLES
   Complete responsiveness for all devices
   ======================================== */

/* ===== ROOT VARIABLES ===== */
:root {
  --primary-blue: #1e3a8a;
  --secondary-blue: #3b82f6;
  --accent-blue: #1e40af;
  --light-blue: #dbeafe;
  --success-green: #10b981;
  --warning-yellow: #f59e0b;
  --danger-red: #ef4444;
  --white: #ffffff;
  --dark-text: #1f2937;
  --gray-text: #6b7280;
  --light-bg: #f8fafc;
}

/* ===== GLOBAL BOX SIZING ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ===== BASE RESPONSIVE IMAGES ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

img.img-fluid {
  width: 100%;
  height: auto;
}

/* Prevent layout shift for images */
img[width][height] {
  height: auto;
}

/* ===== RESPONSIVE BUTTONS ===== */
.btn {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-height: 44px; /* Minimum touch target size */
  line-height: 1.5;
}

.btn-sm {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  min-height: 38px;
}

.btn-lg {
  font-size: 1.125rem;
  padding: 1rem 2rem;
  min-height: 52px;
}

/* Button hover effects */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

/* ===== RESPONSIVE SECTIONS ===== */
section {
  padding: 3rem 0;
  overflow-x: hidden;
}

.container, .container-fluid {
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
h1, .h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2, .h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}

h3, .h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.4;
  margin-bottom: 0.875rem;
}

h4, .h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

p, .lead {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ===== RESPONSIVE FORMS ===== */
.form-control,
.form-select {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  min-height: 48px; /* Touch-friendly */
}

.form-control:focus,
.form-select:focus {
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
}

/* Large form controls */
.form-control-lg {
  font-size: 1.125rem;
  padding: 1rem 1.25rem;
  min-height: 56px;
}

/* Small form controls */
.form-control-sm {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  min-height: 40px;
}

/* Form labels */
.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--dark-text);
}

/* ===== RESPONSIVE CARDS ===== */
.card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.card-img-top {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16/9;
}

.card-body {
  padding: 1.5rem;
}

/* ===== RESPONSIVE TABLES ===== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  margin-bottom: 1rem;
}

table th,
table td {
  padding: 0.75rem;
  vertical-align: middle;
  font-size: 0.95rem;
}

/* ===== RESPONSIVE GRID ===== */
.row {
  margin-left: -15px;
  margin-right: -15px;
}

.row > * {
  padding-left: 15px;
  padding-right: 15px;
}

/* ===== RESPONSIVE ACCORDIONS (FAQs) ===== */
.accordion-button {
  font-size: 1rem;
  font-weight: 600;
  padding: 1.25rem 1.5rem;
  background: white;
  border: none;
  transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
  background: var(--light-blue);
  color: var(--primary-blue);
  box-shadow: none;
}

.accordion-button:hover {
  background: var(--light-bg);
}

.accordion-body {
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark-text);
}

.accordion-item {
  border: none;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== RESPONSIVE MODALS ===== */
.modal-dialog {
  margin: 1rem;
  max-width: 600px;
}

.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* ===== RESPONSIVE HERO SECTIONS ===== */
.hero-section {
  padding: 4rem 1rem;
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* ===== RESPONSIVE CTA SECTIONS ===== */
.cta-section {
  padding: 4rem 1rem;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 1.5rem;
}

.cta-section .lead {
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== RESPONSIVE BADGES ===== */
.badge {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-weight: 600;
}

/* ===== TOUCH-FRIENDLY ELEMENTS ===== */
a, button, input[type="submit"], input[type="button"] {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
  touch-action: manipulation;
}

/* Ensure minimum touch target size */
a:not(.btn),
button:not(.btn),
.clickable-element {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== RESPONSIVE UTILITIES ===== */
.text-responsive {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.padding-responsive {
  padding: clamp(1rem, 3vw, 3rem);
}

.margin-responsive {
  margin: clamp(1rem, 3vw, 3rem);
}

/* ===== DEVICE-SPECIFIC STYLES ===== */

/* Extra Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  section {
    padding: 5rem 0;
  }
  
  .btn-lg {
    font-size: 1.25rem;
    padding: 1.25rem 2.5rem;
  }
}

/* Large Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
  
  section {
    padding: 4rem 0;
  }
}

/* Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
  
  section {
    padding: 3.5rem 0;
  }
  
  .btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.4rem;
  }
}

/* Tablet Landscape (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .container {
    max-width: 720px;
  }
  
  section {
    padding: 3rem 0;
  }
  
  .btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.3rem;
  }
  
  .btn-lg {
    font-size: 1.05rem;
    padding: 0.9rem 1.8rem;
  }
  
  .hero-section {
    padding: 3rem 1rem;
    min-height: 400px;
  }
  
  /* Stack columns on tablet */
  .row .col-md-6 {
    margin-bottom: 1.5rem;
  }
}

/* Tablet Portrait (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .container {
    max-width: 540px;
  }
  
  section {
    padding: 2.5rem 0;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.65rem 1.2rem;
    width: 100%; /* Full-width buttons on small tablets */
    margin-bottom: 0.5rem;
  }
  
  .btn-group .btn {
    width: auto; /* Except in button groups */
  }
  
  .hero-section {
    padding: 2.5rem 1rem;
    min-height: 350px;
  }
  
  /* Full-width form inputs */
  .form-control,
  .form-select {
    font-size: 1rem;
  }
  
  /* Larger touch targets */
  .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
  }
}

/* Mobile (< 576px) */
@media (max-width: 575px) {
  .container,
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  section {
    padding: 2rem 0;
  }
  
  /* Full-width buttons on mobile */
  .btn {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    width: 100%;
    margin-bottom: 0.75rem;
  }
  
  .btn-group .btn,
  .btn-inline {
    width: auto; /* Inline buttons */
    display: inline-block;
    margin-right: 0.5rem;
  }
  
  .btn-lg {
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
  }
  
  .btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
  }
  
  /* Hero sections on mobile */
  .hero-section {
    padding: 2rem 1rem;
    min-height: 300px;
  }
  
  .hero-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  /* Forms on mobile */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.875rem 1rem;
    min-height: 52px; /* Larger for easier tapping */
  }
  
  .form-label {
    font-size: 0.9rem;
  }
  
  /* Cards on mobile */
  .card {
    margin-bottom: 1.5rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  /* Tables on mobile */
  .table-responsive {
    font-size: 0.875rem;
  }
  
  table th,
  table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Modals on mobile */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  /* Accordions on mobile */
  .accordion-button {
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
  }
  
  .accordion-body {
    padding: 1.25rem;
    font-size: 0.95rem;
  }
  
  /* Grid spacing on mobile */
  .row {
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .row > * {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* CTA sections on mobile */
  .cta-section {
    padding: 2.5rem 1rem;
  }
  
  /* Hide desktop-only elements */
  .d-desktop {
    display: none !important;
  }
  
  .d-mobile {
    display: block !important;
  }
}

/* Extra Small Mobile (< 375px) */
@media (max-width: 374px) {
  .container,
  .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }
  
  section {
    padding: 1.5rem 0;
  }
  
  .btn {
    font-size: 0.875rem;
    padding: 0.7rem 0.9rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
  }
}

/* ===== RESPONSIVE IMAGE GALLERIES ===== */
.image-gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 767px) {
  .image-gallery {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* ===== RESPONSIVE FLEXBOX UTILITIES ===== */
.flex-responsive {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 767px) {
  .flex-responsive {
    flex-direction: column;
  }
  
  .flex-responsive > * {
    width: 100%;
  }
}

/* ===== RESPONSIVE SPACING UTILITIES ===== */
.py-responsive {
  padding-top: clamp(2rem, 5vw, 5rem);
  padding-bottom: clamp(2rem, 5vw, 5rem);
}

.my-responsive {
  margin-top: clamp(1rem, 3vw, 3rem);
  margin-bottom: clamp(1rem, 3vw, 3rem);
}

/* ===== RESPONSIVE VIDEO EMBEDS ===== */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== RESPONSIVE PARTNER LOGOS ===== */
.partner-logo {
  max-width: 120px;
  height: auto;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.partner-logo:hover {
  opacity: 1;
  transform: scale(1.1);
}

@media (max-width: 767px) {
  .partner-logo {
    max-width: 80px;
  }
}

/* ===== RESPONSIVE TESTIMONIAL CARDS ===== */
.testimonial-card {
  padding: 2rem;
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

@media (max-width: 767px) {
  .testimonial-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

/* ===== RESPONSIVE STICKY ELEMENTS ===== */
.sticky-mobile {
  position: sticky;
  bottom: 0;
  z-index: 999;
}

@media (min-width: 768px) {
  .sticky-mobile {
    position: static;
  }
}

/* ===== CLICK-TO-CALL BUTTONS (MOBILE) ===== */
.click-to-call,
.click-to-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 998;
  transition: all 0.3s ease;
  text-decoration: none;
}

.click-to-call {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.click-to-whatsapp {
  background: #25D366;
  bottom: 90px;
}

.click-to-call:hover,
.click-to-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Hide on desktop */
@media (min-width: 768px) {
  .click-to-call,
  .click-to-whatsapp {
    display: none;
  }
}

/* ===== RESPONSIVE STATISTICS SECTIONS ===== */
.stat-card {
  padding: 1.5rem;
  text-align: center;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--primary-blue);
}

.stat-label {
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  color: var(--gray-text);
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .modal,
  .click-to-call,
  .click-to-whatsapp,
  footer {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: #000;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--secondary-blue);
  outline-offset: 2px;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}

/* ===== LANDSCAPE ORIENTATION (MOBILE) ===== */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-section {
    min-height: 250px;
    padding: 1.5rem 1rem;
  }
  
  .modal-dialog {
    margin: 0.5rem auto;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ===== RETINA DISPLAY OPTIMIZATIONS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Use higher quality images on retina displays */
  .brand-logo {
    image-rendering: -webkit-optimize-contrast;
  }
}

