/* ============================ */
/* Styles g�n�raux de la page */
/* ============================ */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafd;
    margin: 0;
    padding: 0;
}

.green {
    color: green;
    font-weight: bold;
}

.red {
    color: red;
    font-weight: bold;
}

.gray {
    color: gray;
}

/* ============================ */
/* Conteneur principal avec sidebar et contenu */
/* ============================ */
.container {
    display: flex;
    min-height: 100vh;
}

/* ============================ */
/* Sidebar (menu � gauche) */
/* ============================ */
.sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    background-color: #00457c;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 0px;
}

/* ============================ */
/* Style des liens du menu */
/* ============================ */
.sidebar ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
}

.sidebar ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ============================ */
/* Style des sous-menus */
/* ============================ */
.menu-title {
    font-size: 14px;
    font-weight: bold;
    color: #b0c4de;
    padding: 8px 15px;
    margin-top: 10px;
    text-transform: uppercase;
}

.submenu {
    padding-left: 20px;
    font-size: 14px;
}

.submenu a {
    color: #b0c4de;
    font-size: 14px;
    padding: 8px 20px;
}

.submenu a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Page active dans le menu */
.sidebar ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.submenu a.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Titres de section cliquables */
.menu-title-link {
    color: #b0c4de !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    padding: 0 !important;
}

.menu-title-link:hover {
    color: white !important;
    text-decoration: none;
    background: none !important;
}

.menu-title-link.active {
    color: white !important;
    background: none !important;
}

/* ============================ */
/* Contenu principal � droite */
/* ============================ */
.content {
    flex-grow: 1;
    min-width: 0;
    overflow-x: auto;
    padding: 40px;
    background-color: #f8fafd;
}

/* ============================ */
/* Fil d'Ariane (Breadcrumb) */
/* ============================ */
.breadcrumb {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.breadcrumb a {
    color: #00457c;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 6px;
    color: #adb5bd;
}

.breadcrumb-current {
    color: #495057;
    font-weight: 500;
}

.breadcrumb-section {
    color: #6c757d;
}

/* ============================ */
/* Dashboard section pages      */
/* ============================ */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-top: 20px; }
.dash-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; text-align: center; }
.dash-card .number { font-size: 32px; font-weight: 700; color: #007bff; }
.dash-card .label { font-size: 13px; color: #666; margin-top: 5px; }
.dash-section { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-top: 20px; }
.dash-section h2 { margin-top: 0; font-size: 18px; border-bottom: 2px solid #007bff; padding-bottom: 8px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th, .dash-table td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; }
.dash-table th { background: #f5f5f5; font-weight: 600; }
.dash-links { display: flex; gap: 12px; margin-top: 15px; flex-wrap: wrap; }
.dash-link { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px 18px; font-size: 14px; color: #00457c; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.dash-link:hover { border-color: #007bff; box-shadow: 0 2px 8px rgba(0,123,255,.15); text-decoration: none; }
.dash-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.dash-badge.ok { background: #d4edda; color: #155724; }
.dash-badge.ko { background: #f8d7da; color: #721c24; }
.dash-badge.warn { background: #fff3cd; color: #856404; }
.dash-badge.info { background: #d1ecf1; color: #0c5460; }

h1 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
}

/* ============================ */
/* Tableau de donn�es */
/* ============================ */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f0f0f0;
}

/* ============================ */
/* Boutons standards */
/* ============================ */
button {
    padding: 10px 20px;
    background-color: #00457c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #003366;
}

/* Bouton secondaire */
button.secondary {
    background-color: #ffbb00;
    color: #000;
}

button.secondary:hover {
    background-color: #e5a900;
}

/* ============================ */
/* Liens standards */
/* ============================ */
a {
    color: #00457c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================ */
/* Formulaires (ajout/modification) */
/* ============================ */
form input[type="text"],
form input[type="email"],
form input[type="url"],
form input[type="password"] {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

/* ============================ */
/* Style sp�cifique � la page de login */
/* ============================ */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 350px;
    padding: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.login-container input {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.login-container button {
    background-color: #00457c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
}

.login-container button:hover {
    background-color: #003366;
}

.login-container a {
    color: #00457c;
    text-decoration: none;
    text-align: center;
    margin-top: 8px;
}

.login-container a:hover {
    text-decoration: underline;
}

/* ============================ */
/* Centrer les colonnes num�riques */
/* ============================ */
.table-metrics th,
.table-metrics td {
    text-align: center;
}

/* Centrer toutes les cellules sauf la colonne "Mot-cl�" */
.table-besoins th,
.table-besoins td {
    text-align: center;
}

/* Alignement � gauche uniquement pour la colonne "Mot-cl�" */
.table-besoins td:first-child {
    text-align: left;
}

/* ============================ */
/* Styles sp�cifiques au Dashboard */
/* ============================ */
.dashboard-container {
    display: flex;
    justify-content: start;
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    background-color: #e0e0e0;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 150px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: scale(1.05);
}

.dashboard-card span {
    display: block;
    font-size: 24px;
    font-weight: bold;
}



/* Tableau des mots-cl�s */
.keyword-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.keyword-table th, .keyword-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.keyword-table th {
    background-color: #00457c;
    color: white;
    cursor: pointer;
}

.keyword-table th.sortable:hover {
    background-color: #003366;
}

/* ? Sidebar Droite - Ajust�e � 2/3 de la page */
.sidebar_droite {
    position: fixed;
    right: -66%; /* Cach�e par d�faut */
    width: 66%;
    height: 100%;
    background: #ffffff;
    border-left: 2px solid #ddd;
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}
.sidebar_droite .scrollable-content {
    margin-top: 0px;
}

/* ? Ajustement lorsqu'on ouvre la sidebar */
.sidebar_droite.open {
    right: 0;
}

/* ? Positionnement PROPRE de la croix en dehors de la sidebar */
.sidebar_droite .close-btn {
    position: absolute;
    top: 20px; /* Ajustement fin pour �viter le chevauchement */
    left: -60px; /* Reculer encore plus la croix pour �viter le menu */
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 50%; /* Bouton rond */
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index:9999;
}

/* ? Ajout d'un l�ger fond semi-transparent autour de la croix */
.sidebar_droite .close-btn::before {
    content: "";
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.7); /* Fond semi-transparent */
    border-radius: 50%;
    z-index:9999;
}

/* ? Effet au survol */
.sidebar_droite .close-btn:hover {
    z-index:9999;
}


/* ? Emp�cher DataTables de d�passer la sidebar */
.sidebar_droite .dataTables_wrapper {
    max-width: 100%; /* Limite DataTables � la largeur de la sidebar */
    overflow-x: auto;
    padding-top: 50px; /* �vite qu'il soit coll� en haut */
}

/* ? Correction du padding pour �viter le chevauchement */
.dataTables_length, .dataTables_filter {
    padding-left: 20px;
    padding-right: 20px;
}
.selected-needs li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.selected-needs strong {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.selected-needs .remove-btn {
    align-self: flex-end;
    background: #d9534f;
    color: white;
    border: none;
    padding: 3px 7px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    line-height: 14px;
    margin-left: auto;
}

.selected-needs .remove-btn:hover {
    background: #c9302c;
}


.text-input-container input {
    width: 90%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.magic-btn {
    background: #fbc02d;
    border: none;
    color: white;
    padding: 5px 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

.magic-btn:hover {
    background: #f9a825;
}


.manual-keywords-box li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.manual-keyword-input {
    width: 80%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.manual-keywords-box strong {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.manual-keywords-box .remove-btn {
    align-self: flex-end;
    background: #d9534f;
    color: white;
    border: none;
    padding: 3px 7px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    line-height: 14px;
    margin-left: auto;
}

.manual-keywords-box .remove-btn:hover {
    background: #c9302c;
}

/* ?? Conteneur du bouton */
.campaign-btn-container {
    display: flex !important;
    justify-content: center !important;
    margin-top: 20px !important;
}

/* ?? Bouton "Programmer la campagne" */
.schedule-campaign-btn {
    background: linear-gradient(135deg, #28a745, #218838) !important;
    color: white !important;
    border: none !important;
    padding: 14px 24px !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.schedule-campaign-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px) !important;
}

.schedule-campaign-btn:active {
    transform: translateY(1px) !important;
}
.tag {
    display: inline-block;
    background-color: #eef3f7;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
    margin: 2px;
}