﻿/* ===================================
   NIVEAU 1: STYLES DE BASE COMMUNS
   Appliqués à TOUS les dialogs
   =================================== */


/* IMPORTANT: Supprime le padding par défaut de Syncfusion */
.e-dialog .e-dlg-header-content + .e-dlg-content {
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

/* Structure de base du dialog */
.custom-dialog {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

    /* Header commun */
    .custom-dialog .e-dlg-header {
        color: white;
    }

    .custom-dialog .e-dialog .e-dlg-header-content {
        background-color: #3f51b5;
    }

/* S'assurer que le contenu du dialog prend la hauteur complète */
.custom-dialog .e-dlg-content {
    padding: 0 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Container principal */
.dialog-content-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0rem;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0;
}

/* Sections de formulaire */
.form-section {
    padding: 0 1rem; /* Padding horizontal seulement */
    margin-bottom: 0;
}

    .form-section:last-child {
        margin-bottom: 0;
    }

/* Lignes de formulaire */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

    .form-row:last-child {
        margin-bottom: 0;
    }

/* Groupes de formulaire*/
.form-group {
    margin-bottom: 0;
    min-width: 0;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 2px !important;
        color: #495057;
        font-size: 0.875rem;
    }

/* Système de colonnes amélioré - Basé sur 12 colonnes avec gap de 10px */
.form-row > .col-md-2,
.col-md-2 {
    flex: 0 0 calc(16.666667% - 10px) !important; /* 2/12 colonnes */
    max-width: calc(16.666667% - 10px) !important;
}

.form-row > .col-md-3,
.col-md-3 {
    flex: 0 0 calc((100% - 30px) / 4) !important; /* 4 colonnes avec 3 gaps de 10px */
    max-width: calc((100% - 30px) / 4) !important;
}

.form-row > .col-md-33,
.col-md-33 {
    flex: 0 0 calc((100% - 10px) / 3) !important; /* 1/3 avec 1 gap */
    max-width: calc((100% - 10px) / 3) !important;
}

.form-row > .col-md-4,
.col-md-4 {
    flex: 0 0 calc((100% - 20px) / 3) !important; /* 3 colonnes avec 2 gaps */
    max-width: calc((100% - 20px) / 3) !important;
}

.form-row > .col-md-5,
.col-md-5 {
    flex: 0 0 calc(41.666667% - 7px) !important; /* 5/12 colonnes */
    max-width: calc(41.666667% - 7px) !important;
}

.form-row > .col-md-6,
.col-md-6 {
    flex: 0 0 calc((100% - 10px) / 2) !important; /* 2 colonnes avec 1 gap */
    max-width: calc((100% - 10px) / 2) !important;
}

.form-row > .col-md-67,
.col-md-67 {
    flex: 0 0 calc(((100% - 10px) / 3) * 2) !important; /* 2/3 avec 1 gap */
    max-width: calc(((100% - 10px) / 3) * 2) !important;
}

.form-row > .col-md-7,
.col-md-7 {
    flex: 0 0 calc(58.333% - 7px) !important;
    max-width: calc(58.333% - 7px) !important;
}

.form-row > .col-md-8,
.col-md-8 {
    flex: 0 0 calc(66.666% - 5px) !important;
    max-width: calc(66.666% - 5px) !important;
}

.form-row > .col-md-9,
.col-md-9 {
    flex: 0 0 calc(75% - 3.75px) !important;
    max-width: calc(75% - 3.75px) !important;
}

.form-row > .col-md-12,
.col-md-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Footer des dialogs */
.custom-dialog .e-footer-content {
    padding: 0.5rem 1.5rem;
    background-color: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

    .custom-dialog .e-footer-content .e-btn {
        margin-left: 0.5rem;
    }

        /* Bouton primaire */
        .custom-dialog .e-footer-content .e-btn.e-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            box-shadow: 0 2px 4px rgba(102, 126, 234, 0.4);
        }

            .custom-dialog .e-footer-content .e-btn.e-primary:hover {
                background: linear-gradient(135deg, #5a67d8 0%, #6b4199 100%);
                box-shadow: 0 4px 8px rgba(102, 126, 234, 0.5);
            }

/* Checkbox container générique */
.checkbox-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .col-md-2,
    .col-md-3,
    .col-md-33,
    .col-md-4,
    .col-md-5,
    .col-md-6,
    .col-md-67,
    .col-md-8,
    .col-md-9,
    .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .custom-dialog {
        width: 95vw !important;
        max-height: 90vh !important;
    }

    .dialog-content-container {
        padding: 0.5rem;
    }

    .form-section {
        padding: 10px 10px;
    }
}

/* ===================================
   NIVEAU 2: STYLES SPÉCIFIQUES COMMUNS
   Partagés entre plusieurs types de dialogs
   =================================== */

/* En-têtes des dialogs Prescription (View/Edit) */
.dialog-header-custom {
	padding: 10px 20px;
	background: linear-gradient(135deg, #633699 0%, #7b4fb5 100%);
	color: white;
	border-radius: 4px 4px 0 0;
	margin: -20px -20px 0 -20px;
}

.header-title {
	font-size: 1.3rem;
	font-weight: 600;
	margin-bottom: 5px;
}

.header-subtitle {
	font-size: 0.95rem;
	opacity: 0.9;
}

/* En-têtes alternatifs des dialogs Interview Scheduling */
.dialog-header h4 {
	margin: 0;
	color: #333;
	font-size: 1.25rem;
	font-weight: 600;
}

.dialog-content {
	padding: 1rem;
}

/* Boîtes de contenu en lecture seule (View dialogs) */
.view-content-box {
	padding: 0;
	background-color: #fff;
	border-radius: 4px;
	border: 1px solid #dee2e6;
	min-height: 120px;
}

.view-content-box .ql-toolbar {
	display: none !important;
}

.view-content-box .ql-container {
	border: none !important;
	font-size: 0.9rem;
}

.view-content-box .ql-editor {
	padding: 15px;
	min-height: 120px;
}

.view-content-box .e-rte-toolbar {
	display: none !important;
}

.view-content-box .e-rte-content {
	border: none !important;
	font-size: 1rem;
	padding: 15px;
	min-height: 100px;
}

/* Sections de visualisation (InterviewViewDialog) */
.view-dialog-content {
	padding: 10px 20px;
	overflow-y: auto;
	max-height: calc(700px - 120px);
}

.view-section {
	margin-bottom: 16px;
	padding: 6px 15px;
	background-color: #f8f9fa;
	border-radius: 4px;
	border-left: 3px solid #007bff;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.section-badges {
	display: flex;
	gap: 8px;
	align-items: center;
}

.view-section.metadata {
	background-color: #fff;
	border-left: 3px solid #6c757d;
}

.section-title {
	margin: 0;
	color: #333;
	font-size: 1.1rem;
	font-weight: 600;
}

.info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px 15px;
}

.info-item {
	display: flex;
	flex-direction: column;
}

.info-item.full-width {
	grid-column: 1 / -1;
}

.info-item label {
	font-weight: 600;
	color: #555;
	font-size: 0.8rem;
	margin-bottom: 4px;
}

.info-item p {
	margin: 0;
	color: #333;
	font-size: 0.9rem;
	padding: 4px 8px;
	background-color: #fff;
	border-radius: 4px;
	border: 1px solid #dee2e6;
}

/* Signatures dans les dialogs View */
.signature-container {
	text-align: center;
	padding: 10px 20px;
	background-color: #fff;
	border-radius: 4px;
	border: 1px solid #dee2e6;
}

.signature-image {
	max-width: 300px;
	max-height: 120px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.signature-date {
	margin-top: 10px;
	color: #666;
	font-style: italic;
}

/* Sections de formulaires dans les dialogs Document */
.form-section h4 {
	border-bottom: 2px solid #000000;
	padding-bottom: 0px;
	margin-bottom: 15px;
	margin-top: 10px;
}

.form-content {
	padding-bottom: 10px;
}

/* Info sections (InterviewSchedulingManagementDialog) */
.beneficiary-info {
	font-size: 0.95rem;
}

.scheduling-status h5 {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.info-section {
	font-size: 0.95rem;
}

.info-section p {
	margin-bottom: 0.5rem;
}

/* Labels et inputs des formulaires */
.form-label {
	font-weight: 500;
	margin-bottom: 0.5rem;
	display: block;
	color: #555;
}

.e-input-group, .e-float-input {
	margin-bottom: 0 !important;
}

/* Classes utilitaires de mise en page */
.mb-2 {
	margin-bottom: 0.5rem;
}

.mb-3 {
	margin-bottom: 1rem;
}

.mb-0 {
	margin-bottom: 0;
}

.p-3 {
	padding: 1rem;
}

.p-4 {
	padding: 1.5rem;
}

.text-center {
	text-align: center;
}

.text-muted {
	color: #6c757d;
}

.text-primary {
	color: #007bff;
}

.text-success {
	color: #28a745;
}

.fw-bold {
	font-weight: 600;
}

.d-flex {
	display: flex;
}

.align-items-center {
	align-items: center;
}

.gap-2 {
	gap: 0.5rem;
}

/* Spinner de chargement */
.spinner-border {
	width: 3rem;
	height: 3rem;
	border: 0.25em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
	to {
		transform: rotate(360deg);
	}
}

/* Alertes */
.alert {
	padding: 0.75rem 1.25rem;
	margin-bottom: 1rem;
	border: 1px solid transparent;
	border-radius: 0.25rem;
}

.alert-warning {
	color: #856404;
	background-color: #fff3cd;
	border-color: #ffeeba;
}

.alert-danger {
	color: #721c24;
	background-color: #f8d7da;
	border-color: #f5c6cb;
}

/* Grids dans les dialogs */
.grid-checkbox {
	margin: 0 auto;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Switch custom (InterviewSchedulingManagementDialog) */
.custom-switch {
	transform: scale(1.2);
}

.e-switch-wrapper {
	margin: 0 0.5rem;
}
