/*
 * Stylesheet for Advanced Installments Manager
 * Version: 3.0.0 (Simplified & Final)
*/

/* Global Styles */
.aim-table-container, .aim-table-container * {
    font-family: 'Yekan Bakh', Arial, sans-serif !important;
    box-sizing: border-box;
}
.aim-table-container { direction: rtl; }

/* Table Styles */
.aim-table-container table { width: 100%; border-collapse: collapse; border: 1px solid #e1e1e1; margin-top: 20px;}
.aim-table-container th, .aim-table-container td { border: 1px solid #e1e1e1; padding: 12px 10px; text-align: center; vertical-align: middle; }
.aim-table-container th { font-weight: bold; background-color: #f8f9fa; color: #333; }
.aim-table-wrapper { overflow-x: auto; width: 100%; }

/* Buttons */
.aim-table-container .aim-button {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    gap: 6px !important; padding: 8px 16px !important; text-decoration: none !important;
    border-radius: 6px !important; color: white !important; border: none !important; cursor: pointer !important;
    font-size: 13px !important; font-weight: normal !important; transition: all 0.2s ease-in-out !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}
.aim-table-container .aim-button:hover { transform: translateY(-2px) !important; box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important; }
.aim-table-container .aim-download-button { background-color: #28a745 !important; }
.aim-table-container .aim-download-button::before { content: '\21E9'; font-size: 16px; line-height: 1; }

/* --- Top Controls Wrapper (Filters & Delete Button) --- */
.aim-controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}
.aim-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}
.aim-admin-actions .aim-delete-button {
    background-color: #dc3545 !important;
    color: white !important;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* --- Export Controls (Corrected Layout) --- */
.aim-export-controls { 
    background: #f9f9f9; 
    border: 1px solid #eee; 
    padding: 15px; 
    border-radius: 6px; 
}
.aim-export-controls h4 { 
    margin: 0 0 10px 0; 
    font-size: 16px;
    font-weight: bold;
}
.aim-export-options { 
    display: flex; 
    flex-wrap: wrap;
    gap: 10px; 
    align-items: center; 
}
.aim-export-options input[type="text"],
.aim-export-options select {
    flex: 1 1 150px; /* Allow items to grow but have a base size */
}
.aim-export-options button {
    flex-shrink: 0; /* Prevent button from shrinking */
}
.aim-table-container input[type="text"], .aim-table-container select, .aim-table-container button { 
    padding: 10px; border: 1px solid #ddd; 
    border-radius: 6px; font-size: 14px; 
}
#aim-export-start-date, #aim-export-end-date {
    direction: ltr;
    text-align: center;
}
#aim-filter-button, #aim-export-csv-button { cursor: pointer; background-color: #f0f0f0; color: #333; }
#aim-export-csv-button { background-color: #0073aa; color: white; }

/* Pagination */
.aim-pagination { margin-top: 20px; text-align: center; }
.aim-pagination .page-numbers { display: inline-block; padding: 8px 14px; margin: 0 3px; border: 1px solid #ddd; text-decoration: none; border-radius: 6px; color: #555; }
.aim-pagination .page-numbers.current, .aim-pagination .page-numbers:hover { background-color: #28a745; color: #fff; border-color: #28a745; }

/* --- Modal Styles --- */
.aim-modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); direction: rtl; }
.aim-modal-content { background-color: #fefefe; margin: 10% auto; padding: 25px; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 8px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.aim-modal-close { color: #aaa; float: left; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; padding: 0 5px; }
.aim-modal-close:hover, .aim-modal-close:focus { color: black; text-decoration: none; }
.aim-modal h2 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.aim-modal h3 { font-size: 16px; margin-bottom: 10px; }
.aim-modal p { font-size: 14px; color: #666; }
.aim-modal input[type="text"] { width: 100%; padding: 8px; margin-bottom: 10px; }
.aim-modal button { padding: 10px 15px; cursor: pointer; border-radius: 4px; border: 1px solid #ccc; }
#aim-find-installments-button { background-color: #0073aa; color: white; border-color: #0073aa;}
#aim-installments-to-delete-list ul { list-style: none; padding: 0; max-height: 200px; overflow-y: auto; border: 1px solid #eee; margin-top: 10px; border-radius: 4px; }
#aim-installments-to-delete-list li { padding: 8px; border-bottom: 1px solid #eee; }
#aim-installments-to-delete-list li:last-child { border-bottom: none; }
#aim-installments-to-delete-list li label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
#aim-confirm-delete-button { background-color: #dc3545; color: white; border-color: #dc3545; margin-top: 15px;}
#aim-confirm-delete-button:disabled { background-color: #ccc; border-color: #ccc; cursor: not-allowed;}
#aim-modal-message { margin-top: 15px; padding: 10px; border-radius: 4px; display: none; text-align: center; }
#aim-modal-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#aim-modal-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }