/* ---- General Styling & Resets ---- */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff; /* Default background body menjadi PUTIH */
    color: #333;
}

/* ---- Header Aplikasi ---- */
.app-header {
    background-color: #2c3e50; /* Biru gelap untuk header */
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    margin-right: 15px;
}

.app-logo {
    max-width: 60px; /* Ukuran default di desktop/tablet */
    height: auto;
    border-radius: 50%; /* Jika logo bulat */
}

.app-title {
    margin: 0;
    font-size: 1.5em;
    flex-grow: 1;
    text-align: center;
}

/* ---- Tombol Aksi Umum (untuk Home dan Form) ---- */
.button-container { /* Untuk halaman index.php */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    justify-content: center;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.app-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px; /* Sudut tombol lebih membulat */
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Bayangan untuk efek elevasi */
    text-decoration: none; /* Untuk tombol yang mungkin berupa link */
    display: inline-flex; /* Menggunakan inline-flex untuk ikon dan teks */
    align-items: center; /* Untuk vertikal alignment ikon */
    justify-content: center; /* Untuk horizontal alignment ikon */
    gap: 8px; /* Jarak antara ikon dan teks */
    white-space: nowrap; /* Mencegah teks tombol pecah baris */
}

.app-button:hover {
    transform: translateY(-2px); /* Efek sedikit terangkat saat hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Bayangan lebih dalam */
}

.app-button:active {
    transform: translateY(0); /* Kembali ke posisi semula saat ditekan */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Bayangan lebih tipis */
}

/* Warna tombol utama (biru) */
.primary-button {
    background-color: #3498db; /* Biru cerah */
    color: white;
}

/* Warna tombol sekunder (abu-abu) */
.secondary-button {
    background-color: #bdc3c7; /* Abu-abu sedang */
    color: #333;
}

/* ---- Tampilan Tabel Profesional (untuk log.php) ---- */
/* table-responsive untuk menjaga overflow di mobile */
.table-responsive {
    display: block; /* Agar tabel bisa discroll horizontal */
    overflow-x: auto; /* Memungkinkan scrolling horizontal */
    -webkit-overflow-scrolling: touch; /* Untuk scroll lebih halus di iOS */
    margin-bottom: 20px; /* Spasi di bawah tabel */
}

table {
    width: 100%; /* Lebar penuh di dalam table-responsive */
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Bayangan untuk efek kartu */
    border-radius: 8px; /* Sudut tabel sedikit membulat */
    overflow: hidden; /* Penting untuk radius dan scroll */
    min-width: 700px; /* Lebar minimum agar tidak terlalu sempit di desktop */
}

th, td {
    padding: 12px 15px; /* Padding lebih luas */
    border: 1px solid #e0e0e0; /* Border abu-abu terang */
    text-align: left; /* Teks rata kiri untuk keterbacaan */
    vertical-align: top; /* Konten di atas jika tinggi baris berbeda */
    white-space: nowrap; /* Mencegah teks pecah baris dalam sel tabel */
}

th {
    background-color: #2c3e50; /* Biru gelap untuk header tabel */
    color: white;
    font-weight: 700; /* Lebih tebal */
    text-transform: uppercase; /* Huruf kapital untuk header */
    letter-spacing: 0.5px; /* Sedikit spasi antar huruf */
}

td {
    background-color: #ffffff;
    color: #444;
}

tr:nth-child(even) td {
    background-color: #f9f9f9; /* Selang-seling warna baris */
}

/* Hover effect pada baris */
tr:hover td {
    background-color: #eaf2f8; /* Biru muda saat hover */
}

/* Styling untuk status aktif/kadaluarsa */
.status-active {
    color: #28a745; /* Hijau */
    font-weight: 600;
}

.status-expired {
    color: #dc3545; /* Merah */
    font-weight: 600;
}

.no-data-message {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
    background-color: #f0f0f0;
}


/* ---- Form Styling (untuk input.php dan filter di log.php) ---- */
.form-section-container {
    background-color: #f0f2f5; /* Kontainer abu-abu muda */
    margin: 20px auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 900px;
    width: 90%;
}

.form-section-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Untuk ikon Font Awesome */
.title-icon {
    font-size: 1.2em;
    color: inherit;
}

.digital-signature-form, .filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.filter-form {
    margin-bottom: 25px;
    align-items: flex-end;
}

.form-group {
    flex: 1 1 calc(50% - 10px);
    display: flex;
    flex-direction: column;
}

.filter-form .form-group {
    flex: 1 1 auto;
    min-width: 200px;
}


.form-group.full-width {
    flex: 1 1 100%;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 0.95em;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    color: #333;
    background-color: #fcfcfc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    outline: none;
}

.form-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.form-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
    gap: 15px;
}

/* Styling untuk pesan sukses/error */
.message {
    padding: 10px 20px;
    margin: 15px auto;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    max-width: 600px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.success-message {
    background-color: #e6ffe6;
    color: #28a745;
    border: 1px solid #28a745;
}

.error-message {
    background-color: #ffe6e6;
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Styling untuk hasil QR Code */
.qr-code-result {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-code-img {
    max-width: 180px;
    height: auto;
    border: 1px solid #eee;
    padding: 5px;
    border-radius: 5px;
}

.qr-verify-button, .back-home-button {
    width: fit-content;
}

/* ---- Verifikasi Page Specific Styling ---- */
.verification-page-body {
    background-color: #ffffff; /* Override body background to white for this page */
}

.verification-container {
    /* Menggunakan form-section-container sebagai basis */
    /* background-color sudah diatur di .form-section-container */
}

.verification-error-container {
    margin-top: 100px; /* Jarak lebih jauh dari header untuk pesan error */
}

.verification-intro-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.95em;
    margin-top: -20px; /* Jarak dari judul utama */
    margin-bottom: 30px;
}

.verification-details-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default 1 kolom di mobile */
    gap: 15px; /* Jarak antar item */
    margin-bottom: 25px;
}

.detail-item {
    background-color: #ffffff; /* Background putih untuk setiap detail item */
    padding: 12px 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0; /* Border halus */
    display: flex;
    flex-direction: column; /* Label di atas value */
    /* gap: 5px; */ /* Jarak antara label dan value */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Bayangan lembut */
}

.detail-label {
    font-weight: 600;
    color: #555;
    font-size: 0.85em; /* Ukuran font lebih kecil untuk label */
    margin-bottom: 3px;
    text-transform: uppercase; /* Kapital semua untuk label */
}

.detail-value {
    font-size: 1em; /* Ukuran font standar untuk nilai */
    color: #333;
    word-break: break-word; /* Mencegah teks panjang melebihi batas */
}

.verification-status {
    text-align: center;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: 700;
    display: flex;
    flex-direction: column; /* Stack label dan value */
    align-items: center; /* Pusat di tengah */
    gap: 8px; /* Jarak antara label dan value */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-label {
    color: #2c3e50; /* Warna biru gelap */
    font-size: 0.9em; /* Sedikit lebih kecil dari nilai status */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 1.3em; /* Lebih besar untuk status nilai */
}


/* ---- Responsif untuk Layar Kecil (Mobile) ---- */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
        padding: 10px 15px;
    }

    .logo-container {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .app-logo {
        max-width: 70px;
    }

    .app-title {
        font-size: 1.3em;
    }

    .button-container {
        padding: 10px 15px;
        flex-direction: column;
        align-items: center;
    }

    .app-button {
        width: auto;
        min-width: 200px;
        max-width: 90%;
        padding: 12px 20px;
        font-size: 1em;
    }

    /* Tabel di mobile */
    .table-responsive {
        margin: 0 0 15px 0;
        padding: 0 15px;
    }
    table {
        min-width: unset;
    }

    th, td {
        padding: 10px;
        white-space: nowrap;
        font-size: 14px;
    }

    /* Form di mobile */
    .form-section-container {
        padding: 15px;
        margin: 15px auto;
        width: 95%;
    }

    .form-section-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .digital-signature-form, .filter-form {
        flex-direction: column;
        gap: 15px;
    }
    .filter-form .form-group {
        min-width: unset;
    }

    .form-group {
        flex: 1 1 100%;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .app-button {
        width: 100%;
        min-width: unset;
        max-width: unset;
    }

    /* QR Code Result di mobile */
    .qr-code-result {
        padding: 15px;
        max-width: 90%;
        gap: 10px;
    }
    .qr-code-img {
        max-width: 150px;
    }
    .qr-verify-button, .back-home-button {
        width: 100%;
        min-width: unset;
        font-size: 1em;
        padding: 12px 20px;
    }

    /* Verifikasi Page Specific Styling (Mobile) */
    .verification-details-grid {
        grid-template-columns: 1fr; /* Pastikan 1 kolom di mobile */
        gap: 10px;
    }
    .detail-item {
        padding: 10px 12px;
    }
    .detail-label {
        font-size: 0.8em;
    }
    .detail-value {
        font-size: 0.95em;
    }
    .verification-status {
        padding: 12px 15px;
        font-size: 1em;
        gap: 6px;
    }
    .status-value {
        font-size: 1.2em;
    }
}

/* Lebih kecil lagi untuk ponsel sangat kecil */
@media (max-width: 480px) {
    .app-logo {
        max-width: 60px;
    }
    .app-title {
        font-size: 1.2em;
    }
    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }
    .app-button {
        padding: 10px 15px;
        font-size: 0.95em;
    }
    .form-section-title {
        font-size: 1.3em;
    }
    .title-icon {
        font-size: 1.1em;
    }
    .form-input,
    .form-select {
        font-size: 0.9em;
        padding: 8px 10px;
    }
    .message {
        font-size: 0.9em;
        padding: 8px 15px;
    }
    .qr-code-img {
        max-width: 120px;
    }
    .detail-label {
        font-size: 0.75em;
    }
    .detail-value {
        font-size: 0.9em;
    }
    .verification-status {
        font-size: 0.9em;
    }
    .status-value {
        font-size: 1.1em;
    }
}