/* Custom styles beyond Tailwind */
.text-balance { text-wrap: balance; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeIn { animation: fadeIn 0.6s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 9998; justify-content: center; align-items: center; flex-direction: column; }
.lightbox.show { display: flex; }
.lightbox-img { max-width: 90%; max-height: 85%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-caption { color: #fff; text-align: center; margin-top: 16px; font-size: 16px; max-width: 80%; opacity: 0.8; }
.lightbox-counter { color: rgba(255,255,255,0.5); font-size: 14px; margin-top: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: white; font-size: 36px; cursor: pointer; background: none; border: none; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s; z-index: 10; }
.lightbox-close:hover { background: rgba(255,255,255,0.15); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 32px; cursor: pointer; background: rgba(255,255,255,0.1); border: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s; z-index: 10; backdrop-filter: blur(4px); }
.lightbox-nav:hover { background: rgba(255,255,255,0.25); transform: translateY(-50%) scale(1.1); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-nav:disabled { opacity: 0.2; cursor: default; transform: translateY(-50%) scale(1); }

/* Hero pattern */
.hero-pattern { background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px); background-size: 30px 30px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #a7f3d0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #34d399; }

/* Hero Slider */
.hero-slider { position: relative; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease, transform 0.8s ease; transform: scale(1.05); }
.hero-slide.active { opacity: 1; position: relative; transform: scale(1); z-index: 1; }
.hero-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: all 0.3s; border: none; }
.hero-dot.active { background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.5); width: 32px; border-radius: 6px; }
.hero-slide-content { animation: heroFadeUp 0.8s ease both; }
.hero-slide.active .hero-slide-content:nth-child(1) { animation-delay: 0.1s; }
.hero-slide.active .hero-slide-content:nth-child(2) { animation-delay: 0.3s; }
.hero-slide.active .hero-slide-content:nth-child(3) { animation-delay: 0.5s; }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.hero-pause-btn { position: absolute; bottom: 24px; right: 24px; z-index: 10; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.15); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; backdrop-filter: blur(4px); transition: background 0.2s; }
.hero-pause-btn:hover { background: rgba(255,255,255,0.25); }

/* Print styles */
@media print { .no-print { display: none !important; } }

/* ============= MOBILE-FIRST ADMIN PANEL ============= */

/* Mobile Toast */
@media (max-width: 640px) {
  .admin-toast {
    top: 12px !important;
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    max-width: none !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
  }
}

/* ====== CONFIRM MODAL ====== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

/* Mobile Modal */
@media (max-width: 640px) {
  .modal-box {
    padding: 24px 16px !important;
    max-width: 92% !important;
    margin: 0 10px;
  }
  .modal-box h3 { font-size: 16px !important; }
  .modal-box .text-5xl { font-size: 2.5rem !important; }
}

/* ====== MOBILE SIDEBAR OVERLAY ====== */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 48;
}
.admin-sidebar-overlay.show { display: block; }

/* Mobile sidebar open state - override Tailwind v4 translate */
#sidebar.open {
  --tw-translate-x: 0% !important;
}

/* ====== ADMIN TOPBAR ====== */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #065f46;
  color: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.admin-topbar-brand {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-topbar-brand i { font-size: 18px; }
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-topbar-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.admin-topbar-btn:active { background: rgba(255,255,255,0.2); }

/* Mobile only overrides */
@media (max-width: 1023px) {
  .admin-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 10px 12px;
  }
  .admin-topbar-brand {
    font-size: 15px;
    gap: 6px;
  }
  .admin-topbar-brand i { font-size: 18px; }
  
  /* Push main content down */
  body > .flex.min-h-screen > main,
  body > div.flex.min-h-screen > main {
    padding-top: 64px !important;
  }
}

/* ====== MOBILE SIDEBAR (Drawer) ====== */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: auto !important;
    right: 0 !important;
    width: 280px !important;
    height: 100% !important;
    z-index: 49 !important;
    --tw-translate-x: 100% !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -8px 0 30px rgba(0,0,0,0.2) !important;
  }
  #sidebar.open {
    --tw-translate-x: 0% !important;
  }
  #sidebar .sidebar-close {
    display: flex !important;
  }
  #sidebar .sidebar-brand {
    font-size: 14px;
  }
  #sidebar nav a {
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
  #sidebar nav a i {
    width: 20px !important;
    font-size: 14px !important;
  }
}

/* ====== MOBILE TABLE → CARD VIEW ====== */
@media (max-width: 767px) {
  .admin-table-wrapper {
    overflow: hidden !important;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
  }
  .admin-table-wrapper table { display: none; }
  
  .admin-card-list { display: block; }
  
  .admin-data-card {
    display: block;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    padding: 14px 16px;
  }
  .admin-data-card:last-child { border-bottom: none; }
  .admin-data-card:active { background: #f9fafb; }
  
  .admin-data-card .card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    gap: 8px;
  }
  .admin-data-card .card-label {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
  }
  .admin-data-card .card-value {
    color: #374151;
    font-size: 13px;
    text-align: right;
    word-break: break-word;
  }
  .admin-data-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #f3f4f6;
  }
  .admin-data-card .card-header img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
  }
  .admin-data-card .card-header .card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    flex: 1;
  }
  .admin-data-card .card-header .card-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
  }
  .admin-data-card .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
  }
  .admin-data-card .card-actions a,
  .admin-data-card .card-actions button {
    flex: 1;
    text-align: center;
    padding: 8px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  
  /* Search on mobile */
  .table-search {
    font-size: 14px !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    width: 100% !important;
  }
  
  /* Pagination mobile */
  .admin-pagination {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  .admin-pagination .page-info {
    font-size: 12px !important;
  }
  .admin-pagination .page-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .admin-pagination .page-buttons button {
    flex: 1;
    padding: 10px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
  }
}

/* ====== MOBILE FORMS ====== */
@media (max-width: 640px) {
  .admin-form-card {
    padding: 16px !important;
  }
  .admin-form-card input,
  .admin-form-card select,
  .admin-form-card textarea {
    font-size: 15px !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    min-height: 44px !important;
  }
  .admin-form-card label {
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }
  .admin-form-card .grid {
    gap: 12px !important;
  }
  .admin-form-card button[type="submit"] {
    width: 100% !important;
    padding: 12px !important;
    font-size: 14px !important;
    min-height: 44px !important;
  }
  .admin-form-card .form-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .admin-form-card .form-actions a,
  .admin-form-card .form-actions button {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    min-height: 44px !important;
  }
  
  /* File inputs */
  input[type="file"] {
    font-size: 13px !important;
  }
  input[type="file"]::file-selector-button {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  /* Dashboard cards */
  .dashboard-stat-card {
    padding: 14px !important;
  }
  .dashboard-stat-card .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
  .dashboard-stat-card .stat-count {
    font-size: 22px !important;
  }
  .dashboard-stat-card .stat-label {
    font-size: 11px !important;
  }
}

/* ====== MOBILE QUICK ACTIONS ====== */
@media (max-width: 640px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .quick-actions-grid a {
    padding: 12px 8px !important;
  }
  .quick-actions-grid a i {
    font-size: 20px !important;
  }
  .quick-actions-grid a span {
    font-size: 11px !important;
  }
}

/* ====== MOBILE RECENT ACTIVITY ====== */
@media (max-width: 640px) {
  .recent-item {
    padding: 10px 12px !important;
  }
  .recent-item .recent-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
  .recent-item .recent-name {
    font-size: 13px !important;
  }
  .recent-item .recent-detail {
    font-size: 11px !important;
  }
}

/* ====== IMAGE PREVIEW MOBILE ====== */
@media (max-width: 640px) {
  .img-preview {
    width: 80px !important;
    height: 80px !important;
  }
}

/* ====== QUILL EDITOR MOBILE ====== */
@media (max-width: 640px) {
  .ql-toolbar.ql-snow { overflow-x: auto; white-space: nowrap; }
  .ql-toolbar.ql-snow .ql-formats { margin-right: 4px !important; }
  .ql-editor { min-height: 180px !important; font-size: 15px !important; }
}

/* ====== ALL BUTTONS - MIN TOUCH TARGET ====== */
@media (max-width: 640px) {
  .admin-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ====== GALLERY MOBILE ====== */
@media (max-width: 640px) {
  #galleryGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .drop-zone { padding: 16px 12px !important; }
  .drop-zone .text-5xl { font-size: 2.5rem !important; }
  .drop-zone p { font-size: 13px !important; }
  .preview-img { width: 80px !important; height: 80px !important; }
}

/* ====== RESPONSIVE CONTAINER ====== */
@media (max-width: 640px) {
  .admin-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .admin-page-header .header-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  .admin-page-header .header-actions a,
  .admin-page-header .header-actions button {
    flex: 1 !important;
    text-align: center !important;
    font-size: 12px !important;
    padding: 10px 8px !important;
    min-height: 40px !important;
  }
}

/* ====== MISSING TAILWIND HALF-UNIT SPACING CLASSES ====== */
.gap-1\.5 { gap: 0.375rem; }
.gap-y-1\.5 { row-gap: 0.375rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.ml-0\.5 { margin-left: 0.125rem; }
.ml-1\.5 { margin-left: 0.375rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
