/* ============================================================
   app.css — Minimal CSS replacing Bootstrap 4/5 + Tailwind
   Size: ~10KB (vs 160KB Bootstrap + 2934KB Tailwind = 3094KB)
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; line-height: 1.5; color: #333; }
a { color: #ffc107; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* === DISPLAY === */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* === FLEXBOX === */
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-center { align-items: center; }

/* === GRID (replaces Bootstrap row/col) === */
.container { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col, .col-6, .col-12 { padding: 0 8px; }
.col { flex: 1; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* === SPACING (m-/p- utilities) === */
.m-0 { margin: 0 !important; }  .m-1 { margin: 4px !important; }
.m-2 { margin: 8px !important; } .m-3 { margin: 12px !important; }
.m-4 { margin: 16px !important; } .m-auto { margin: auto !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; } .mt-5 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; } .mb-5 { margin-bottom: 24px !important; }
.ml-1 { margin-left: 4px !important; } .ml-2 { margin-left: 8px !important; }
.mr-1 { margin-right: 4px !important; } .mr-2 { margin-right: 8px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.p-0 { padding: 0 !important; } .p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; } .p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.pt-1 { padding-top: 4px !important; } .pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 12px !important; } .pt-4 { padding-top: 16px !important; }
.pb-1 { padding-bottom: 4px !important; } .pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 12px !important; }
.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }

/* === TEXT === */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-white { color: #fff !important; }
.text-muted { color: #999 !important; }
.text-danger { color: #f44336 !important; }
.text-success { color: #4caf50 !important; }
.text-warning { color: #ff9800 !important; }
.text-primary { color: #007bff !important; }
.small, small { font-size: 85%; }
.font-weight-bold { font-weight: bold; }

/* === BACKGROUND === */
.bg-white { background-color: #fff !important; }
.bg-light { background-color: #f5f5f5 !important; }
.bg-dark { background-color: #333 !important; }
.bg-primary { background-color: #007bff !important; }
.bg-success { background-color: #4caf50 !important; }
.bg-danger { background-color: #f44336 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-info { background-color: #17a2b8 !important; }

/* === BORDERS & SHADOWS === */
.rounded { border-radius: 8px !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 50px !important; }
.shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; }
.shadow-sm { box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important; }
.border { border: 1px solid #ddd !important; }
.border-0 { border: 0 !important; }

/* === BUTTONS === */
.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 6px;
    font-size: 14px; cursor: pointer; text-align: center; transition: all 0.2s;
    font-weight: 500; }
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #ffc107; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success { background: #4caf50; color: #fff; }
.btn-danger { background: #f44336; color: #fff; }
.btn-warning { background: #ff9800; color: #fff; }
.btn-info { background: #17a2b8; color: #fff; }
.btn-outline-primary { background: transparent; color: #ffc107; border: 1px solid #ffc107; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* === FORMS === */
.form-control { display: block; width: 100%; padding: 10px 14px; font-size: 14px;
    border: 1px solid #ddd; border-radius: 6px; outline: none; transition: border 0.2s; }
.form-control:focus { border-color: #ffc107; box-shadow: 0 0 0 3px rgba(255,193,7,0.15); }
.form-group { margin-bottom: 16px; }
.input-group { display: flex; }
.input-group .form-control { flex: 1; border-radius: 6px 0 0 6px; }
.input-group-append .btn { border-radius: 0 6px 6px 0; }
label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: #555; }

/* === CARDS === */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; }
.card-body { padding: 16px; }
.card-header { padding: 12px 16px; background: #f5f5f5; border-bottom: 1px solid #eee; font-weight: bold; }
.card-footer { padding: 12px 16px; background: #f5f5f5; border-top: 1px solid #eee; }

/* === TABLES === */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
.table th { font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; }
.table-striped tbody tr:nth-child(odd) { background: #fafafa; }
.table-hover tbody tr:hover { background: #f0f0f0; }
.table-bordered { border: 1px solid #ddd; }
.table-bordered th, .table-bordered td { border: 1px solid #ddd; }
.table-responsive { overflow-x: auto; }

/* === BADGE === */
.badge { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600;
    border-radius: 50px; color: #fff; }
.badge-primary { background: #007bff; }
.badge-success { background: #4caf50; }
.badge-warning { background: #ff9800; }
.badge-danger { background: #f44336; }
.badge-info { background: #17a2b8; }

/* === NAVBAR === */
.navbar { display: flex; align-items: center; padding: 8px 16px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.nav-item { list-style: none; }
.nav-link { display: block; padding: 8px 12px; color: #333; font-size: 14px; }

/* === CAROUSEL (CSS scroll-snap, no JS needed) === */
.carousel { position: relative; overflow: hidden; }
.carousel-inner { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.carousel-inner::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.carousel-item img { width: 100%; display: block; }
.carousel-control-prev, .carousel-control-next { position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.4); color: #fff; border: none; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; font-size: 18px; z-index: 2; }
.carousel-control-prev { left: 10px; }
.carousel-control-next { right: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* === MODAL (backdrop for <dialog> or custom) === */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1050; display: none; }
.modal.show, .modal.fade.show { display: flex; align-items: center; justify-content: center; }
.modal-dialog { background: #fff; border-radius: 12px; max-width: 400px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.modal-content { padding: 20px; }
.fade { transition: opacity 0.3s; }
.fade:not(.show) { opacity: 0; }

/* === PAGINATION === */
.pagination { display: flex; list-style: none; padding: 0; gap: 4px; }
.page-item { }
.page-link { display: block; padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; color: #333; font-size: 13px; }
.page-item.active .page-link { background: #ffc107; color: #fff; border-color: #ffc107; }
.page-item.disabled .page-link { color: #ccc; pointer-events: none; }

/* === PROGRESS === */
.progress { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: #ffc107; border-radius: 4px; transition: width 0.3s; }

/* === UTILITIES === */
.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.h-100 { height: 100% !important; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.fixed-top { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; }
.overflow-hidden { overflow: hidden; }
.active { }
.collapse:not(.show) { display: none; }

/* === ANIMATIONS === */
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .col-6 { flex: 0 0 100%; max-width: 100%; }
}
