/* ===========================================
   ADVERTISING MATERIALS - COMPACT MOBILE UI
   Version: 1.0.0
   Goals: Mobile-first, reduced vertical space
   =========================================== */

/* ============================================
   MOBILE COMPACT STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {

  /* ==========================================
     1. COMPACT HEADER
     ========================================== */
  .header {
    padding: 12px 16px;
  }

  .header-content {
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }

  .logo h1 {
    font-size: 16px;
    display: none; /* Hide "Admission System" */
  }

  /* Show page title in header */
  .logo::before {
    content: 'Advertising Materials';
    font-size: 17px;
    font-weight: 600;
    color: #172B4D;
  }

  .header-actions {
    gap: 8px;
    margin-left: auto;
  }

  /* Compact back button - icon only */
  .back-btn {
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
  }

  .back-btn::after {
    content: none; /* Remove text */
  }

  /* Hide logout button - move to overflow menu */
  .logout-btn {
    display: none;
  }

  /* Overflow menu button */
  .overflow-menu-btn {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #F4F5F7;
    border: 1px solid #DFE1E6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #42526E;
  }

  /* ==========================================
     2. SIMPLIFIED PAGE HEADER
     ========================================== */
  .page-header {
    background: transparent;
    box-shadow: none;
    padding: 12px 0;
    margin-bottom: 12px;
    text-align: left;
  }

  .page-title {
    display: none; /* Hidden - shown in header */
  }

  .page-subtitle {
    font-size: 13px;
    color: #6B778C;
    margin: 0;
  }

  /* Shorter subtitle */
  .page-subtitle::before {
    content: 'Programs & promotional content';
  }

  .page-subtitle {
    font-size: 0;
  }

  .page-subtitle::before {
    font-size: 13px;
    color: #6B778C;
  }

  /* ==========================================
     3. COMPACT STATS BAR - Horizontal Chips
     ========================================== */
  .stats-bar {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 16px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stats-bar::-webkit-scrollbar {
    display: none;
  }

  .stat-item {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    background: white;
    border: 1px solid #DFE1E6;
    gap: 6px;
  }

  .stat-icon {
    width: 14px;
    height: 14px;
  }

  /* ==========================================
     4. IMPROVED EMPTY STATE
     ========================================== */
  .empty-state {
    padding: 48px 24px;
    margin: 16px 0;
    border-radius: 16px;
  }

  .empty-state-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
    margin-bottom: 16px;
  }

  .empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  /* Better copy */
  .empty-state h3::before {
    content: 'No materials yet';
  }

  .empty-state h3 {
    font-size: 0;
  }

  .empty-state h3::before {
    font-size: 18px;
    font-weight: 600;
    color: #172B4D;
  }

  .empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
  }

  /* Add CTA button */
  .empty-state-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0052CC 0%, #0043A3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
  }

  .empty-state-cta svg {
    width: 18px;
    height: 18px;
  }

  /* ==========================================
     5. MEDIA GRID - COMPACT
     ========================================== */
  .main-content {
    padding: 12px;
    min-height: auto;
  }

  .media-grid {
    gap: 12px;
  }

  .media-card {
    border-radius: 12px;
  }

  .media-card:hover {
    transform: none; /* Disable hover lift on mobile */
  }

  .media-card:active {
    transform: scale(0.98);
  }

  .media-preview {
    height: 160px;
  }

  .media-info {
    padding: 14px;
  }

  .media-title {
    font-size: 15px;
    margin-bottom: 6px;
  }

  .media-description {
    font-size: 13px;
    margin-bottom: 10px;
    -webkit-line-clamp: 1;
  }

  .media-meta {
    margin-bottom: 12px;
  }

  .media-type {
    font-size: 11px;
    padding: 3px 8px;
  }

  .media-date {
    font-size: 11px;
  }

  .media-actions {
    flex-direction: row;
    gap: 8px;
  }

  .action-btn {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 8px;
    min-height: 44px;
  }

  /* ==========================================
     6. UPLOAD FAB BUTTON
     ========================================== */
  .upload-fab {
    position: fixed;
    bottom: 24px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0052CC 0%, #0043A3 100%);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 82, 204, 0.35);
    z-index: 50;
  }

  .upload-fab svg {
    width: 20px;
    height: 20px;
  }

  .upload-fab:active {
    transform: scale(0.96);
  }

  /* ==========================================
     7. OVERFLOW MENU
     ========================================== */
  .overflow-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
  }

  .overflow-menu.open {
    opacity: 1;
    visibility: visible;
  }

  .overflow-menu-content {
    position: absolute;
    top: 60px;
    right: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
  }

  .overflow-menu.open .overflow-menu-content {
    transform: translateY(0);
    opacity: 1;
  }

  .overflow-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: #172B4D;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s;
  }

  .overflow-menu-item:hover,
  .overflow-menu-item:active {
    background: #F4F5F7;
  }

  .overflow-menu-item svg {
    width: 20px;
    height: 20px;
    color: #6B778C;
  }

  .overflow-menu-item.danger {
    color: #DE350B;
  }

  .overflow-menu-item.danger svg {
    color: #DE350B;
  }

  /* ==========================================
     8. LOADING STATES
     ========================================== */
  .loading-container {
    padding: 40px;
  }

  .loading-spinner {
    width: 32px;
    height: 32px;
  }

  /* ==========================================
     9. MODAL - MOBILE OPTIMIZED
     ========================================== */
  .media-modal-content {
    max-width: 95vw;
    max-height: 85vh;
  }

  .media-modal-close {
    top: -50px;
    right: 10px;
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
  }
}

/* ============================================
   EXTRA SMALL MOBILE (< 480px)
   ============================================ */
@media (max-width: 480px) {
  .header {
    padding: 10px 12px;
  }

  .logo::before {
    font-size: 15px;
  }

  .back-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .main-content {
    padding: 10px;
  }

  .stats-bar {
    gap: 6px;
  }

  .stat-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .stat-icon {
    width: 12px;
    height: 12px;
  }

  .media-preview {
    height: 140px;
  }

  .media-info {
    padding: 12px;
  }

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

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

  .empty-state {
    padding: 40px 20px;
  }

  .empty-state-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .empty-state h3::before {
    font-size: 16px;
  }

  .upload-fab {
    bottom: 20px;
    right: 12px;
    padding: 12px 18px;
    font-size: 14px;
  }
}

/* ============================================
   TINY MOBILE (< 360px)
   ============================================ */
@media (max-width: 360px) {
  .header {
    padding: 8px 10px;
  }

  .logo::before {
    font-size: 14px;
  }

  .main-content {
    padding: 8px;
  }

  .stat-item {
    padding: 5px 8px;
    font-size: 11px;
  }

  .media-grid {
    gap: 10px;
  }

  .media-preview {
    height: 120px;
  }

  .media-info {
    padding: 10px;
  }

  .upload-fab {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ============================================
   DESKTOP OVERRIDES - Hide mobile elements
   ============================================ */
@media (min-width: 769px) {
  .overflow-menu-btn,
  .overflow-menu,
  .upload-fab,
  .empty-state-cta {
    display: none !important;
  }
}
