/* ==========================================================================
   Base Styling for Aijo Affiliate Plugin
   ========================================================================== */

/* Main wrapper for all affiliate pages */
#aijo-affiliate-wrapper {
    max-width: 800px;
    margin: 3em auto;
    padding: 2em;
    background: #fdfdfb;
    border: 1px solid #eaeaea;
    border-radius: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

/* Container for form pages */
.aijo-form-container {
    max-width: 500px;
}

.aijo-form-header,
.aijo-dashboard-header {
    text-align: center;
    margin-bottom: 2em;
    position: relative;
}

.aijo-form-header h2,
.aijo-dashboard-header h2 {
    font-size: 1.5em;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
}

.aijo-form-header h3,
.aijo-dashboard-header h3 {
    font-size: 1em;
    font-weight: 400;
    letter-spacing: 1px;
    color: #777;
    margin-top: 0.25em;
}

.aijo-logout-link {
    position: absolute;
    top: 0;
    right: 0;
    text-decoration: none;
    color: #a00;
}

/* Form Elements */
.form-row {
    margin-bottom: 1em;
}

.form-row label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5em;
}

.input-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
}

.aijo-button {
    background-color: #1DB954; /* Green */
    color: white;
    border: none;
    padding: 12px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.aijo-button:hover {
    background-color: #1ed760;
}

.aijo-button-secondary {
    text-decoration: none;
    color: #333;
}

.aijo-form-footer {
    text-align: center;
    margin-top: 1.5em;
    font-size: 0.9em;
    color: #777;
}

/* Notice/Message boxes */
.aijo-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
    text-align: center;
}
.aijo-notice.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.aijo-notice.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ==========================================================================
   Dashboard Specific Styles
   ========================================================================== */

.aijo-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 2em;
    background: #f9f9f9;
    padding: 1.5em;
    border-radius: 5px;
}

.aijo-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.aijo-user-info .dashicons {
    font-size: 48px;
    color: #333;
}

.aijo-user-info .user-details {
    display: flex;
    flex-direction: column;
}

.aijo-user-info strong {
    font-size: 1.2em;
}

.aijo-user-info span {
    color: #555;
}

.aijo-balance-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.balance-box {
    text-align: right;
}

.balance-box .balance-title {
    font-size: 0.8em;
    color: #777;
    display: block;
}

.balance-box .balance-amount {
    font-size: 1.5em;
    font-weight: 600;
    display: block;
}

.aijo-balance-info .aijo-button {
    width: auto; /* Override full width for this button */
}

/* Transaction Table */
.aijo-table-title {
    text-align: center;
    margin-bottom: 1em;
}

.aijo-table {
    width: 100%;
    border-collapse: collapse;
}

.aijo-table th, .aijo-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

.aijo-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.aijo-amount-in {
    color: #1DB954;
    font-weight: 600;
}

.aijo-status-unpaid { background-color: #fff3cd; color: #856404; padding: 5px 10px; border-radius: 20px; font-size: 0.8em; }
.aijo-status-paid { background-color: #d4edda; color: #155724; padding: 5px 10px; border-radius: 20px; font-size: 0.8em; }

/* Tambahkan ini di file assets/css/style.css */
/* Styling untuk status di halaman admin */
.aijo-status-admin-approved {
    display: inline-block;
    padding: 2px 8px;
    background-color: #28a745; /* Hijau */
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}
.aijo-status-admin-rejected {
    display: inline-block;
    padding: 2px 8px;
    background-color: #dc3545; /* Merah */
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Styling untuk tombol hapus agar tidak terlalu mencolok */
.button.button-link-delete {
    color: #a00;
    border-color: transparent;
    background: none;
    box-shadow: none;
    padding: 0;
    vertical-align: baseline;
}
.button.button-link-delete:hover {
    color: #dc3545;
    text-decoration: underline;
}


/* ==========================================================================
   Withdraw Page Specific Styles
   ========================================================================== */

.aijo-withdraw-info {
    background: #f9f9f9;
    border-radius: 5px;
    padding: 1.5em;
    margin-bottom: 2em;
    display: flex;
    justify-content: space-between;
}

.aijo-withdraw-info .info-box strong {
    font-size: 1.2em;
    display: block;
}
.aijo-withdraw-info .info-box span {
    color: #555;
    font-size: 0.9em;
}

.aijo-total-display {
    background: #e9ecef;
    padding: 1em;
    margin: 1em 0;
    text-align: center;
    border-radius: 3px;
}

.aijo-total-display span {
    color: #555;
    display: block;
    font-size: 0.9em;
    margin-bottom: 0.25em;
}
.aijo-total-display strong {
    font-size: 1.5em;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .aijo-header-info, .aijo-balance-info, .aijo-withdraw-info {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .balance-box {
        text-align: center;
    }
    .aijo-table thead {
        display: none;
    }
    .aijo-table tr {
        display: block;
        margin-bottom: 1em;
        border: 1px solid #eaeaea;
    }
    .aijo-table td {
        display: block;
        text-align: right;
        border-bottom: 1px dotted #ccc;
    }
    .aijo-table td:before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
    }
}

/* REVISI: Mengecilkan ukuran filter */
.aijo-filter-form {
    padding: 0.8em 1em; /* Padding lebih kecil */
    margin-bottom: 1.5em;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eaeaea;
}
.aijo-filter-form form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-item label {
    font-size: 11px; /* Ukuran font label lebih kecil */
    color: #555;
    margin-bottom: 3px;
    font-weight: 600;
}
.filter-item input[type="date"] {
    padding: 4px 8px; /* Padding input lebih kecil */
    border: 1px solid #ddd;
    border-radius: 3px;
}
.aijo-button-small {
    padding: 5px 15px; /* Padding tombol lebih kecil */
    font-size: 13px;
}


/* Styling untuk Grid Statistik Baru */
.aijo-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 1.5em;
}

.stats-card {
    background: #fff;
    border: 1px solid #eaeaea;
    padding: 1.5em;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
}

.stats-card.highlight {
    background-color: #f0fbf3;
    border-color: #1DB954;
}

.stats-card .stats-title {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 0.5em;
}

.stats-card .stats-value {
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 1em;
}

.stats-card .aijo-button {
    margin-top: auto; /* Mendorong tombol ke bawah */
}

/* Info Box untuk Nama & Kode Afiliasi */
.aijo-user-info-box {
    text-align: center;
    padding: 1em;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 2em;
}
.aijo-user-info-box strong {
    display: block;
    font-size: 1.2em;
}
.aijo-user-info-box span {
    color: #777;
}

/* Penyesuaian lain */
.aijo-table th:last-child, .aijo-table td:last-child {
    text-align: right;
}
.aijo-table .aijo-status-unpaid, .aijo-table .aijo-status-paid {
    text-align: center;
    display: inline-block;
    width: 60px;
}

/* REVISI: Container untuk riwayat transaksi dengan scroll bar */
.aijo-history-container {
    max-height: 200px; /* Atur tinggi maksimal di sini */
    overflow-y: auto;  /* Tampilkan scroll bar vertikal jika konten lebih tinggi */
    border: 1px solid #eaeaea;
    border-radius: 3px;
}

/* Sedikit penyesuaian agar tabel tidak menempel */
.aijo-history-container .aijo-table {
    border: none; 
}

/* REVISI: Styling untuk saldo keluar (withdraw) berwarna merah */
.aijo-amount-out {
    color: #dc3545; /* Merah */
    font-weight: 600;
}
.aijo-status-pending,
.aijo-status-approved,
.aijo-status-rejected {
    background-color: #e9ecef; color: #495057; padding: 5px 10px; border-radius: 20px; font-size: 0.8em;
}
.aijo-status-approved {
    background-color: #d4edda; color: #155724;
}
.aijo-status-rejected {
    background-color: #f8d7da; color: #721c24;
}

/* Tambahkan di file assets/css/style.css */
.aijo-input-format {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
    font-style: italic;
}


#aijo-admin-dashboard-wrapper.aijo-admin-minimal {
    max-width: 100%;
    margin: 2em auto;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}
.admin-header-minimal { text-align: center; margin-bottom: 2.5em; }
.admin-header-minimal h1 { font-size: 1.5em; font-weight: 900; letter-spacing: 3px; margin: 0; }
.admin-header-minimal p { font-size: 0.9em; color: #666; margin: 5px 0 20px; }
.admin-header-minimal .admin-logout-link { text-decoration: underline; color: #a00; }
.admin-nav-minimal { display: flex; justify-content: center; gap: 10px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 2em; }
.admin-nav-minimal a { 
    text-decoration: none; 
    color: #666; 
    font-weight: 600; 
    padding: 8px 20px; 
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 5px;
    transition: all 0.2s ease-in-out; 
}
.admin-nav-minimal a:hover { 
    color: #111;
    background: #f0f0f0;
    border-color: #ccc;
}
.admin-nav-minimal a.active { 
    color: #fff; 
    background-color: #333;
    border-color: #333;
}
.admin-content-minimal { background: none; padding: 0; box-shadow: none; border-radius: 0; }
.aijo-admin-page-content h1 { text-align: center; font-size: 1.2em; letter-spacing: 2px; margin-top: 2em; margin-bottom: 1em; border: none; padding: 0; }

/* Styling untuk Tabel Admin Kustom */
.aijo-admin-table-container { overflow-x: auto; }
table.aijo-admin-table { width: 100%; border-collapse: collapse; margin-top: 1em; font-size: 14px; }
table.aijo-admin-table thead th { background: none; border-bottom: 2px solid #e0e0e0; font-size: 12px; color: #555; text-transform: uppercase; text-align: left; padding: 12px 10px; font-weight: 600; }
table.aijo-admin-table tbody td { padding: 15px 10px; vertical-align: middle; border-bottom: 1px solid #f0f0f0; color: #333; }
table.aijo-admin-table tbody tr:last-child td { border-bottom: none; }
table.aijo-admin-table tbody td small { color: #777; display: block; font-size: 12px; }
table.aijo-admin-table .button, table.aijo-admin-table .button-primary { background: #555; border-color: #555; color: #fff; text-decoration: none; padding: 4px 10px; font-size: 13px; border-radius: 3px; height: auto; line-height: normal; }
table.aijo-admin-table .button:hover, table.aijo-admin-table .button-primary:hover { background: #333; border-color: #333; }
table.aijo-admin-table .button-link-delete { color: #a00; text-decoration: none; vertical-align: middle; margin-left: 5px; font-size: 13px; }
table.aijo-admin-table .button-link-delete:hover { color: #dc3545; text-decoration: underline; }

/* Status di Tabel Admin */
.aijo-status-admin-approved { display: inline-block; padding: 4px 8px; background-color: #e7f7e8; color: #0a6421; border-radius: 4px; font-size: 12px; font-weight: 600; }
.aijo-status-admin-rejected { display: inline-block; padding: 4px 8px; background-color: #fbeaea; color: #a61212; border-radius: 4px; font-size: 12px; font-weight: 600; }

/* Styling untuk Filter Form di Halaman Ranking */
.aijo-filter-form-frontend { display: flex; gap: 15px; align-items: flex-end; justify-content: center; padding: 15px; background: #f9f9f9; border: 1px solid #e5e5e5; border-radius: 5px; margin-top: 2em; margin-bottom: 2em; }
.aijo-filter-form-frontend label { font-size: 12px; margin-right: 5px; }
.aijo-filter-form-frontend input[type="date"] { padding: 5px; }
.aijo-filter-form-frontend .button { padding: 5px 15px; font-size: 13px; }

/* ==========================================================================
   3. RESPONSIVE STYLING
   ========================================================================== */
@media screen and (max-width: 768px) {
    .aijo-stats-grid, .aijo-withdraw-info { flex-direction: column; align-items: stretch; text-align: center; }
    .aijo-table thead { display: none; }
    .aijo-table tr { display: block; margin-bottom: 1em; border: 1px solid #eaeaea; }
    .aijo-table td { display: block; text-align: right; border-bottom: 1px dotted #ccc; }
    .aijo-table td:before { content: attr(data-label); float: left; font-weight: 600; }
    .admin-nav-minimal { gap: 10px; }
    .admin-nav-minimal a { font-size: 14px; }
    .aijo-filter-form-frontend { flex-direction: column; }
}


aijo-admin-table-container {
    overflow-x: auto; /* Tambahkan scroll horizontal di layar kecil */
}

table.aijo-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 14px;
}

table.aijo-admin-table thead th {
    background: none;
    border-bottom: 2px solid #e0e0e0;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    text-align: left;
    padding: 12px 10px;
    font-weight: 600;
}

table.aijo-admin-table tbody td {
    padding: 15px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

table.aijo-admin-table tbody tr:last-child td {
    border-bottom: none;
}

table.aijo-admin-table tbody td small {
    color: #777;
    display: block;
    font-size: 12px;
}

table.aijo-admin-table .button,
table.aijo-admin-table .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 3px;
    height: auto;
    line-height: normal;
}
table.aijo-admin-table .button:hover,
table.aijo-admin-table .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

table.aijo-admin-table .button-link-delete {
    color: #a00;
    text-decoration: none;
    vertical-align: middle;
    margin-left: 5px;
    font-size: 13px;
}
table.aijo-admin-table .button-link-delete:hover {
    color: #dc3545;
    text-decoration: underline;
}

/* Status di Tabel Admin */
.aijo-status-admin-approved {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e7f7e8;
    color: #0a6421;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.aijo-status-admin-rejected {
    display: inline-block;
    padding: 4px 8px;
    background-color: #fbeaea;
    color: #a61212;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

form.aijo-status-form {
    display: flex;
    align-items: center;
    gap: 8px; /* Jarak antara dropdown dan tombol */
}

form.aijo-status-form select {
    min-width: 120px; /* Atur lebar minimal di sini */
    padding: 6px;
}

form.aijo-status-form .button {
    padding: 5px 12px;
    font-size: 13px;
    height: auto;
    line-height: normal;
}