/**
 * SupportPONTO Responsive CSS
 * Media queries and responsive breakpoints
 */

/* ===================================
 * Mobile First Approach
 * =================================== */

/* ===================================
 * Small Devices (Smartphones) - < 576px
 * =================================== */
@media (max-width: 575px) {
  /* Typography */
  h1, .h1 { font-size: var(--sp-font-size-xl); }
  h2, .h2 { font-size: var(--sp-font-size-lg); }
  h3, .h3 { font-size: var(--sp-font-size-md); }

  /* Buttons */
  .btn-group-responsive .btn {
    width: 100%;
    margin-bottom: var(--sp-space-sm);
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-space-sm);
  }

  .card-body {
    padding: var(--sp-space-md);
  }

  /* Stat Cards */
  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .stat-card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  /* Forms */
  .form-row {
    flex-direction: column;
  }

  .form-row .form-group {
    width: 100%;
  }

  /* Modals */
  .modal {
    padding: var(--sp-space-sm);
  }

  .modal-dialog {
    max-width: 100%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--sp-space-md);
  }

  /* Tables */
  .table-responsive {
    font-size: var(--sp-font-size-sm);
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    margin-bottom: var(--sp-space-md);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-md);
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-space-sm) var(--sp-space-md);
    border-bottom: 1px solid var(--sp-border);
  }

  .table tbody td:last-child {
    border-bottom: none;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: var(--sp-font-semibold);
    margin-right: var(--sp-space-sm);
  }
}

/* ===================================
 * Medium Devices (Tablets) - 576px to 767px
 * =================================== */
@media (min-width: 576px) and (max-width: 767px) {
  /* Content wrapper */
  .content-wrapper,
  .app-content {
    padding: var(--sp-space-md);
  }

  /* Grid columns */
  .col-sm-6 {
    width: 50%;
  }

  .col-sm-12 {
    width: 100%;
  }

  /* Stat cards in 2 columns */
  .stat-card-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-space-md);
  }
}

/* ===================================
 * Large Tablets - 768px to 991px
 * =================================== */
@media (min-width: 768px) and (max-width: 991px) {
  /* Sidebar collapsed */
  .sidebar,
  .app-sidebar {
    width: 80px;
  }

  .sidebar .sp-brand-text,
  .sidebar .nav-link span,
  .sidebar .app-nav-title {
    display: none;
  }

  .main-content,
  .app-main {
    margin-left: 80px;
    width: calc(100% - 80px);
  }

  /* Tooltips for collapsed sidebar */
  .sidebar .nav-link {
    justify-content: center;
    position: relative;
  }

  .sidebar .nav-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    margin-left: var(--sp-space-sm);
    padding: var(--sp-space-xs) var(--sp-space-sm);
    background: var(--sp-gray-900);
    color: white;
    border-radius: var(--sp-radius-sm);
    font-size: var(--sp-font-size-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--sp-transition);
  }

  .sidebar .nav-link:hover::after {
    opacity: 1;
  }

  /* Grid columns */
  .col-md-4 {
    width: 33.333%;
  }

  .col-md-6 {
    width: 50%;
  }

  .col-md-12 {
    width: 100%;
  }

  /* Header adjustments */
  .app-header,
  .app-topbar {
    padding: 0 var(--sp-space-md);
  }

  .page-title {
    font-size: var(--sp-font-size-lg);
  }

  /* Hide some header elements */
  .header-actions .d-md-none {
    display: none !important;
  }
}

/* ===================================
 * Desktop Small - 992px to 1199px
 * =================================== */
@media (min-width: 992px) and (max-width: 1199px) {
  /* Full sidebar */
  .sidebar,
  .app-sidebar {
    width: 260px;
  }

  .main-content,
  .app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
  }

  /* Grid columns */
  .col-lg-3 {
    width: 25%;
  }

  .col-lg-4 {
    width: 33.333%;
  }

  .col-lg-6 {
    width: 50%;
  }

  .col-lg-8 {
    width: 66.666%;
  }

  .col-lg-12 {
    width: 100%;
  }

  /* Stat cards in 4 columns */
  .stat-card-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-space-md);
  }
}

/* ===================================
 * Desktop Medium - 1200px to 1399px
 * =================================== */
@media (min-width: 1200px) and (max-width: 1399px) {
  /* Container */
  .sp-container {
    max-width: 1140px;
  }

  /* Grid columns */
  .col-xl-2 {
    width: 16.666%;
  }

  .col-xl-3 {
    width: 25%;
  }

  .col-xl-4 {
    width: 33.333%;
  }

  .col-xl-6 {
    width: 50%;
  }

  .col-xl-8 {
    width: 66.666%;
  }

  .col-xl-12 {
    width: 100%;
  }
}

/* ===================================
 * Desktop Large - >= 1400px
 * =================================== */
@media (min-width: 1400px) {
  /* Container */
  .sp-container {
    max-width: 1320px;
  }

  /* Grid columns */
  .col-xxl-2 {
    width: 16.666%;
  }

  .col-xxl-3 {
    width: 25%;
  }

  .col-xxl-4 {
    width: 33.333%;
  }

  .col-xxl-6 {
    width: 50%;
  }

  .col-xxl-8 {
    width: 66.666%;
  }

  .col-xxl-12 {
    width: 100%;
  }

  /* Enhanced spacing for large screens */
  .content-wrapper,
  .app-content {
    padding: var(--sp-space-2xl);
  }
}

/* ===================================
 * Display Utilities
 * =================================== */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

@media (min-width: 576px) {
  .d-sm-none {
    display: none !important;
  }

  .d-sm-block {
    display: block !important;
  }

  .d-sm-flex {
    display: flex !important;
  }

  .d-sm-inline {
    display: inline !important;
  }
}

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

  .d-md-block {
    display: block !important;
  }

  .d-md-flex {
    display: flex !important;
  }

  .d-md-inline {
    display: inline !important;
  }
}

@media (min-width: 992px) {
  .d-lg-none {
    display: none !important;
  }

  .d-lg-block {
    display: block !important;
  }

  .d-lg-flex {
    display: flex !important;
  }

  .d-lg-inline {
    display: inline !important;
  }
}

@media (min-width: 1200px) {
  .d-xl-none {
    display: none !important;
  }

  .d-xl-block {
    display: block !important;
  }

  .d-xl-flex {
    display: flex !important;
  }

  .d-xl-inline {
    display: inline !important;
  }
}

/* ===================================
 * Flex Utilities
 * =================================== */
.flex-column {
  flex-direction: column !important;
}

.flex-row {
  flex-direction: row !important;
}

.justify-content-start {
  justify-content: flex-start !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.align-items-end {
  align-items: flex-end !important;
}

.align-items-center {
  align-items: center !important;
}

.gap-1 {
  gap: var(--sp-space-xs) !important;
}

.gap-2 {
  gap: var(--sp-space-sm) !important;
}

.gap-3 {
  gap: var(--sp-space-md) !important;
}

.gap-4 {
  gap: var(--sp-space-lg) !important;
}

.gap-5 {
  gap: var(--sp-space-xl) !important;
}

/* ===================================
 * Width Utilities
 * =================================== */
.w-25 {
  width: 25% !important;
}

.w-50 {
  width: 50% !important;
}

.w-75 {
  width: 75% !important;
}

.w-100 {
  width: 100% !important;
}

.w-auto {
  width: auto !important;
}

/* ===================================
 * Print Styles
 * =================================== */
@media print {
  .sidebar,
  .app-sidebar,
  .app-header,
  .app-topbar,
  .sidebar-toggle,
  .no-print {
    display: none !important;
  }

  .main-content,
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .card,
  .sp-card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .btn {
    display: none !important;
  }

  body {
    background: white !important;
  }
}
