/* =========================================================
   TiketBalap - Frontend Styles
   ========================================================= */

.tb-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.tb-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
}
.tb-btn-primary { background: #2271b1; color: #fff; }
.tb-btn-secondary { background: #6c757d; color: #fff; }
.tb-btn-success { background: #28a745; color: #fff; }
.tb-btn-block { width: 100%; padding: 14px; font-size: 16px; }
.tb-btn:disabled { background: #ccc; color: #777; cursor: not-allowed; }
.tb-link-underline { text-decoration: underline; }

.tb-empty-notice { text-align: center; color: #6c757d; }

/* Alerts */
.tb-alert { padding: 12px 15px; border-radius: 4px; margin-top: 10px; font-size: 14px; }
.tb-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.tb-alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.tb-response-box { margin-top: 15px; }

/* =========================================================
   Katalog [tiketbalap_katalog]
   ========================================================= */
.tb-katalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.tb-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.tb-card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}
.tb-card-content { padding: 15px; }
.tb-card-title { margin: 0 0 8px; font-size: 17px; }
.tb-card-price { margin: 0 0 12px; color: #333; }

/* =========================================================
   Halaman Tiket Tunggal (single-tiket.php)
   ========================================================= */
.tb-single-tiket-wrapper { margin: 40px auto; }
.tb-grid { display: flex; flex-wrap: wrap; gap: 30px; }
.tb-col-gallery { flex: 1; min-width: 300px; }
.tb-col-details { flex: 1; min-width: 300px; }
.tb-single-title { margin-top: 0; }

.tb-main-image { margin-bottom: 15px; }
.tb-main-image img { width: 100%; border-radius: 8px; object-fit: cover; }

.tb-gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.tb-thumb-item {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
}

.tb-meta-box {
    background: #f0f4f8;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.tb-meta-box p { margin: 3px 0; }

.tb-description { margin-bottom: 20px; }

.tb-info-penting-box {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ffeba2;
    margin-bottom: 20px;
    font-size: 13px;
}
.tb-info-penting-title { margin-top: 0; margin-bottom: 5px; }

.tb-booking-card,
.tb-shortcode-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.tb-shortcode-wrapper {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Form pemesanan (dipakai di single-tiket & shortcode booking form) */
.tb-booking-form .tb-form-group { margin-bottom: 15px; }
.tb-form-label { font-weight: bold; display: block; margin-bottom: 5px; }
.tb-form-select,
.tb-form-input,
.tb-qty-input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.tb-qty-input { width: 100px; }
.tb-form-hint { color: #666; font-size: 12px; display: block; }

/* =========================================================
   Keranjang [tiketbalap_cart]
   ========================================================= */
.tb-cart-wrapper { max-width: 900px; margin: 20px auto; }
.tb-cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.tb-cart-table th, .tb-cart-table td { padding: 12px; border: 1px solid #ddd; }
.tb-cart-table thead tr { background: #f4f4f4; text-align: left; }
.tb-cart-table .tb-col-qty { width: 100px; }
.tb-cart-table .tb-col-action { width: 50px; }
.tb-cart-qty-input { width: 60px; text-align: center; padding: 5px; }
.tb-price-strike { text-decoration: line-through; color: #888; }
.tb-remove-cart-item {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}
.tb-total-label { font-size: 16px; }
.tb-total-value { font-size: 18px; color: #2271b1; }
.tb-cart-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tb-empty-cart-box {
    background: #f8f9fa;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.tb-empty-cart-box p { font-size: 16px; color: #6c757d; margin-bottom: 20px; }

/* =========================================================
   Checkout [tiketbalap_checkout]
   ========================================================= */
.tb-checkout-wrapper { max-width: 1000px; margin: 20px auto; }
.tb-checkout-form { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 20px; }
.tb-checkout-col {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.tb-checkout-col-summary { background: #f9f9f9; }
.tb-col-heading { margin-top: 0; border-bottom: 2px solid #2271b1; padding-bottom: 8px; }
.tb-required { color: red; }

.tb-order-summary-list { list-style: none; padding: 0; margin: 0 0 20px; }
.tb-order-summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}
.tb-order-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    border-top: 2px solid #ccc;
    padding-top: 10px;
    margin-bottom: 20px;
}
.tb-order-subtotal-row,
.tb-order-discount-row {
    font-size: 14px;
    font-weight: normal;
    border-top: none;
    padding-top: 0;
    margin-bottom: 8px;
}
.tb-discount-value { color: #28a745; font-weight: bold; }
.tb-highlight { color: #2271b1; }

/* Voucher */
.tb-voucher-box {
    background: #fff8e6;
    border: 1px dashed #e0c46c;
    border-radius: 6px;
    padding: 12px 15px;
    margin: 15px 0;
}
.tb-voucher-input-row { display: flex; gap: 8px; margin-top: 6px; }
.tb-voucher-input-row .tb-form-input { flex: 1; }
.tb-voucher-input-row .tb-btn { flex-shrink: 0; padding: 10px 16px; }

/* Honeypot: sembunyikan dari manusia tanpa memakai display:none (agar tetap
   "terlihat" oleh sebagian bot sederhana yang mengecek display/visibility). */
.tb-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =========================================================
   Halaman Sukses Checkout
   ========================================================= */
.tb-checkout-success { max-width: 700px; margin: 30px auto; }
.tb-order-summary-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    margin-top: 15px;
}
.tb-payment-instruction {
    background: #eef4fa;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Helpers */
.tb-text-right { text-align: right; }
.tb-text-center { text-align: center; }
.tb-fw-bold { font-weight: bold; }

@media (max-width: 640px) {
    .tb-grid, .tb-checkout-form { flex-direction: column; }
}

/* =========================================================
   Upload Bukti Transfer
   ========================================================= */
.tb-proof-box {
    background: #fff;
    border: 1px dashed #b3c9e0;
    border-radius: 8px;
    padding: 18px;
    margin-top: 20px;
}
.tb-proof-title { margin-top: 0; margin-bottom: 10px; }
.tb-proof-existing { margin-bottom: 12px; }
.tb-proof-form input[type="file"] { display: block; width: 100%; margin-bottom: 5px; }

/* =========================================================
   Halaman Lacak Pesanan [tiketbalap_lacak_pesanan]
   ========================================================= */
.tb-history-wrapper { max-width: 650px; margin: 20px auto; }
.tb-history-intro { color: #555; margin-bottom: 20px; }
.tb-lookup-form { background: #f9f9f9; padding: 20px; border-radius: 8px; border: 1px solid #eee; }
.tb-history-result { margin-top: 20px; }
.tb-history-hint { font-size: 13px; color: #666; margin-top: 15px; text-align: center; }

/* =========================================================
   Portal Staff [tiketbalap_staff_portal]
   ========================================================= */
.tb-staff-portal { max-width: 480px; margin: 20px auto; }
.tb-staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}
.tb-staff-logout-link { color: #dc3545; text-decoration: none; font-weight: normal; font-size: 13px; }
.tb-staff-tabs { display: flex; gap: 8px; margin-bottom: 15px; }
.tb-staff-tab-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #555;
}
.tb-staff-tab-btn.tb-active { background: #2271b1; color: #fff; border-color: #2271b1; }
.tb-scan-card { margin-top: 15px; }
.tb-scan-action { margin-top: 15px; }
#tb_scanner_wrap { margin-bottom: 10px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* Kamera dibuat rasio 1:1 (persegi) - grafis QR Code juga persegi, jadi
   framing ini lebih pas dibanding video full-lebar dengan tinggi mengikuti
   rasio asli kamera (biasanya 16:9 atau malah lebih tinggi di HP), yang
   bikin halaman jadi sangat panjang dan perlu banyak scroll. */
.tb-scanner-video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
    display: block;
}

/* =========================================================
   Pilihan Metode Pembayaran (Checkout)
   ========================================================= */
.tb-gateway-option { display: block; font-weight: normal; margin: 8px 0 2px; cursor: pointer; }
.tb-gateway-option input { margin-right: 6px; }
.tb-gateway-note {
    background: #eef4fa;
    border-left: 3px solid #2271b1;
    padding: 8px 12px;
    font-size: 13px;
    margin: 4px 0 10px 22px;
    border-radius: 3px;
}
