/* css/style.css */

:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --light-bg: #f4f4f4;
    --dark-text: #333;
    --light-text: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-text);
}

[dir="rtl"] body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 300;
}

[dir="rtl"] .logo img {
    margin-right: 0;
    margin-left: 10px;
}

/* Navigation */
nav {
    background: var(--primary-color);
    padding: 0.5rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: var(--light-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
}

nav ul li a i {
    margin-right: 5px;
}

[dir="rtl"] nav ul li a i {
    margin-right: 0;
    margin-left: 5px;
}

nav ul li a:hover,
nav ul li a.active {
    background: var(--accent-color);
}

/* Language selector */
.lang-selector {
    display: flex;
    gap: 10px;
}

.lang-selector a {
    color: var(--light-text);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}

.lang-selector a.active {
    background: var(--accent-color);
}

/* Main content */
main {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--primary-color);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent-color);
    color: var(--light-text);
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: var(--primary-color);
    color: var(--light-text);
}

.btn-secondary:hover {
    background: var(--secondary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--light-text);
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--light-text);
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-export {
    background: #27ae60;
    color: var(--light-text);
    margin-right: 10px;
}

.btn-export:hover {
    background: #219a52;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    padding: 12px;
    text-align: left;
}

[dir="rtl"] table th {
    text-align: right;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background: var(--light-bg);
}

table .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

table .actions a,
table .actions button {
    padding: 5px 10px;
    font-size: 14px;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Filters */
.filters {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.filters form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.login-box h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.login-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.login-box button:hover {
    opacity: 0.9;
}

/* Fiche details */
.fiche-details {
    max-width: 800px;
    margin: 0 auto;
}

.fiche-header {
    text-align: center;
    margin-bottom: 30px;
}

.fiche-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.fiche-info {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.fiche-info p {
    margin-bottom: 10px;
}

.fiche-info strong {
    display: inline-block;
    width: 200px;
    color: var(--primary-color);
}

[dir="rtl"] .fiche-info strong {
    width: 200px;
    text-align: right;
}

.fiche-actions {
    text-align: center;
    margin-top: 30px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--light-text);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    nav ul {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters form {
        grid-template-columns: 1fr;
    }
    
    table .actions {
        flex-direction: column;
    }
    
    .fiche-info strong {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Print styles */
@media print {
    header, nav, footer, .btn, .actions, .lang-selector {
        display: none !important;
    }
    
    main {
        box-shadow: none;
        padding: 0;
    }
}

/* Styles pour les selects - À ajouter dans votre fichier style.css */

/* Style de base pour tous les selects */
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
    cursor: pointer;
    appearance: none; /* Supprime le style par défaut du navigateur */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

/* Style pour les selects en RTL (Arabe) */
[dir="rtl"] select {
    background-position: left 10px center;
    padding-right: 10px;
    padding-left: 30px;
}

/* Style au focus */
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Style pour les selects désactivés */
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Style pour les options dans le select */
select option {
    padding: 8px;
    font-size: 14px;
}

/* Style pour l'option par défaut (placeholder) */
select option:first-child {
    color: #999;
    font-style: italic;
}

/* Style pour les selects avec erreur */
select.error {
    border-color: var(--danger-color);
}

/* Style pour les petits selects (dans les tableaux par exemple) */
select.select-small {
    padding: 5px;
    font-size: 14px;
    background-size: 14px;
}

/* Style pour les selects dans les filtres */
.filters select {
    background-color: #f9f9f9;
    border-color: #ddd;
}

.filters select:hover {
    background-color: #fff;
}

/* Style pour les selects dans les formulaires compacts */
.form-compact select {
    padding: 8px;
    font-size: 14px;
}

/* Animation au survol */
select:hover:not(:disabled) {
    border-color: var(--secondary-color);
}

/* Style pour les groupes de selects */
.select-group {
    display: flex;
    gap: 10px;
}

.select-group select {
    flex: 1;
}

.specialite-description {
    font-size: 0.9rem;
    margin-top: 10px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
}

[dir="rtl"] .specialite-description {
    font-family: 'Cairo', sans-serif;
}


/* Style pour les selects multiples */
select[multiple] {
    height: auto;
    min-height: 100px;
    padding: 5px;
    background-image: none;
}

select[multiple] option {
    padding: 5px;
    margin: 2px 0;
    border-radius: 3px;
}

select[multiple] option:hover {
    background-color: var(--light-bg);
}

select[multiple] option:checked {
    background-color: var(--accent-color);
    color: white;
}

/* Style pour les selects dans les modales */
.modal select {
    width: 100%;
    margin-bottom: 10px;
}

/* Amélioration de la lisibilité des selects en mode RTL */
[dir="rtl"] select {
    font-family: 'Cairo', sans-serif;
    text-align: right;
    padding-right: 10px;
    background-position: left 10px center;
}

[dir="rtl"] select option {
    font-family: 'Cairo', sans-serif;
    text-align: right;
    padding: 8px 10px;
}

/* Style pour l'option par défaut */
select option:first-child {
    color: #666;
    font-style: italic;
}

[dir="rtl"] select option:first-child {
    color: #666;
    font-style: italic;
}

/* Style pour les options au survol */
select option:hover {
    background-color: #f0f0f0;
}

/* Pour que les options en arabe s'affichent correctement */
select option[lang="ar"] {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
}
/* Styles spécifiques pour les selects en arabe */
.arabic-select,
.arabic-select option {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    font-size: 16px !important;
}

/* Force l'application des styles même sur les navigateurs récalcitrants */
select.arabic-select {
    background-position: left 10px center !important;
    padding-right: 10px !important;
    padding-left: 30px !important;
}

/* Style pour les options au survol */
.arabic-select option:hover {
    background-color: #f0f0f0 !important;
}

/* Style pour l'option sélectionnée */
.arabic-select option:checked {
    background-color: #1e3c72 !important;
    color: white !important;
}
/* Media queries pour le responsive */
@media (max-width: 768px) {
    select {
        font-size: 16px; /* Évite le zoom automatique sur mobile */
        padding: 12px; /* Plus facile à toucher */
    }
    
    .select-group {
        flex-direction: column;
        gap: 5px;
    }
}