/* styles.css – Complete mobile responsive fixes for MUSYDA IPM Metro */

/* ======================================================= */
/* 1. Global Sizing & Scale Overrides for Mobile (< 768px) */
/* ======================================================= */

@media (max-width: 768px) {
  html {
    font-size: 13.5px !important; /* Slightly smaller base font for mobile */
  }

  body {
    line-height: 1.4 !important;
    padding: 0 !important;
  }

  /* Scale all headings down on mobile to prevent zoom feel */
  h1, .gradient-text, [style*="fontSize: \"3rem\""], [style*="fontSize: '3rem'"] {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
  }

  h2, .section-title, [style*="fontSize: \"2rem\""], [style*="fontSize: '2rem'"] {
    font-size: 1.35rem !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  h3, [style*="fontSize: \"1.5rem\""], [style*="fontSize: '1.5rem'"] {
    font-size: 1.15rem !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.75rem !important;
  }

  h4, [style*="fontSize: \"1.25rem\""], [style*="fontSize: '1.25rem'"] {
    font-size: 1.05rem !important;
  }

  /* Hero section adjustments */
  .hero-section {
    padding: 1.5rem 0.5rem !important;
  }

  .hero-subtitle, [style*="fontSize: \"1.25rem\""] {
    font-size: 0.9rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.45 !important;
  }

  .hero-badges {
    gap: 0.4rem !important;
    margin-bottom: 1.25rem !important;
  }

  .hero-badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
  }

  .hero-actions {
    margin-bottom: 1.75rem !important;
    gap: 0.5rem !important;
  }

  /* Compact glass card padding to maximize content area on mobile */
  .glass-card {
    padding: 1.15rem !important;
    border-radius: 12px !important;
    margin-bottom: 1.25rem !important;
  }

  /* Compact form inputs & spacing */
  .form-group {
    margin-bottom: 0.85rem !important;
  }

  .form-label {
    font-size: 0.8rem !important;
    margin-bottom: 0.25rem !important;
  }

  .form-control {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.88rem !important;
    border-radius: 6px !important;
    height: auto !important;
  }

  /* Compact buttons */
  .btn {
    padding: 0.6rem 1.1rem !important;
    font-size: 0.88rem !important;
    border-radius: 6px !important;
    gap: 0.4rem !important;
  }

  /* Layout grids - Collapse into single column */
  .grid-2, 
  .grid-3, 
  .features-grid,
  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr !important; /* Stack elements vertically */
    gap: 0.85rem !important;
  }

  /* Steps / Infographics adjustments */
  .steps-timeline {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    margin-bottom: 2rem !important;
  }

  .step-node {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0.5rem !important;
  }

  .step-node::after {
    display: none !important; /* Hide timeline connectors on mobile */
  }

  /* Navbar scaling & compact paddings */
  .navbar {
    position: sticky !important;
    top: 0 !important;
  }

  .nav-container {
    padding: 0.6rem 0.85rem !important;
  }

  .nav-logo {
    font-size: 0.98rem !important;
    gap: 0.4rem !important;
  }

  .nav-logo-icon {
    width: 1.4rem !important;
    height: 1.4rem !important;
  }
  
  .nav-links {
    gap: 0.85rem !important;
  }

  .nav-link {
    font-size: 0.85rem !important;
  }

  /* Main Container Padding */
  main.content, .content {
    padding: 1rem 0.5rem !important;
    margin-top: 10px !important;
  }

  /* File upload area adjustments */
  .upload-container {
    padding: 1rem !important;
  }

  .upload-icon {
    width: 1.8rem !important;
    height: 1.8rem !important;
    margin-bottom: 0.4rem !important;
  }

  .upload-text {
    font-size: 0.82rem !important;
  }

  /* Table responsiveness & horizontal scroll */
  .data-table,
  .table-responsive,
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  th, td {
    padding: 10px 8px !important;
    font-size: 0.82rem !important;
  }

  /* Horizontal scrolling for Admin Tabs on Mobile */
  .tabs-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    margin-bottom: 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
  }

  .tab-btn {
    flex: 0 0 auto !important; /* Prevent tabs from shrinking */
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    border-radius: 4px !important;
  }

  /* Login Form Sizing */
  .login-container,
  .login-card {
    margin: 1rem auto !important;
    padding: 1.25rem 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* ID Card & QR scaling for screen fitting */
  .print-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Shrink inline width of 360px cards to fit 100% mobile viewport */
  div[style*="width: 360px"],
  div[style*="width:360px"] {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  .print-area svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Toast Notification positioning and text scale */
  .toast {
    width: calc(100% - 1.5rem) !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    font-size: 0.82rem !important;
    padding: 0.65rem 0.85rem !important;
  }
  
  /* Hide "Kembali ke" text inside the back button on mobile */
  .nav-back-btn span {
    display: none !important;
  }
  
  .nav-back-btn {
    white-space: nowrap !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
  }

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

  /* Modal responsive fits */
  .modal-card {
    padding: 1rem !important;
    max-height: 95vh !important;
  }
}

/* ======================================================= */
/* 2. Global Hover, Transition & Premium Visual Feel       */
/* ======================================================= */
.glass-card, .btn, .card, .feature-card, .step-node, .tab-btn {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn:hover {
  transform: translateY(-1.5px) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

.btn:active {
  transform: translateY(0) !important;
}

.glass-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

/* ======================================================= */
/* 3. Admin Panel – Navbar, Header & Stats Styling         */
/* ======================================================= */

/* Admin Navbar */
.admin-navbar {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.admin-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  max-width: 100%;
}

.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-nav-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.admin-nav-sub {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.admin-back-btn {
  padding: 0.45rem 1rem !important;
  font-size: 0.85rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.4rem !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Admin Page Header (Dasbor title + action buttons) */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-page-title {
  font-size: 1.75rem !important;
  line-height: 1.2 !important;
  margin: 0 0 0.25rem 0 !important;
}

.admin-page-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  max-width: 480px;
}

.admin-action-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Small button variant */
.btn-sm {
  padding: 0.45rem 0.85rem !important;
  font-size: 0.82rem !important;
  border-radius: 6px !important;
  gap: 0.35rem !important;
}

/* Admin Stats Grid — 3 columns on desktop, 2 on tablet, 1 on mobile */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Admin Navbar compact on mobile */
  .admin-nav-inner {
    padding: 0.6rem 0.85rem !important;
  }

  .admin-nav-title {
    font-size: 0.82rem !important;
  }

  .admin-nav-sub {
    font-size: 0.68rem !important;
  }

  .admin-back-btn {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.78rem !important;
  }

  /* Admin Page Header stacked on mobile */
  .admin-page-header {
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .admin-page-title {
    font-size: 1.3rem !important;
  }

  .admin-page-desc {
    font-size: 0.82rem !important;
  }

  .admin-action-btns {
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .admin-action-btns .btn {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* Stats Grid: 2 columns on mobile for compactness */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.25rem !important;
  }

  /* Compact stat cards */
  .stat-card {
    padding: 0.85rem !important;
  }

  .stat-value {
    font-size: 1.5rem !important;
  }

  .stat-desc {
    font-size: 0.72rem !important;
  }
}

