/* ========== STYLES DE BASE ========== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	background: #f0f2f5;
	min-height: 100vh;
	padding: 20px;
}

/* Support de l'arabe */
[dir="rtl"] {
	direction: rtl;
	text-align: right;
}

[dir="rtl"] .modal-header,
[dir="rtl"] .modal-footer {
	text-align: right;
}

[dir="rtl"] .form-group label {
	text-align: right;
}

[dir="rtl"] .form-group input {
	text-align: right;
}

[dir="rtl"] .search-bar {
	direction: rtl;
}

[dir="rtl"] .header {
	direction: rtl;
}

[dir="rtl"] table {
	direction: rtl;
	text-align: right;
}

[dir="rtl"] th {
	text-align: right;
}

[dir="rtl"] td {
	text-align: right;
}

[dir="rtl"] .btn-close {
	margin-right: auto;
	margin-left: 0;
}

[dir="rtl"] .modal-header h3 {
	text-align: right;
}

[dir="rtl"] .input-icon {
	left: 15px;
	right: auto;
}

[dir="rtl"] .form-group input {
	padding-left: 40px;
	padding-right: 15px;
}

.container {
	max-width: 1300px;
	margin: 0 auto;
}

/* ========== SÉLECTEUR DE LANGUE ========== */
.language-switcher {
	display: flex;
	gap: 5px;
	background: #f8f9fa;
	border-radius: 25px;
	padding: 3px;
}

.lang-btn {
	padding: 8px 16px;
	border: none;
	border-radius: 22px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
	background: transparent;
	color: #666;
}

.lang-btn.active {
	background: #0d6efd;
	color: white;
	box-shadow: 0 4px 12px rgba(13,110,253,0.3);
}

.lang-btn:hover:not(.active) {
	background: #e9ecef;
}

/* ========== EN-TÊTE ========== */
.header {
	background: white;
	padding: 20px 30px;
	border-radius: 15px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	margin-bottom: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
}

.header h1 {
	font-size: 24px;
	color: #333;
	display: flex;
	align-items: center;
	gap: 10px;
}

.header h1 i {
	color: #0d6efd;
}

.btn-add {
	background: #198754;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
	text-decoration: none;
}

.btn-add:hover {
	background: #157347;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(25,135,84,0.3);
}

/* ========== NOTE IMPORTANTE ========== */
.note-importante {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 10px;
	padding: 15px 20px;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: #856404;
}

.note-importante i {
	font-size: 24px;
	color: #ffc107;
	flex-shrink: 0;
}

/* ========== BARRE DE RECHERCHE ========== */
.search-bar {
	background: white;
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	margin-bottom: 0px;
	display: flex;
	gap: 10px;
	align-items: center;
}

.search-bar input {
	flex: 1;
	padding: 10px 15px;
	border: 2px solid #e0e3e7;
	border-radius: 8px;
	font-size: 15px;
	transition: all 0.3s ease;
}

.search-bar input:focus {
	outline: none;
	border-color: #0d6efd;
	box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}

.btn-search {
	padding: 10px 20px;
	background: #0d6efd;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
}

.btn-clear {
	padding: 10px 20px;
	background: #6c757d;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
}

/* ========== TABLEAU ========== */
.table-container {
	background: white;
	border-radius: 15px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	overflow-x: auto;
	margin-top: 10px;
}

table {
	width: 100%;
	border-collapse: collapse;
}

thead {
	background: #f8f9fa;
}

th {
	padding: 15px;
	font-weight: 600;
	color: #555;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid #e9ecef;
	white-space: nowrap;
}

td {
	padding: 12px 15px;
	border-bottom: 1px solid #f0f0f0;
	color: #333;
	font-size: 14px;
}

tr:hover td {
	background: #f8f9ff;
}

.photo-mini {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 8px;
	cursor: pointer;
}

.no-photo {
	width: 50px;
	height: 50px;
	background: #f0f0f0;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
}

.badge {
	display: inline-block;
	padding: 4px 12px;
	background: #e7f1ff;
	color: #0d6efd;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
}

.badge-statut {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.badge-attente {
	background: #fff3cd;
	color: #856404;
}

.badge-approuve {
	background: #d4edda;
	color: #155724;
}

.btn-approve {
	background: #28a745;
	color: white;
	border: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 12px;
	margin-left: 6px;
	transition: all 0.2s ease;
}

.btn-approve:hover {
	background: #218838;
	transform: scale(1.2);
}

.btn-action {
	padding: 8px 14px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	margin: 0 3px;
	transition: all 0.2s ease;
}

.btn-edit {
	background: #ffc107;
	color: #333;
}

.btn-edit:hover {
	background: #e0a800;
}

.btn-delete {
	background: #dc3545;
	color: white;
}

.btn-delete:hover {
	background: #c82333;
}

.phone-link {
	color: #0d6efd;
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
}

.phone-link:hover {
	text-decoration: underline;
}

.lieu-commune {
	font-weight: 500;
}

.lieu-separator {
	color: #adb5bd;
	margin: 0 4px;
}

.lieu-wilaya {
	display: inline-block;
	background: #f0f0f0;
	color: #666;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 4px;
}

/* ========== MODAL ========== */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.6);
	backdrop-filter: blur(4px);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 9999;
}

.modal-overlay.active {
	display: flex;
}

/* ========== MODALS - TAILLES ADAPTÉES ========== */
.modal {
background: white;
border-radius: 20px;
width: 90%;
max-width: 500px;  /* Réduit de 520px à 500px */
max-height: 85vh;  /* Réduit de 90vh à 85vh */
overflow-y: auto;
box-shadow: 0 25px 80px rgba(0,0,0,0.25);
animation: slideUp 0.3s ease;
margin: 10px;  /* Marge de sécurité */
}

@keyframes slideUp {
	from { transform: translateY(50px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.modal-header {
	padding: 20px 25px;
	border-radius: 20px 20px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: white;
}

.modal-header.add {
	background: linear-gradient(135deg, #198754, #157347);
}

.modal-header.edit {
	background: linear-gradient(135deg, #ffc107, #e0a800);
	color: #333;
}

.modal-header h3 {
	font-size: 20px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 10px;
}

.btn-close {
	background: rgba(255,255,255,0.3);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
	color: white;
	transition: all 0.3s ease;
}

.modal-header.edit .btn-close {
	background: rgba(0,0,0,0.1);
	color: #333;
}

.btn-close:hover {
	transform: rotate(90deg);
}

.modal-body {
	padding: 25px;
}

.modal-body .subtitle {
	color: #6c757d;
	font-size: 14px;
	margin-bottom: 20px;
	text-align: center;
}

.form-group {
	margin-bottom: 18px;
}

.form-group label {
	display: block;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
	font-size: 14px;
}

.form-group label .required {
	color: #dc3545;
}

.form-group input,
.form-group select {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e0e3e7;
	border-radius: 10px;
	font-size: 15px;
	transition: all 0.3s ease;
	background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
	outline: none;
	border-color: #0d6efd;
	background: white;
	box-shadow: 0 0 0 4px rgba(13,110,253,0.1);
}

.form-group small {
	display: block;
	color: #6c757d;
	font-size: 12px;
	margin-top: 4px;
}

.photo-area {
	border: 2px dashed #dee2e6;
	border-radius: 15px;
	padding: 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #f8f9fa;
	position: relative;
}

.photo-area:hover {
	border-color: #0d6efd;
	background: #f0f7ff;
}

.photo-area i {
	font-size: 36px;
	color: #6c757d;
	margin-bottom: 8px;
	display: block;
}

.photo-area span {
	display: block;
	color: #6c757d;
	font-size: 14px;
}

.photo-area input[type="file"] {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	opacity: 0;
	cursor: pointer;
}

#addPhotoPreviewContainer,
#editPhotoPreviewContainer {
	display: none;
	position: relative;
	margin-top: 10px;
}

#addPhotoPreviewContainer img,
#editPhotoPreviewContainer img {
	width: 100%;
	max-height: 200px;
	object-fit: cover;
	border-radius: 10px;
}

.btn-remove-photo {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(220,53,69,0.9);
	color: white;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
}

.success-inline {
	display: none;
	background: #d4edda;
	color: #155724;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 15px;
	text-align: center;
	font-weight: 600;
}

.success-inline.active {
	display: block;
}

.modal-footer {
	padding: 20px 25px;
	border-top: 1px solid #e9ecef;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.btn-save {
	background: #198754;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 10px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
}

.btn-save:hover {
	background: #157347;
}

.btn-cancel {
	background: #6c757d;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 10px;
	font-weight: 600;
	cursor: pointer;
}

/* ========== MESSAGE ========== */
.message {
	display: none;
	padding: 12px 15px;
	border-radius: 8px;
	margin-bottom: 15px;
	font-weight: 500;
	text-align: center;
}

.message.success {
	display: block;
	background: #d4edda;
	color: #155724;
}

.message.error {
	display: block;
	background: #f8d7da;
	color: #721c24;
}

/* ========== PAGINATION ========== */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 20px;
	flex-wrap: wrap;
}

.pagination button {
	padding: 8px 14px;
	border: 2px solid #e0e3e7;
	background: white;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
}

.pagination button.active {
	background: #0d6efd;
	color: white;
	border-color: #0d6efd;
}

.pagination button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pagination .info {
	font-size: 14px;
	color: #666;
	margin: 0 10px;
}

/* ========== LIGHTBOX ========== */
.lightbox-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.9);
display: none;
justify-content: center;
align-items: center;
z-index: 99999;
cursor: zoom-out;
}

.lightbox-overlay.active {
display: flex;
}

.lightbox-overlay img {
max-width: 90%;
max-height: 90%;
object-fit: contain;
border-radius: 10px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
cursor: default;
}

.lightbox-close {
position: absolute;
top: 20px;
right: 30px;
color: white;
font-size: 40px;
cursor: pointer;
z-index: 100000;
background: rgba(255, 255, 255, 0.2);
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: none;
}

.lightbox-close:hover {
background: rgba(255, 255, 255, 0.4);
transform: rotate(90deg);
}

.lightbox-nav {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: white;
font-size: 30px;
background: rgba(255, 255, 255, 0.2);
border: none;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 100000;
}

.lightbox-nav:hover {
background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
left: 20px;
}

.lightbox-next {
right: 20px;
}

.lightbox-counter {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 16px;
background: rgba(0, 0, 0, 0.5);
padding: 8px 20px;
border-radius: 20px;
}

/* Bouton Notes */
.btn-notes {
background: #6f42c1;
color: white;
}

.btn-notes:hover {
background: #5a32a3;
}

/* Modal Notes */
#notesModalOverlay .modal-header {
background: linear-gradient(135deg, #6f42c1, #5a32a3);
color: white;
}

#notesModalOverlay textarea {
width: 100%;
min-height: 150px;
padding: 15px;
border: 2px solid #e0e3e7;
border-radius: 10px;
font-size: 15px;
font-family: inherit;
resize: vertical;
transition: all 0.3s ease;
}

#notesModalOverlay textarea:focus {
outline: none;
border-color: #6f42c1;
box-shadow: 0 0 0 4px rgba(111, 66, 193, 0.1);
}

.btn-save-notes {
background: linear-gradient(135deg, #6f42c1, #5a32a3);
color: white;
border: none;
padding: 12px 24px;
border-radius: 10px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.3s ease;
}

.btn-save-notes:hover {
background: linear-gradient(135deg, #5a32a3, #4a2390);
box-shadow: 0 6px 20px rgba(111, 66, 193, 0.3);
}

.title-arabe {
font-family: 'Cairo', 'Tajawal', 'Tahoma', sans-serif;
font-weight: 800;
font-size: 1.8rem;
}

@media (max-width: 768px) {
.lightbox-close {
top: 10px;
right: 15px;
font-size: 30px;
width: 40px;
height: 40px;
}

.lightbox-nav {
width: 40px;
height: 40px;
font-size: 24px;
}

.lightbox-prev {
left: 10px;
}

.lightbox-next {
right: 10px;
}
}        

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
	.modal {
		width: 92%;
		max-width: 92%;
		max-height: 80vh;
		border-radius: 15px;
		margin: 0;
	}

	.modal-header {
		padding: 15px 18px;
		border-radius: 15px 15px 0 0;
	}

	.modal-header h3 {
		font-size: 17px;
		gap: 6px;
	}

	.modal-header h3 i {
		font-size: 18px;
	}

	.modal-body {
		padding: 18px 15px;
	}

	.modal-body .subtitle {
		font-size: 13px;
		margin-bottom: 15px;
	}

	.form-group {
		margin-bottom: 14px;
	}

	.form-group label {
		font-size: 13px;
		margin-bottom: 4px;
	}

	.form-group input,
	.form-group select {
		padding: 10px 12px;
		font-size: 14px;
		border-radius: 8px;
	}

	.form-group small {
		font-size: 11px;
	}

	.photo-area {
		padding: 15px;
	}

	.photo-area i {
		font-size: 28px;
	}

	.photo-area span {
		font-size: 13px;
	}

	.modal-footer {
		padding: 15px 18px;
		flex-direction: column;
		gap: 8px;
	}

	.modal-footer button {
		width: 100%;
		justify-content: center;
		padding: 12px 20px;
		font-size: 15px;
	}

	.btn-close {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	/* Réduire la taille des icônes */
	.btn-save i,
	.btn-cancel i {
		font-size: 14px;
	}
	
	.action-buttons {
			flex-direction: column;
			width: 100%;
	}
		
	.action-buttons > * {
			width: 100%;
			text-align: center;
	}            
}

.action-buttons {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
}        

/*	note	*/
.btn-details {
    transition: all 0.3s ease;
}

.btn-details:hover {
    color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
    border-radius: 20px;
}

.btn-details i {
    margin-right: 5px;
}

/* ========== TRÈS PETITS ÉCRANS (ex: iPhone SE) ========== */
@media (max-width: 375px) {
	.modal {
		width: 95%;
		max-width: 95%;
		max-height: 78vh;
		border-radius: 12px;
	}

	.modal-header {
		padding: 12px 15px;
	}

	.modal-header h3 {
		font-size: 16px;
	}

	.modal-body {
		padding: 15px 12px;
	}

	.form-group input,
	.form-group select {
		padding: 8px 10px;
		font-size: 13px;
	}

	.modal-footer button {
		padding: 10px 15px;
		font-size: 14px;
	}
}
