/*
============================================
MOBILE-FIRST RESPONSIVE FRAMEWORK
Myanmar Digital Solutions - 2024
============================================

Mobile-First Approach:
- Base styles for mobile (320px and up)
- Progressive enhancement for tablets (768px and up)
- Desktop optimizations (1024px and up)
- Large desktop enhancements (1200px and up)

Breakpoints:
- xs: 0-575px (Mobile phones)
- sm: 576-767px (Large phones)
- md: 768-991px (Tablets)
- lg: 992-1199px (Small desktops)
- xl: 1200-1399px (Desktops)
- xxl: 1400px+ (Large desktops)
*/

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */
:root {
  /* Breakpoints */
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
  
  /* Container max widths */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-xxl: 1320px;
  
  /* Spacing scale (mobile-first) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  
  /* Typography scale (mobile-first) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */
  
  /* Touch targets (mobile-friendly) */
  --touch-target-min: 44px;  /* Minimum touch target size */
  
  /* Z-index scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   MOBILE-FIRST BASE STYLES
   ============================================ */

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Fluid containers */
.container,
.container-fluid {
  width: 100%;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  margin-left: auto;
  margin-right: auto;
}

/* Container with max-widths */
.container {
  max-width: var(--container-sm);
}

/* Responsive typography */
h1 { font-size: var(--font-size-3xl); line-height: 1.2; margin-bottom: var(--space-lg); }
h2 { font-size: var(--font-size-2xl); line-height: 1.3; margin-bottom: var(--space-md); }
h3 { font-size: var(--font-size-xl); line-height: 1.4; margin-bottom: var(--space-md); }
h4 { font-size: var(--font-size-lg); line-height: 1.4; margin-bottom: var(--space-sm); }
h5 { font-size: var(--font-size-base); line-height: 1.5; margin-bottom: var(--space-sm); }
h6 { font-size: var(--font-size-sm); line-height: 1.5; margin-bottom: var(--space-sm); }

p { 
  font-size: var(--font-size-base); 
  line-height: 1.6; 
  margin-bottom: var(--space-md);
}

/* Mobile-friendly buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  min-height: var(--touch-target-min);
  font-size: var(--font-size-base);
  text-decoration: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  min-height: 52px;
  font-size: var(--font-size-lg);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  min-height: 36px;
  font-size: var(--font-size-sm);
}

/* Mobile-friendly forms */
.form-control,
.form-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  min-height: var(--touch-target-min);
  font-size: var(--font-size-base);
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Mobile navigation base */
.nav-mobile {
  display: flex;
  position: relative;
}

/* Mobile-first grid system */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--space-sm) * -1);
  margin-right: calc(var(--space-sm) * -1);
}

.col {
  flex: 1 0 0%;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
}

/* Mobile grid columns (1 column by default) */
.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-5 { flex: 0 0 41.666667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333333%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333333%; }
.col-11 { flex: 0 0 91.666667%; }
.col-12 { flex: 0 0 100%; }

/* ============================================
   HAMBURGER MENU COMPONENT
   ============================================ */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: var(--z-fixed);
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background: #333;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile navigation drawer */
.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transition: left 0.3s ease;
  z-index: var(--z-modal);
  overflow-y: auto;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   TABLET BREAKPOINT (768px and up)
   ============================================ */
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
  
  /* Tablet typography */
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  
  /* Tablet grid */
  .col-md {
    flex: 1 0 0%;
  }
  
  .col-md-1 { flex: 0 0 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; }
  .col-md-3 { flex: 0 0 25%; }
  .col-md-4 { flex: 0 0 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; }
  .col-md-6 { flex: 0 0 50%; }
  .col-md-7 { flex: 0 0 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; }
  .col-md-9 { flex: 0 0 75%; }
  .col-md-10 { flex: 0 0 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; }
  .col-md-12 { flex: 0 0 100%; }
  
  /* Hide hamburger on tablet */
  .hamburger-menu {
    display: none;
  }
  
  .mobile-nav {
    display: none;
  }
  
  .mobile-nav-overlay {
    display: none;
  }
}

/* ============================================
   DESKTOP BREAKPOINT (1024px and up)
   ============================================ */
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
  
  /* Desktop typography */
  h1 { font-size: var(--font-size-5xl); }
  h2 { font-size: var(--font-size-4xl); }
  h3 { font-size: var(--font-size-3xl); }
  
  /* Desktop grid */
  .col-lg {
    flex: 1 0 0%;
  }
  
  .col-lg-1 { flex: 0 0 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; }
}

/* ============================================
   LARGE DESKTOP BREAKPOINT (1200px and up)
   ============================================ */
@media (min-width: 1200px) {
  .container {
    max-width: var(--container-xl);
  }
  
  /* Large desktop grid */
  .col-xl {
    flex: 1 0 0%;
  }
  
  .col-xl-1 { flex: 0 0 8.333333%; }
  .col-xl-2 { flex: 0 0 16.666667%; }
  .col-xl-3 { flex: 0 0 25%; }
  .col-xl-4 { flex: 0 0 33.333333%; }
  .col-xl-5 { flex: 0 0 41.666667%; }
  .col-xl-6 { flex: 0 0 50%; }
  .col-xl-7 { flex: 0 0 58.333333%; }
  .col-xl-8 { flex: 0 0 66.666667%; }
  .col-xl-9 { flex: 0 0 75%; }
  .col-xl-10 { flex: 0 0 83.333333%; }
  .col-xl-11 { flex: 0 0 91.666667%; }
  .col-xl-12 { flex: 0 0 100%; }
}

/* ============================================
   EXTRA LARGE DESKTOP BREAKPOINT (1400px and up)
   ============================================ */
@media (min-width: 1400px) {
  .container {
    max-width: var(--container-xxl);
  }
  
  /* Extra large desktop grid */
  .col-xxl {
    flex: 1 0 0%;
  }
  
  .col-xxl-1 { flex: 0 0 8.333333%; }
  .col-xxl-2 { flex: 0 0 16.666667%; }
  .col-xxl-3 { flex: 0 0 25%; }
  .col-xxl-4 { flex: 0 0 33.333333%; }
  .col-xxl-5 { flex: 0 0 41.666667%; }
  .col-xxl-6 { flex: 0 0 50%; }
  .col-xxl-7 { flex: 0 0 58.333333%; }
  .col-xxl-8 { flex: 0 0 66.666667%; }
  .col-xxl-9 { flex: 0 0 75%; }
  .col-xxl-10 { flex: 0 0 83.333333%; }
  .col-xxl-11 { flex: 0 0 91.666667%; }
  .col-xxl-12 { flex: 0 0 100%; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacing utilities */
.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }
.gap-5 { gap: var(--space-xl); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-xs); }
.m-2 { margin: var(--space-sm); }
.m-3 { margin: var(--space-md); }
.m-4 { margin: var(--space-lg); }
.m-5 { margin: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.p-5 { padding: var(--space-xl); }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.d-sm-none { display: none; }
.d-sm-block { display: block; }
.d-sm-flex { display: flex; }

@media (min-width: 768px) {
  .d-md-none { display: none; }
  .d-md-block { display: block; }
  .d-md-flex { display: flex; }
}

@media (min-width: 1024px) {
  .d-lg-none { display: none; }
  .d-lg-block { display: block; }
  .d-lg-flex { display: flex; }
}

/* Flex utilities */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

/* Visibility utilities */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

@media (max-width: 767px) {
  .hidden-xs { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .hidden-sm { display: none !important; }
}

@media (min-width: 1024px) {
  .hidden-md { display: none !important; }
}
