:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-color: #dfe6e9;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

.back-btn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-color);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.action-group {
    margin-bottom: 20px;
}

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: left; /* Batch Import header should be left-aligned as in the image */
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    text-align: right;
    font-size: 0.95rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: #f8fbff;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    width: 100%;
    margin-top: 10px;
}

.import-section .form-group {
    flex-direction: column;
}

.import-section .form-group label {
    width: auto;
    text-align: right;
    order: 1;
}

.import-section .form-group input, 
.import-section .form-group textarea {
    order: 2;
}

.import-section .form-group small {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
    text-align: right;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.danger-btn:hover {
    background-color: var(--danger-hover);
}

.secondary-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Table Styles */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
}

.response-box {
    background: #2d3436;
    color: #dfe6e9;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
    direction: ltr;
    margin-top: 15px;
    white-space: pre-wrap;
    border: 1px solid #636e72;
}

.tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: #e1f5fe;
    color: #0288d1;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f1f2f6;
}

.placeholder {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.status-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    text-align: right;
}

.status-item.loading {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-item.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-item.error {
    background-color: #ffebee;
    color: #c62828;
}

.modal-result {
    margin: 20px 0;
    font-weight: bold;
    font-size: 18px;
}

.bulk-actions {
    background: #fff3f3;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border: 1px solid #ffcdd2;
}

.hidden {
    display: none !important;
}

/* RTL Specific adjustments */
[dir="rtl"] .search-box i {
    right: 12px;
}

[dir="rtl"] .search-box input {
    padding-right: 35px;
    padding-left: 10px;
}
