/*
 * File: app/public/css/style.css
 * Semua gaya kustom untuk aplikasi Anda.
 */

body {
    -webkit-tap-highlight-color: transparent;
}

#loadingOverlay .spinner-border {
    width: 3rem; 
    height: 3rem;
}

/* --- Gaya Navigasi Bawah --- */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-shadow: 0 -1px 3px 0 rgba(0,0,0,0.1), 0 -1px 2px 0 rgba(0,0,0,0.06);
    height: 68px;
}

.bottom-nav-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    color: #9CA3AF;
    transition: color 0.2s;
}
.bottom-nav-link:hover {
    color: #3B82F6; 
}
.bottom-nav-link.active {
    color: #2563EB; 
}
.bottom-nav-link.active span {
    font-weight: 600; 
}

/* --- Kelas Helper Global --- */
.input-text {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.input-text:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.btn-primary {
    background-color: #2563EB;
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
}
.btn-primary:hover { background-color: #1D4ED8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
    background-color: #DC2626;
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
}
.btn-danger:hover { background-color: #B91C1C; }

.btn-warning {
    background-color: #F59E0B;
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
}
.btn-warning:hover { background-color: #D97706; }

.btn-success {
    background-color: #16A34A;
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
}
.btn-success:hover { background-color: #15803D; }

/* --- Kartu --- */
.dashboard-card,
.menu-card,
.admin-card,
.quick-access-card {
    background-color: white; 
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
                0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: #374151;
}
.dashboard-card:hover,
.menu-card:hover,
.admin-card:hover,
.quick-access-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    color: #1D4ED8;
}

/* --- KARTU BARU UNTUK TUGAS ANJEM & LUAR --- */
.dashboard-card-horizontal {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
                0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: #374151;
}
.dashboard-card-horizontal:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    color: #1D4ED8;
}

/* --- Tombol Aksi --- */
.btn-action-primary, 
.btn-action-danger, 
.btn-action-warning, 
.btn-action-success {
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}
.btn-action-primary { background-color: #3B82F6; }
.btn-action-primary:hover { background-color: #2563EB; }
.btn-action-danger { background-color: #EF4444; }
.btn-action-danger:hover { background-color: #DC2626; }
.btn-action-warning { background-color: #F59E0B; }
.btn-action-warning:hover { background-color: #D97706; }
.btn-action-success { background-color: #22C55E; }
.btn-action-success:hover { background-color: #16A34A; }

/* =============================================
   TAB PIL RESPONSIF (DENGAN BUBBLE YANG TIDAK TERPOTONG)
   ============================================= */

#transaksi-status-tabs {
    display: flex;
    flex-wrap: wrap; /* Biarkan tab pindah ke baris baru */
    gap: 0.5rem; /* Beri jarak antar tab */
}

/* --- TAB BUTTON (DESAIN PIL ASLI) --- */
.tab-button {
    position: relative; /* Kunci posisi bubble */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    
    /* Ukuran seragam */
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 120px;
    min-width: 100px;
    
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Bentuk pil */
    font-weight: 500;
    font-size: clamp(0.7rem, 2.5vw, 0.875rem);
    
    color: #4B5563;
    background-color: #F3F4F6; /* <-- KEMBALIKAN WARNA LATAR */
    transition: all 0.2s;
    white-space: nowrap;
    overflow: visible; /* <-- PASTIKAN TIDAK DIPOTONG */
    text-overflow: ellipsis;
}

.tab-button.active {
    color: white;
    background-color: #2563EB; /* <-- KEMBALIKAN WARNA LATAR AKTIF */
}

/* --- BUBBLE NOTIFIKASI (PERBAIKAN UTAMA) --- */
.notif-bubble {
  position: absolute;
  top: 0.25rem; /* Posisikan di atas */
  
  /* --- TRIK CSS AGAR BUBBLE KELUAR DARI BATAS TOMBOL --- */
  /* 1. Posisikan di tepi dalam tombol */
  right: 0.75rem; 
  /* 2. Geser ke luar sejauh 50% dari lebar bubble itu sendiri */
  transform: translateX(50%); 
  
  /* --- Gaya Bubble --- */
  background: #EF4444; /* Default merah */
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 2px 5px;
  min-width: 16px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: none;
  
  /* --- PASTIKAN BUBBLE SELALU DI ATAS --- */
  z-index: 20; /* Nilai tinggi agar menimpa elemen lain */
}

/* --- Warna Bubble --- */
.notif-bubble.show { display: inline-block; }
.notif-bubble.info { background: #3b82f6; }
.notif-bubble.success { background: #10b981; }
.notif-bubble.gray { background: #9ca3af; }

/* 
   OPSIONAL: Buat tab memenuhi lebar barisnya di layar kecil
   agar terlihat lebih rapi dan mudah diklik.
*/
@media (max-width: 768px) {
    #transaksi-status-tabs .tab-button {
        flex-grow: 1; /* Biarkan tab membesar untuk mengisi ruang kosong */
        min-width: 120px; /* Jangan biarkan tab terlalu kecil */
        text-align: center; /* Ratakan teks ke tengah */
    }
}

/* --- Animasi efek denyut --- */
@keyframes pulse-notif {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

/* --- Gaya Galeri Gambar --- */
#imageGalleryModal .modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* --- Padding Card --- */
.dashboard-card {
    padding: 0.75rem;
}

/* --- Card Akses Cepat --- */
.quick-access-card {
    padding: 0.75rem;
    aspect-ratio: 1 / 1;
    width: auto;
}

/* Tambahkan ke file CSS kamu */
.btn-pagination {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pagination:hover:not(.disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-pagination.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.btn-pagination.disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}


/* Loading placeholder untuk foto */
.photo-gallery-container img {
    background: #f3f4f6;
    transition: opacity 0.3s ease;
}

.photo-gallery-container img[src=""],
.photo-gallery-container img:not([src]) {
    opacity: 0.5;
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect fill="%23e5e7eb"/></svg>');
}

/* Hover effect */
.photo-gallery-container img:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Animasi shake untuk field yang error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
    border: 2px solid #ef4444 !important; /* Red border */
    background-color: #fee2e2 !important; /* Light red background */
}

/* Highlight untuk field yang required */
input[required]:invalid,
textarea[required]:invalid {
    border-color: #fbbf24; /* Yellow border untuk field kosong */
}

/* Visual feedback untuk upload foto */
input[type="file"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}