/* style.css */

/* --- Gaya untuk Foto Profil di Halaman Profil --- */
.profile-pic-container {
    margin-bottom: 20px;
}

.profile-pic {
    width: 80px; /* Ukuran foto profil di halaman profil (Disesuaikan lebih kecil) */
    height: 80px; /* Ukuran foto profil di halaman profil (Disesuaikan lebih kecil) */
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f2f5; /* Border sedikit lebih tipis */
    box-shadow: 0 0 8px rgba(0,0,0,0.1); /* Bayangan sedikit lebih halus */
    margin-bottom: 10px; /* Margin lebih kecil */
}

/* --- Gaya untuk Foto Profil di Header Navigasi --- */
.nav-profile-pic {
    width: 20px; /* Ukuran foto profil di navigasi header (Disesuaikan lebih kecil) */
    height: 20px; /* Ukuran foto profil di navigasi header (Disesuaikan lebih kecil) */
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px; /* Margin sedikit lebih kecil */
    vertical-align: middle;
    border: 1px solid #e0e0e0;
}

/* --- Gaya untuk Foto KTP dan KTP Sambil Pegang di Halaman Profil dan Admin --- */
.ktp-pic,
.ktp-selfie-pic {
    width: 70px; /* Ukuran default untuk pratinjau foto KTP (Disesuaikan lebih kecil) */
    height: auto;
    max-width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    object-fit: contain;
    display: block;
    margin: 8px auto; /* Margin sedikit lebih kecil */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Bayangan sedikit lebih halus */
}

/* Gaya untuk ikon PDF di KTP */
.ktp-icon-pdf {
    width: 50px; /* Ukuran ikon PDF (Disesuaikan lebih kecil) */
    height: auto;
    display: block;
    margin: 8px auto;
}

/* Sesuaikan ukuran jika di dalam tabel atau tempat yang lebih kecil (misal admin manage_users, edit_user, user_loans) */
table img.ktp-pic,
table img.ktp-selfie-pic {
    width: 40px; /* Ukuran lebih kecil lagi untuk di dalam tabel admin (Disesuaikan) */
    height: auto;
    border-radius: 3px; /* Sudut sedikit lebih kecil */
    margin: 3px 0; /* Margin lebih kecil */
}


/* --- Pastikan semua kode CSS lainnya yang sudah ada tetap di bawah ini --- */

/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Global Container & Wrapper for Content */
.container.content-wrapper {
    max-width: 960px;
    margin: 20px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    min-height: 400px;
    flex-grow: 1;
}

/* Penyesuaian khusus untuk halaman login/register */
body:has(.auth-card) .container.content-wrapper {
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}
body:has(.auth-card) main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
body:has(.auth-card) {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}


/* Heading Styles */
h1, h2, h3, h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 20px;
}

h2 {
    text-align: center;
    font-size: 2.2em;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-top: 0;
}
.auth-card h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 30px;
    border-bottom: none;
}


h3 {
    font-size: 1.6em;
    margin-top: 30px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 30px 0;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    max-width: 450px;
    margin: 0 auto 20px auto;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}
.auth-card form {
    padding: 0;
    border: none;
    background-color: transparent;
    box-shadow: none;
}


label {
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 18px;
    border: 1px solid #cdd4da;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

small {
    color: #666;
    font-size: 0.9em;
    margin-top: -10px;
    margin-bottom: 15px;
    display: block;
}

/* Buttons */
button, .button {
    background-color: #007bff;
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    text-align: center;
    display: inline-block;
}

button:hover, .button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.button.secondary, .button.green {
    background-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.button.secondary:hover, .button.green:hover {
    background-color: #218838;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.logout-btn, .nav-logout-btn {
    background-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}
.logout-btn:hover, .nav-logout-btn:hover {
    background-color: #c82333;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.small-button {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 6px;
    box-shadow: none;
}
.small-button:hover {
    transform: none;
}


/* Messages (Success/Error) */
.message, .error-message {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 1.05em;
    border: 1px solid;
}

.message {
    background-color: #e6ffed;
    color: #28a745;
    border-color: #28a745;
}

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

/* Header & Footer Layout */
.main-header {
    background-color: #ffffff;
    color: #333;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}

.logo span {
    font-size: 1.9em;
    font-weight: 700;
    color: #007bff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo a {
    color: inherit;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-nav ul li a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.main-nav ul li a:hover {
    color: #007bff;
    background-color: #f0f2f5;
}

.main-footer {
    background-color: #333;
    color: #e0e0e0;
    padding: 25px 0;
    text-align: center;
    margin-top: auto;
    font-size: 0.9em;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}


/* Info Displays (loan_details, profile, pay_loan) */
.loan-details-info p,
.payment-summary p,
.profile-details p {
    background-color: #f8fbfd;
    padding: 15px 20px;
    border: 1px solid #e0e7ed;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 1em;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.4;
}

.loan-details-info p strong,
.payment-summary p strong,
.profile-details p strong {
    color: #2c3e50;
    flex-shrink: 0;
    padding-right: 15px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

table th, table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.95em;
}

table th {
    background-color: #f8fbfd;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
}

table tbody tr:nth-child(even) {
    background-color: #fbfdff;
}

table tbody tr:hover {
    background-color: #f0f8ff;
}

/* Status Indicators */
.status-pending {
    color: #ff9800;
    font-weight: 600;
}
.status-approved, .status-active {
    color: #28a745;
    font-weight: 600;
}
.status-rejected {
    color: #dc3545;
    font-weight: 600;
}
.status-paid {
    color: #007bff;
    font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-content, .footer-content {
        padding: 0 15px;
    }
    .main-header {
        padding: 10px 0;
    }
    .logo span {
        font-size: 1.6em;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin-top: 15px;
    }
    .main-nav ul li a {
        display: block;
        text-align: center;
        padding: 10px 15px;
        font-size: 0.95em;
    }
    .nav-logout-btn {
        width: auto;
        margin: 0 auto;
    }

    .container.content-wrapper {
        margin: 15px;
        padding: 20px;
        border-radius: 8px;
    }

    h2 {
        font-size: 1.8em;
    }
    h3 {
        font-size: 1.4em;
    }

    form {
        padding: 20px;
        max-width: 100%;
    }

    .button-group {
        flex-direction: column;
        gap: 15px;
    }
    .button-group a {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 20px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        box-shadow: none;
    }
    table thead, table tbody {
        white-space: normal;
    }
    table th, table td {
        min-width: 120px;
        white-space: normal;
        box-sizing: border-box;
    }
    .loan-details-info p {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
    }
    .loan-details-info p strong {
        margin-bottom: 5px;
        padding-right: 0;
    }
    .reminders-section {
        padding: 15px;
        margin-bottom: 20px;
    }
}

/* Gaya untuk Pengingat Jatuh Tempo */
.reminders-section {
    background-color: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.reminders-section h3 {
    color: #ff8f00;
    border-bottom: 1px solid #ffcc80;
    padding-bottom: 8px;
    margin-top: 0;
}

.reminders-section p {
    margin-bottom: 10px;
    font-size: 1em;
    line-height: 1.5;
    text-align: left;
}

.reminder-warning {
    color: #ff8f00;
    font-weight: 500;
}

.reminder-overdue {
    color: #d32f2f;
    font-weight: 600;
}

.reminder-warning a, .reminder-overdue a {
    font-weight: bold;
    text-decoration: underline;
}

/* Gaya untuk Bagian Pembayaran di Muka (my_loans.php) - Ini sudah dihapus fungsinya, tapi CSS-nya tetap saya berikan sebagai contoh jika diperlukan lagi */
.payment-advance-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8fbfd;
    border: 1px solid #e0e7ed;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.payment-advance-section h3 {
    color: #007bff;
    border-bottom: 1px solid #cceeff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.loan-card-summary {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.loan-card-summary h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    border-bottom: none;
    padding-bottom: 0;
}

.loan-card-summary p {
    margin-bottom: 5px;
    font-size: 0.95em;
    color: #666;
    text-align: left;
}

.loan-card-summary .button {
    margin-top: 10px;
    padding: 8px 18px;
    font-size: 0.9em;
}