@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --blue-main: #002357;
    --blue-dark: #08235f;
    --blue-light: #133a9e;
}

body {
  font-family: "Poppins", sans-serif;
  background: #f4f6f9 !important;
  overflow-x: hidden !important;
}
body, div, h2, p, strong, th, td, button, a {
    font-family: 'Inter', sans-serif !important;
}

.bg-primary, .navbar {
  /* background: linear-gradient(135deg, #1f3b53, #2aa7b8) !important; */
  background: var(--blue-main) !important;
}
.bg-primary2, .btn-primary2 {
  background: linear-gradient(135deg, #1f3b53, #2aa7b8);
}
table th {
  background: var(--blue-main) !important;
  color: white !important;
}
.btn-primary {
  /* background: linear-gradient(135deg, #1f3b53, #2aa7b8); */
  background: var(--blue-main);
  border: none;
  transition: all 0.3s ease-in-out;
}
.text-primary { color: #03669b !important; }

.btn-primary:hover {
  background-color: #03669b;
  color: #fff;
}

input.form-control {
  border-radius: 10px;
  border: 1px solid #ddd;
}

input.form-control:focus {
  border-color: #03669b;
  box-shadow: 0 0 0 0.2rem rgba(14, 74, 102, 0.25);
}

.card {
  border-radius: 1rem;
  background-color: #fff;
}
.hide { display: none !important; }

.form-control, .form-select {
  border-radius: 10px;
}

.form-control:focus, .form-select:focus {
  border-color: #cf9502;
  box-shadow: 0 0 0 0.2rem rgba(207, 149, 2, 0.25);
}

.btn-success {
  background-color: #02ac07;
  border: none;
}

.btn-success:hover {
  background-color: #03669b;
}
.badge-success { background-color: #2d6035 !important; }
.badge-warning { background-color: #cf9502 !important; }
.badge-danger { background-color: #b13131 !important; }
.bg-alert1 { background-color: #fbc8c8 !important; }
.bg-alert2 { background-color: #f57e7e !important; }
.bg-alert3 { background-color: #b13131 !important; }


.table thead th {
    font-size: 1.5rem;
    letter-spacing: .05em;
}
.table td {
  font-size: 1.5rem !important;
}

.btn-lg, .btn-round {
    border-radius: 30px;
}

.badge {
    padding: .5em .9em;
    border-radius: 20px;
    font-weight: 500;
}

/* Fix hauteur Select2 Bootstrap 5 */
/* FORCE hauteur Select2 multiple */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--multiple {
    min-height: 38px !important;
    height: auto !important;
    padding: 2px 6px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    padding: 0 !important;
}

.select2-container .select2-selection--multiple .select2-search--inline {
    margin: 0 !important;
}

.select2-container .select2-selection--multiple .select2-search__field {
    height: 28px !important;
    margin: 0 !important;
}


/* Alignement des tags */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}


/* Icône de suppression visible */
.select2-container--default .select2-selection__choice__remove {
    color: #dc3545 !important; /* rouge Bootstrap */
    font-weight: bold !important;
    margin-right: 6px !important;
    height: 20px !important;
}

.select2-container--default .select2-selection__choice__remove:hover {
    color: #a71d2a !important;
}

/* Style premium des tags */
.select2-container--default .select2-selection__choice {
    background-color: #f1f3f5 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 20px !important;
    padding: 4px 10px !important;
    font-size: 0.85rem !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  padding-left: 6px !important;
}

div.dataTables_wrapper div.dataTables_filter input {
  height: 30px !important;
}
div.dataTables_wrapper div.dataTables_filter label {
  font-size: 15px !important;
}
.dt-buttons .buttons-html5 {
  height: 25px !important;
  background-color: #01678f !important;
}
.navbar-toggler {
  background-color: white !important;
}
.margin-auto { margin: auto !important; }
textarea { min-height: 100px !important; }

/* Dashboard */
.kpi-card {
    border-radius: 1.25rem;
    color: #fff;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.kpi-card i {
    font-size: 3rem;
    position: absolute;
    right: 20px;
    bottom: 15px;
}
.kpi-value {
    font-size: 2.8rem;
    font-weight: 700;
}
.kpi-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .5px;
}
.gradient-blue {
    background: var(--blue-main);
}
.gradient-green {
    background: linear-gradient(135deg, #07665e, #06c64f);
}
.gradient-orange {
    background: linear-gradient(135deg, #f7971e, #ffd200);
}
.gradient-red {
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
}
.gradient-purple {
    background: linear-gradient(135deg, #654ea3, #eaafc8);
}
.gradient1 {
    background: linear-gradient(135deg, #057c72, #4ff8e4);
}
.gradient2 {
    background: linear-gradient(135deg, #1b057c, #854ff8);
}
.gradient3 {
    background: linear-gradient(135deg, #805d05, #f8df4f);
}
.gradient4 {
    background: linear-gradient(135deg, #044c62, #17b2e1);
}
.gradient5 {
    background: linear-gradient(135deg, #7d4504, #f38c18);
}
.section-title {
    font-weight: 700;
    margin-bottom: 1rem;
}
.card-header {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.info-grid {
    display: grid;
    grid-template-columns: 120px 10px auto;
    row-gap: 6px;
    font-size: 12px;
}

.nav-link {
  font-size: 14px !important;
}
.custom-font {
  font-size: 1.3rem !important;
}

input, select option, textarea {
  font-size: 17px !important;
}

.card {
    border-radius: 14px;
}

.card-header {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.form-control-lg,
.form-select-lg {
    border-radius: 10px;
}

.btn {
    border-radius: 10px;
}
.font-weight-bold {
  font-weight: 600 !important;
}

.doc-card {
    border-radius: 16px;
    transition: all .25s ease;
    background: #ffffff;
    overflow: visible !important;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* Types icones */
.type-1 { background: linear-gradient(135deg,#dc3545,#ff6b6b) !important; }
.type-2 { background: linear-gradient(135deg,#0d6efd,#4dabf7) !important; }
.type-3 { background: linear-gradient(135deg,#198754,#51cf66) !important; } 
.type-4 { background: linear-gradient(135deg,#68490e,#cfa951) !important; } 
.type-5 { background: linear-gradient(135deg,#d135dc,#ff6bf8) !important; }
.type-6 { background: linear-gradient(135deg,#7a8f03,#90a10d) !important; }
.type-7 { background: linear-gradient(135deg,#192b87,#5157cf) !important; } 
.type-8 { background: linear-gradient(135deg,#0e6568,#51cfc9) !important; } 


.badge {
    font-weight: 500;
}
.doc-card .btn {
  font-size: 11px;
}

.pdf-preview-container {
    position: relative;
    z-index: 1;
}

.pdf-preview-container:hover {
    z-index: 50;
}
.pdf-preview-container:hover .pdf-preview {
    opacity: 1;
    transform: translateX(0);
}


/* Base preview iframe */
.file-preview {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 16px;

    width: 340px;
    height: 440px;

    background: #fff;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0,0,0,.35);

    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: all .25s ease;

    z-index: 9999;
    overflow: hidden;
}

.file-preview iframe,
.file-preview img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

/* Hover */
.pdf-preview-container:hover .file-preview {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile */
@media (max-width: 768px) {
    .file-preview {
        display: none;
    }
}


@media (min-width: 1200px) {
    /* 🧠 CARTE À DROITE → PREVIEW À GAUCHE */
    .doc-col:nth-child(4n) .file-preview, .doc-col:nth-child(3n) .file-preview {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 16px;
        transform: translateX(-10px);
    }
    .doc-col:nth-child(4n):hover .file-preview, .doc-col:nth-child(3n):hover .file-preview {
        transform: translateX(0);
    }


    .card-upload {
        height: 475px !important;
    }
}


.file-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (min-width: 992px) and (max-width: 1199px) {
    /* C'est pour gérer la position de l'iframe preview doc qui se cachait si le card se trouve complètement à droite */
    .doc-col:nth-child(3n) .file-preview {
        left: auto;
        right: 100%;
        margin-right: 16px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .doc-col:nth-child(2n) .file-preview {
        left: auto;
        right: 100%;
        margin-right: 16px;
    }
}


.folder-card:hover {
    transform: translateY(-4px);
    transition: .2s;
}

.doc-card:hover {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

.folder-card {
    transition: all 0.25s ease;
    cursor: pointer;
}

.folder-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

.folder-icon {
    font-size: 3rem;
    color: #f4b400;
}

.section-separator {
    position: relative;
    text-align: center;
}
.section-separator span {
    background: #f8f9fa;
    padding: 0 15px;
    font-weight: 600;
    color: #c51919;
    font-size: 14px;
}
.section-separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ac051c;
    z-index: -1;
}
