/* ============================================================================
   COMPREHENSIVE RESPONSIVE DESIGN - ALL DEVICES
   Mobile-first approach with breakpoints for all screen sizes
   ============================================================================ */

/* Base responsive typography */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

@media (max-width: 1400px) { html { font-size: 15px; } }
@media (max-width: 1200px) { html { font-size: 14px; } }
@media (max-width: 992px) { html { font-size: 13px; } }
@media (max-width: 768px) { html { font-size: 12px; } }
@media (max-width: 576px) { html { font-size: 11px; } }

/* ============================================================================
   CONTAINER & LAYOUT RESPONSIVE
   ============================================================================ */
.container, .container-fluid {
  padding-left: 15px !important;
  padding-right: 15px !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 576px) {
  .container, .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* Row spacing */
.row {
  margin-left: -10px !important;
  margin-right: -10px !important;
}

[class*="col-"] {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

@media (max-width: 576px) {
  .row {
    margin-left: -5px !important;
    margin-right: -5px !important;
  }
  [class*="col-"] {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
}

/* ============================================================================
   HEADER & NAVIGATION RESPONSIVE
   ============================================================================ */
.header-blue {
  padding: 0 !important;
  overflow-x: hidden !important;
}

.header-container {
  width: 100% !important;
  padding: 0 !important;
}

.navbar {
  padding: 0.5rem 1rem !important;
}

@media (max-width: 992px) {
  .navbar {
    padding: 0.5rem !important;
  }
  
  .navbar-brand {
    font-size: 1.2rem !important;
  }
  
  .navbar-collapse {
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  .navbar-nav {
    padding: 10px 0 !important;
  }
  
  .nav-item {
    padding: 5px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  }
  
  .nav-link {
    padding: 10px 15px !important;
    display: block !important;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem !important;
    padding: 0 !important;
  }
  
  .navbar-toggler {
    padding: 0.25rem 0.5rem !important;
    font-size: 1rem !important;
  }
  
  .header-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 5px !important;
  }
  
  .header-actions .btn {
    width: 100% !important;
    margin: 2px 0 !important;
  }
  
  .lang-dropdown-wrapper {
    width: 100% !important;
  }
  
  .lang-dropdown-btn {
    width: 100% !important;
  }
}

/* ============================================================================
   CARDS & CONTENT BLOCKS RESPONSIVE
   ============================================================================ */
.card {
  margin-bottom: 15px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.card-body {
  padding: 1.25rem !important;
}

@media (max-width: 992px) {
  .card-body {
    padding: 1rem !important;
  }
}

@media (max-width: 768px) {
  .card-body {
    padding: 0.75rem !important;
  }
  
  .card-title {
    font-size: 1.1rem !important;
  }
  
  .card-text {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 0.5rem !important;
  }
  
  .card-title {
    font-size: 1rem !important;
  }
}

/* ============================================================================
   BUTTONS RESPONSIVE
   ============================================================================ */
.btn {
  padding: 0.5rem 1rem !important;
  font-size: 1rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 768px) {
  .btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.9rem !important;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem !important;
    font-size: 1rem !important;
  }
  
  .btn-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8rem !important;
  }
}

@media (max-width: 576px) {
  .btn {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
  }
  
  .btn-block {
    display: block !important;
    width: 100% !important;
  }
}

/* ============================================================================
   FORMS RESPONSIVE
   ============================================================================ */
.form-control {
  font-size: 1rem !important;
  padding: 0.5rem 0.75rem !important;
}

.form-group {
  margin-bottom: 1rem !important;
}

@media (max-width: 768px) {
  .form-control {
    font-size: 0.9rem !important;
    padding: 0.4rem 0.6rem !important;
  }
  
  .form-group {
    margin-bottom: 0.75rem !important;
  }
  
  label {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .form-control {
    font-size: 0.85rem !important;
    padding: 0.35rem 0.5rem !important;
  }
  
  .form-group {
    margin-bottom: 0.5rem !important;
  }
  
  select.form-control {
    padding-right: 1.5rem !important;
  }
}

/* ============================================================================
   TABLES RESPONSIVE
   ============================================================================ */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

table {
  width: 100% !important;
  min-width: 500px !important;
}

@media (max-width: 992px) {
  table {
    font-size: 0.9rem !important;
  }
  
  th, td {
    padding: 0.5rem !important;
  }
}

@media (max-width: 768px) {
  table {
    font-size: 0.85rem !important;
    min-width: 600px !important;
  }
  
  th, td {
    padding: 0.4rem !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 576px) {
  table {
    font-size: 0.8rem !important;
  }
  
  th, td {
    padding: 0.3rem !important;
  }
}

/* ============================================================================
   MODALS RESPONSIVE
   ============================================================================ */
.modal-dialog {
  max-width: 90% !important;
  margin: 1.75rem auto !important;
}

.modal-content {
  border-radius: 8px !important;
}

.modal-body {
  padding: 1.5rem !important;
}

.modal-header {
  padding: 1rem 1.5rem !important;
}

.modal-footer {
  padding: 1rem 1.5rem !important;
}

@media (max-width: 992px) {
  .modal-dialog {
    max-width: 95% !important;
  }
  
  .modal-body {
    padding: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    max-width: 98% !important;
    margin: 0.5rem auto !important;
  }
  
  .modal-body {
    padding: 1rem !important;
  }
  
  .modal-header {
    padding: 0.75rem 1rem !important;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .modal-footer .btn {
    width: 100% !important;
  }
}

@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.25rem !important;
    max-width: calc(100% - 0.5rem) !important;
  }
  
  .modal-body {
    padding: 0.75rem !important;
  }
  
  .modal-header {
    padding: 0.5rem 0.75rem !important;
  }
  
  .modal-footer {
    padding: 0.5rem 0.75rem !important;
  }
  
  .modal-title {
    font-size: 1.1rem !important;
  }
}

/* ============================================================================
   MAPS RESPONSIVE
   ============================================================================ */
#map, .map-container, [id*="map"], [class*="map"] {
  width: 100% !important;
  height: 400px !important;
  min-height: 300px !important;
  max-height: 500px !important;
}

@media (max-width: 992px) {
  #map, .map-container, [id*="map"], [class*="map"] {
    height: 350px !important;
  }
}

@media (max-width: 768px) {
  #map, .map-container, [id*="map"], [class*="map"] {
    height: 300px !important;
    min-height: 250px !important;
  }
}

@media (max-width: 576px) {
  #map, .map-container, [id*="map"], [class*="map"] {
    height: 250px !important;
    min-height: 200px !important;
  }
}

/* ============================================================================
   DASHBOARD RESPONSIVE
   ============================================================================ */
.dashboard-sidebar {
  width: 250px !important;
  transition: all 0.3s ease !important;
}

.dashboard-content {
  flex: 1 !important;
  padding: 1.5rem !important;
}

@media (max-width: 1200px) {
  .dashboard-sidebar {
    width: 220px !important;
  }
  
  .dashboard-content {
    padding: 1.25rem !important;
  }
}

@media (max-width: 992px) {
  .dashboard-sidebar {
    position: fixed !important;
    left: -250px !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1040 !important;
    background: white !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
  }
  
  .dashboard-sidebar.show {
    left: 0 !important;
  }
  
  .dashboard-content {
    padding: 1rem !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  .dashboard-content {
    padding: 0.75rem !important;
  }
}

@media (max-width: 576px) {
  .dashboard-content {
    padding: 0.5rem !important;
  }
  
  .dashboard-sidebar {
    width: 85% !important;
    left: -85% !important;
  }
}

/* ============================================================================
   STATS & METRICS CARDS RESPONSIVE
   ============================================================================ */
.stat-card, .metric-card, [class*="stats"], [class*="metric"] {
  padding: 1.5rem !important;
  margin-bottom: 1rem !important;
}

@media (max-width: 992px) {
  .stat-card, .metric-card, [class*="stats"], [class*="metric"] {
    padding: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .stat-card, .metric-card, [class*="stats"], [class*="metric"] {
    padding: 1rem !important;
  }
  
  .stat-value, .metric-value {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 576px) {
  .stat-card, .metric-card, [class*="stats"], [class*="metric"] {
    padding: 0.75rem !important;
  }
  
  .stat-value, .metric-value {
    font-size: 1.25rem !important;
  }
  
  .stat-label, .metric-label {
    font-size: 0.85rem !important;
  }
}

/* ============================================================================
   IMAGES & MEDIA RESPONSIVE
   ============================================================================ */
img {
  max-width: 100% !important;
  height: auto !important;
}

.img-fluid {
  width: 100% !important;
  height: auto !important;
}

.post-media, .product-image, .store-image, .vehicle-image {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
}

@media (max-width: 768px) {
  .post-media, .product-image {
    max-height: 200px !important;
  }
}

@media (max-width: 576px) {
  .post-media, .product-image {
    max-height: 150px !important;
  }
}

/* ============================================================================
   GRIDS & FLEXBOX RESPONSIVE
   ============================================================================ */
.d-flex {
  display: flex !important;
}

@media (max-width: 768px) {
  .flex-md-column {
    flex-direction: column !important;
  }
  
  .flex-md-wrap {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 576px) {
  .flex-sm-column {
    flex-direction: column !important;
  }
  
  .d-flex {
    flex-wrap: wrap !important;
  }
}

/* ============================================================================
   TEXT & TYPOGRAPHY RESPONSIVE
   ============================================================================ */
h1 {
  font-size: 2.5rem !important;
  line-height: 1.2 !important;
}

h2 {
  font-size: 2rem !important;
  line-height: 1.3 !important;
}

h3 {
  font-size: 1.75rem !important;
  line-height: 1.3 !important;
}

h4 {
  font-size: 1.5rem !important;
  line-height: 1.4 !important;
}

h5 {
  font-size: 1.25rem !important;
  line-height: 1.4 !important;
}

h6 {
  font-size: 1rem !important;
  line-height: 1.5 !important;
}

@media (max-width: 992px) {
  h1 { font-size: 2.25rem !important; }
  h2 { font-size: 1.85rem !important; }
  h3 { font-size: 1.6rem !important; }
  h4 { font-size: 1.4rem !important; }
  h5 { font-size: 1.15rem !important; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.7rem !important; }
  h3 { font-size: 1.45rem !important; }
  h4 { font-size: 1.25rem !important; }
  h5 { font-size: 1.1rem !important; }
}

@media (max-width: 576px) {
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.5rem !important; }
  h3 { font-size: 1.3rem !important; }
  h4 { font-size: 1.15rem !important; }
  h5 { font-size: 1rem !important; }
  h6 { font-size: 0.95rem !important; }
}

p {
  font-size: 1rem !important;
  line-height: 1.6 !important;
}

@media (max-width: 768px) {
  p { font-size: 0.95rem !important; }
}

@media (max-width: 576px) {
  p { font-size: 0.9rem !important; }
}

/* ============================================================================
   SPACING UTILITIES RESPONSIVE
   ============================================================================ */
@media (max-width: 992px) {
  .p-5 { padding: 2rem !important; }
  .px-5 { padding-left: 2rem !important; padding-right: 2rem !important; }
  .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  .m-5 { margin: 2rem !important; }
  .mx-5 { margin-left: 2rem !important; margin-right: 2rem !important; }
  .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
}

@media (max-width: 768px) {
  .p-5 { padding: 1.5rem !important; }
  .p-4 { padding: 1.25rem !important; }
  .px-5 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  .m-5 { margin: 1.5rem !important; }
  .m-4 { margin: 1.25rem !important; }
}

@media (max-width: 576px) {
  .p-5 { padding: 1rem !important; }
  .p-4 { padding: 0.75rem !important; }
  .p-3 { padding: 0.5rem !important; }
  .px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .py-5 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .m-5 { margin: 1rem !important; }
  .m-4 { margin: 0.75rem !important; }
  .m-3 { margin: 0.5rem !important; }
}

/* ============================================================================
   DROPDOWNS RESPONSIVE
   ============================================================================ */
.dropdown-menu {
  max-height: 300px !important;
  overflow-y: auto !important;
}

@media (max-width: 768px) {
  .dropdown-menu {
    max-height: 250px !important;
    font-size: 0.9rem !important;
  }
  
  .dropdown-item {
    padding: 0.5rem 1rem !important;
  }
}

@media (max-width: 576px) {
  .dropdown-menu {
    max-height: 200px !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
  
  .dropdown-item {
    padding: 0.4rem 0.75rem !important;
  }
}

/* ============================================================================
   ALERTS & NOTIFICATIONS RESPONSIVE
   ============================================================================ */
.alert {
  padding: 1rem 1.25rem !important;
  font-size: 1rem !important;
}

@media (max-width: 768px) {
  .alert {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .alert {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================================================
   PAGINATION RESPONSIVE
   ============================================================================ */
.pagination {
  flex-wrap: wrap !important;
}

.page-link {
  padding: 0.5rem 0.75rem !important;
}

@media (max-width: 576px) {
  .page-link {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================================================
   BREADCRUMB RESPONSIVE
   ============================================================================ */
.breadcrumb {
  flex-wrap: wrap !important;
  padding: 0.75rem 1rem !important;
}

@media (max-width: 576px) {
  .breadcrumb {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
  
  .breadcrumb-item + .breadcrumb-item::before {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
}

/* ============================================================================
   CHARTS & GRAPHS RESPONSIVE
   ============================================================================ */
canvas {
  max-width: 100% !important;
  height: auto !important;
}

.chart-container {
  position: relative !important;
  height: 400px !important;
  width: 100% !important;
}

@media (max-width: 992px) {
  .chart-container {
    height: 350px !important;
  }
}

@media (max-width: 768px) {
  .chart-container {
    height: 300px !important;
  }
}

@media (max-width: 576px) {
  .chart-container {
    height: 250px !important;
  }
}

/* ============================================================================
   LISTS RESPONSIVE
   ============================================================================ */
.list-group-item {
  padding: 0.75rem 1.25rem !important;
}

@media (max-width: 768px) {
  .list-group-item {
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .list-group-item {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================================================
   BADGES & PILLS RESPONSIVE
   ============================================================================ */
.badge {
  padding: 0.35em 0.65em !important;
  font-size: 0.85em !important;
}

@media (max-width: 576px) {
  .badge {
    padding: 0.25em 0.5em !important;
    font-size: 0.75em !important;
  }
}

/* ============================================================================
   PROGRESS BARS RESPONSIVE
   ============================================================================ */
.progress {
  height: 1.5rem !important;
}

@media (max-width: 768px) {
  .progress {
    height: 1.25rem !important;
  }
}

@media (max-width: 576px) {
  .progress {
    height: 1rem !important;
  }
}

/* ============================================================================
   OVERFLOW & SCROLL BEHAVIOR
   ============================================================================ */
body {
  overflow-x: hidden !important;
}

.overflow-auto {
  -webkit-overflow-scrolling: touch !important;
}

/* ============================================================================
   UTILITIES - HIDE/SHOW ON MOBILE
   ============================================================================ */
@media (max-width: 992px) {
  .hide-lg-down { display: none !important; }
}

@media (max-width: 768px) {
  .hide-md-down { display: none !important; }
}

@media (max-width: 576px) {
  .hide-sm-down { display: none !important; }
}

@media (min-width: 577px) {
  .show-sm-only { display: none !important; }
}

@media (min-width: 769px) {
  .show-md-only { display: none !important; }
}

@media (min-width: 993px) {
  .show-lg-only { display: none !important; }
}

/* ============================================================================
   TOUCH TARGETS (44px minimum for accessibility)
   ============================================================================ */
@media (max-width: 768px) {
  a, button, .btn, input[type="checkbox"], input[type="radio"] {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  .nav-link, .dropdown-item {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* ============================================================================
   LANDSCAPE ORIENTATION FIXES
   ============================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-dialog {
    margin: 0.25rem auto !important;
  }
  
  .modal-body {
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
  }
  
  .navbar-collapse {
    max-height: 50vh !important;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
  .no-print, .navbar, .header-blue, .footer, .sidebar, .btn {
    display: none !important;
  }
  
  .container, .container-fluid {
    max-width: 100% !important;
  }
  
  body {
    font-size: 12pt !important;
  }
}

/* ============================================================================
   HOVER EFFECTS - DISABLED ON TOUCH DEVICES
   ============================================================================ */
@media (hover: none) {
  .card:hover, .btn:hover, .nav-link:hover {
    transform: none !important;
  }
}
