/* Responsive Design - Breakpoints */

/* Tablet and below (768px) - Show hamburger, hide/collapse sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    z-index: 999;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Overlay for sidebar on mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .sidebar.mobile-open ~ .sidebar-overlay {
    display: block;
  }

  .page-content {
    padding: 20px;
  }

  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .section-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar input {
    width: 100%;
  }

  .filter-row {
    gap: 6px;
  }

  .filter-row select {
    min-width: 100px;
  }

  table {
    font-size: 12px;
  }

  th {
    font-size: 10px;
    padding: 8px 10px;
  }

  td {
    padding: 10px;
    font-size: 12px;
  }

  .btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }

  input[type=text],
  input[type=email],
  input[type=password],
  input[type=number],
  input[type=search],
  textarea,
  select {
    min-height: 40px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Mobile (480px and below) - More aggressive reductions */
@media (max-width: 480px) {
  .topbar {
    padding: 0 16px;
    height: 50px;
  }

  .topbar-title {
    font-size: 14px;
  }

  .page-content {
    padding: 16px;
  }

  .card {
    padding: 16px;
    border-radius: 8px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }

  .page-header h1 {
    font-size: 16px;
  }

  .page-header p {
    font-size: 12px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .btn-sm {
    width: auto;
    min-height: 36px;
  }

  input[type=text],
  input[type=email],
  input[type=password],
  input[type=number],
  input[type=search],
  textarea,
  select {
    min-height: 44px;
    font-size: 16px;
    padding: 10px;
  }

  label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .search-bar {
    gap: 6px;
  }

  .filter-row {
    gap: 6px;
  }

  .filter-row select {
    min-width: 80px;
    padding: 6px 8px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tab-row {
    overflow-x: auto;
  }

  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-card {
    padding: 20px;
  }

  .asset-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .asset-content h2 {
    font-size: 16px;
  }

  .asset-content p {
    font-size: 13px;
  }

  .table-wrap {
    font-size: 12px;
  }

  table {
    font-size: 11px;
  }

  th {
    font-size: 9px;
    padding: 6px 8px;
  }

  td {
    padding: 8px;
    font-size: 11px;
  }

  .badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  .alert {
    font-size: 12px;
    padding: 10px 12px;
  }

  .section-title {
    font-size: 13px;
  }

  .nav-link {
    font-size: 13px;
    padding: 8px 8px;
  }

  .brand-name {
    font-size: 14px;
  }

  .user-name {
    font-size: 12px;
  }

  .user-role {
    font-size: 10px;
  }

  .empty-state {
    padding: 32px 16px;
  }

  .empty-state .empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
  }

  .empty-state p {
    font-size: 12px;
    margin-bottom: 12px;
  }
}

/* Small phones (360px and below) */
@media (max-width: 360px) {
  .page-content {
    padding: 12px;
  }

  .topbar {
    padding: 0 12px;
  }

  .card {
    padding: 12px;
  }

  .btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  input[type=text],
  input[type=email],
  input[type=password],
  input[type=number],
  input[type=search],
  textarea,
  select {
    font-size: 14px;
  }

  .page-header h1 {
    font-size: 15px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* Landscape mode on mobile - Ensure header stays visible */
@media (max-height: 500px) and (orientation: landscape) {
  .page-content {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .form-group {
    margin-bottom: 12px;
  }
}
