/* ================================================================
   MineCo CMS — Responsive Styles
   Clean breakpoints for mobile, tablet, desktop
   Uses design tokens from admin.css
   ================================================================ */

/* ─── Tablet (769px - 1024px) ───────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-feature-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Mobile (up to 768px) ──────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    display: none;
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-right: none;
  }

  .sidebar.active {
    display: flex;
  }

  .sidebar-header {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-nav {
    padding: var(--space-md) 0;
  }

  .nav-link {
    padding: 14px var(--space-lg);
    font-size: 16px;
  }

  .sidebar-footer {
    padding: var(--space-md) 0 var(--space-lg);
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding: 0 var(--space-md);
    height: auto;
    min-height: var(--topbar-height);
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .top-bar-left {
    gap: var(--space-md);
    width: 100%;
  }

  .top-bar-left h1 {
    font-size: 18px;
  }

  .top-bar-right {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-sm) 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .user-profile {
    gap: var(--space-sm);
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

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

  /* Status Bar */
  .status-bar {
    width: 100%;
    justify-content: flex-start;
    margin-right: 0;
    margin-top: var(--space-sm);
  }

  /* Content Wrapper */
  .content-wrapper {
    padding: var(--space-md);
  }

  .content-section {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .content-section h2 {
    font-size: 16px;
    margin-bottom: var(--space-md);
  }

  /* Dashboard Stats */
  .dashboard-stats {
    grid-template-columns: 1fr;
    margin-bottom: var(--space-md);
    gap: var(--space-md);
  }

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

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

  .stat-info h3 {
    font-size: 24px;
  }

  .stat-info p {
    font-size: 12px;
  }

  /* Quick Actions */
  .quick-actions {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .action-button {
    padding: var(--space-md);
    flex-direction: row;
    justify-content: flex-start;
  }

  .action-button i {
    font-size: 20px;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .form-group {
    margin-bottom: var(--space-md);
  }

  .form-control {
    padding: 10px 12px;
    font-size: 15px;
  }

  .form-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

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

  /* Buttons */
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Tables */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  /* Cards */
  .card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
  }

  .card-title {
    font-size: 16px;
  }

  /* Modals */
  .modal-content {
    padding: var(--space-lg);
    margin: var(--space-md);
    width: calc(100% - var(--space-xl));
    max-height: 85vh;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .modal-body {
    font-size: 14px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* Toast Notifications */
  .toast-container {
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
    max-width: none;
  }

  .toast {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Search and Filter Bars */
  .search-bar,
  .filter-bar {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  /* Editor */
  .editor-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-button {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Text Editor */
  .text-editor-toolbar {
    flex-wrap: wrap;
  }

  .text-editor-button {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* Creator Card */
  .creator-card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

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

  .creator-image-preview {
    width: 80px;
    height: 80px;
  }

  /* Server Card */
  .server-card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

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

  .server-image-preview {
    width: 80px;
    height: 80px;
  }

  /* News Card */
  .news-card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

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

  .news-image-preview {
    height: 150px;
  }

  .news-meta {
    flex-direction: column;
    gap: 4px;
  }

  /* Event Card */
  .event-card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

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

  .event-image-preview {
    height: 150px;
  }

  .event-dates {
    flex-direction: column;
    gap: 4px;
  }

  /* Settings Section */
  .settings-section {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .settings-section-header {
    margin-bottom: var(--space-md);
  }

  .settings-section-title {
    font-size: 16px;
  }

  /* Tabs */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 10px var(--space-md);
    font-size: 13px;
  }

  /* Live Preview */
  .live-preview {
    padding: var(--space-md);
  }

  .preview-hero-title {
    font-size: 20px;
  }

  .preview-hero-subtitle {
    font-size: 13px;
  }

  .preview-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-btn {
    text-align: center;
  }

  .preview-feature-cards {
    grid-template-columns: 1fr;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    font-size: 12px;
    margin-bottom: var(--space-md);
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination-button {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ─── Small Mobile (up to 480px) ────────────────────────── */
@media (max-width: 480px) {
  /* Top Bar */
  .top-bar {
    padding: var(--space-sm) var(--space-md);
  }

  .top-bar-left h1 {
    font-size: 16px;
  }

  /* Dashboard Stats */
  .dashboard-stats {
    gap: var(--space-sm);
  }

  .stat-card {
    padding: 12px;
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
    margin: 0 auto;
  }

  .stat-info h3 {
    font-size: 22px;
  }

  /* Quick Actions */
  .action-button {
    padding: 12px;
    font-size: 13px;
  }

  .action-button i {
    font-size: 18px;
  }

  /* Forms */
  .form-control {
    padding: 10px;
    font-size: 14px;
  }

  /* Buttons */
  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Tables */
  .table th,
  .table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Modals */
  .modal-content {
    padding: var(--space-md);
    margin: var(--space-sm);
    width: calc(100% - var(--space-md));
  }

  .modal-header h3 {
    font-size: 16px;
  }

  /* Toast Notifications */
  .toast-container {
    top: var(--space-sm);
    right: var(--space-sm);
    left: var(--space-sm);
  }

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

  /* Cards */
  .creator-card,
  .server-card,
  .news-card,
  .event-card {
    padding: 12px;
  }

  .creator-image-preview,
  .server-image-preview {
    width: 70px;
    height: 70px;
  }

  .news-image-preview,
  .event-image-preview {
    height: 120px;
  }

  /* Settings Section */
  .settings-section {
    padding: 12px;
  }

  /* Live Preview */
  .live-preview {
    padding: 12px;
  }

  .preview-hero-title {
    font-size: 18px;
  }

  .preview-feature-card {
    padding: 12px;
  }
}

/* ─── Large Desktop (1440px+) ───────────────────────────── */
@media (min-width: 1440px) {
  .dashboard-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-feature-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-wrapper {
    padding: var(--space-xl);
  }

  .content-section {
    padding: var(--space-xl);
  }
}

/* ─── Extra Large Desktop (1920px+) ─────────────────────── */
@media (min-width: 1920px) {
  .content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* ─── Print Styles ──────────────────────────────────────── */
@media print {
  .sidebar,
  .top-bar,
  .mobile-menu-toggle,
  .toast-container {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 0;
  }

  .content-section {
    border: none;
    page-break-inside: avoid;
  }
}