/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #212529;
    color: #e9ecef;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

h1, h2, h3 {
    color: #f8f9fa;
    margin-bottom: 15px;
}

h1 {
    font-size: 2rem;
    border-bottom: 2px solid #343a40;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card {
    background-color: #2c3034;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background-color: #343a40;
    padding: 15px 20px;
    border-bottom: 1px solid #495057;
}

.card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #f8f9fa;
}

.card-body {
    padding: 20px;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    text-decoration: none;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-warning:hover {
    background-color: #d35400;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group small {
    display: block;
    color: #777;
    font-size: 0.8rem;
    margin-top: 5px;
}

.table-container {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
    border: 1px solid #343a40;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #343a40;
}

table th {
    background-color: #343a40;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

table tr {
    background-color: #2c3034;
    border-bottom: 1px solid #495057;
}

table tr:hover {
    background-color: #343a40;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Couleurs des badges */
.bg-success {
    background-color: #2ecc71 !important;
    color: white !important;
}

.bg-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.bg-warning {
    background-color: #f39c12 !important;
    color: white !important;
}

.bg-info {
    background-color: #3498db !important;
    color: white !important;
}

.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

/* Classe text-secondary pour améliorer la lisibilité sur fond sombre */
.text-secondary {
    color: #adb5bd !important;
}

/* Classes spécifiques pour la compatibilité */
.badge-success {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

.badge-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.badge-warning {
    background-color: #f39c12;
    color: white;
}

.badge-info {
    background-color: #3498db;
    color: white;
}

/* Classe spéciale pour le statut "transferred" */
span.TRANSFERRED {
    background-color: #2ecc71 !important;
    color: white !important;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Styles pour la barre de navigation */
.navbar {
    background-color: #1d2124;
    display: flex;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    align-items: center;
    justify-content: flex-start;
}

.navbar-logo {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: auto;
    min-width: 180px;
}

.navbar-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-items {
    display: flex;
    align-items: center;
    margin-left: 0;
    flex: 1;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 15px 12px;
    text-decoration: none;
    transition: color 0.3s, background-color 0.3s;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    font-size: 0.9rem;
}

.nav-link i {
    margin-right: 6px;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.user-info {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-left: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
}

.username {
    margin-right: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.username i {
    margin-right: 8px;
}

.logout-button {
    display: inline-block;
    background-color: rgba(231, 76, 60, 0.2);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.logout-button i {
    margin-right: 5px;
}

.logout-button:hover {
    background-color: rgba(231, 76, 60, 0.7);
    color: white;
    text-decoration: none;
}

/* Style pour la gestion de la clé API */
.api-key-container {
    margin: 20px 0;
}

.api-key-display {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

#api-key-field {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    background-color: #f5f5f5;
    letter-spacing: 2px;
}

.btn-icon {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-icon:hover {
    background-color: #e0e0e0;
}

#regenerate-api-key {
    margin-bottom: 15px;
}

.warning-text {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Améliorations pour la notification */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.notification {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    padding: 15px;
    animation: slide-in 0.3s ease-out;
    display: flex;
    align-items: center;
}

.notification.success {
    border-left: 4px solid #2ecc71;
}

.notification.danger {
    border-left: 4px solid #e74c3c;
}

.notification.warning {
    border-left: 4px solid #f39c12;
}

.notification.info {
    border-left: 4px solid #3498db;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Style pour le toggle switch */
.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    margin: 0 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-label:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
}

input[type="checkbox"]:checked + .toggle-label {
    background-color: #2ecc71;
}

input[type="checkbox"]:checked + .toggle-label:after {
    left: 27px;
}

input[type="checkbox"] {
    display: none;
}

.toggle-text {
    font-weight: bold;
}

/* Style pour la modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #343a40;
    color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid #495057;
    margin: 10% auto;
    padding: 20px;
    width: 500px;
    max-width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Styles pour le tableau de bord */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #2c3034;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f8f9fa;
    margin-bottom: 10px;
}

.stat-info {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-bottom: 10px;
    font-style: italic;
}

.stat-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.15);
}

/* Styles pour les boutons de statut */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    margin-right: 10px;
}

.status-active {
    background-color: #28a745;
    color: white;
}

.status-inactive {
    background-color: #dc3545;
    color: white;
}

.bot-controls {
    margin: 20px 0;
    display: flex;
    align-items: center;
}

.bot-status {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.btn-toggle-bot {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-toggle-bot:hover {
    background-color: #c82333;
}

.btn-toggle-bot.activate {
    background-color: #28a745;
}

.btn-toggle-bot.activate:hover {
    background-color: #218838;
}

/* Styles pour le tableau des transferts */
.transfers-table {
    background-color: #2c3034;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 30px;
}

.transfers-table h2 {
    padding: 15px 20px;
    margin: 0;
    background-color: #343a40;
    border-bottom: 1px solid #495057;
}

/* Style pour le badge de notification */
.nav-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: bold;
}

.nav-badge.pulse {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Styles pour les boutons en cours de traitement */
.btn.processing {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn.processing:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Styles pour la popup centrale améliorée */
.central-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.central-popup.show {
    opacity: 1;
}

.central-popup-content {
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-color);
}

.central-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.central-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.central-popup-body {
    padding: 20px;
    min-height: 100px;
}

.central-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.message-meta {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.message-meta p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: var(--text-color-secondary);
}

.message-content {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--secondary-color);
    max-height: 250px;
    overflow-y: auto;
    word-break: break-word;
}

.message-content p:first-child {
    margin-top: 0;
    color: var(--text-color-secondary);
}

.message-content p#popup-message-content {
    background-color: #222;
    padding: 10px;
    border-radius: 4px;
    color: #fff;
    font-family: "Roboto", sans-serif;
    white-space: pre-wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    line-height: 1.5;
    border: 1px solid #333;
    margin: 0;
}

.message-media {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ff9800;
}

.popup-message-info {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    text-align: right;
    font-style: italic;
    margin-top: 10px;
}

/* Améliorations pour les boutons de la popup */
.central-popup-footer .btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.central-popup-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

.central-popup-footer .btn-success {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.central-popup-footer .btn-danger {
    background-color: #f44336;
    border-color: #f44336;
}

.central-popup-footer .btn-secondary {
    background-color: #757575;
    border-color: #757575;
}

/* Animation pour l'ouverture/fermeture */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.central-popup.show .central-popup-content {
    animation: fadeInDown 0.3s forwards;
}

/* Adaptation pour les appareils mobiles */
@media (max-width: 767px) {
    .central-popup-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .central-popup-footer {
        flex-direction: column;
    }
    
    .central-popup-footer .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Styles pour la page des logs */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logs-actions {
    display: flex;
    gap: 10px;
}

.logs-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    margin-bottom: 0;
    font-weight: 500;
    color: #e9ecef;
}

.form-control {
    background-color: #212529;
    border: 1px solid #495057;
    color: #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #3498db;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    background-color: #2c3034;
}

.form-text {
    color: #adb5bd;
    margin-top: 5px;
    font-size: 0.875rem;
}

.form-label {
    color: #e9ecef;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-check-input {
    background-color: #212529;
    border: 1px solid #495057;
}

.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.form-check-label {
    color: #e9ecef;
}

.logs-count {
    margin-left: 15px;
}

.logs-count .badge {
    font-size: 0.85rem;
    padding: 5px 10px;
}

.log-message {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination ul {
    display: flex;
    list-style-type: none;
    background-color: #343a40;
    border-radius: 5px;
    overflow: hidden;
}

.pagination li {
    margin: 0;
}

.pagination a {
    display: block;
    padding: 8px 16px;
    color: #e9ecef;
    text-decoration: none;
    border-right: 1px solid #495057;
    transition: background-color 0.2s;
}

.pagination li:last-child a {
    border-right: none;
}

.pagination li.active a {
    background-color: #3498db;
    color: white;
}

.pagination a:hover {
    background-color: #495057;
}

/* Adapt badges for log types */
.badge-system {
    background-color: #6c757d;
    color: white;
}

.badge-telegram {
    background-color: #0088cc;
    color: white;
}

.badge-database {
    background-color: #9b59b6;
    color: white;
}

.badge-authentication {
    background-color: #e67e22;
    color: white;
}

/* No logs message */
.no-logs-message {
    text-align: center;
    padding: 30px;
    font-size: 1.1rem;
    color: #adb5bd;
}

/* Styles pour la section maintenance */
.maintenance-section {
    padding: 15px;
    border-radius: 6px;
    background-color: #343a40;
    margin-bottom: 15px;
}

.maintenance-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #f8f9fa;
}

.warning-text {
    color: #e74c3c;
    font-size: 0.95rem;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
}

.warning-text i {
    margin-right: 8px;
    margin-top: 3px;
}

/* Styles pour la modal de confirmation */
.modal-body {
    padding: 15px 20px;
}

.modal-body ul {
    padding-left: 20px;
    margin: 10px 0 15px;
}

.modal-body ul li {
    margin-bottom: 5px;
    color: #e9ecef;
}

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

.confirmation-input {
    margin-top: 20px;
}

.confirmation-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Styles pour les badges spéciaux dans l'historique */
.TRANSFERRED, 
span.TRANSFERRED,
td span.TRANSFERRED,
.badge.TRANSFERRED,
.badge.bg-success[data-status="transferred"],
span[data-status="transferred"],
.bg-success[data-status="transferred"],
.badge.bg-success,
span.badge.bg-success,
.badge-success,
.badge.badge-success,
span.badge.badge-success,
[class*="success"] {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Correction spécifique pour les badges avec le texte "transferred" */
.badge:not(.bg-danger):not(.badge-danger):contains("transferred"),
.badge:not(.bg-danger):not(.badge-danger):contains("TRANSFERRED"),
.badge:not(.bg-danger):not(.badge-danger):contains("Transféré") {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Règle spécifique qui cible badge-danger contenant "transferred" pour le forcer en vert */
.badge.badge-danger,
span.badge.badge-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

/* Priorité absolue pour le badge spécifique */
span.badge.badge-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

/* Cible spécifique pour le badge rouge avec le texte transferred */
.badge.badge-danger:has(> span:contains("TRANSFERRED")),
.badge.badge-danger[data-status="transferred"] {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Pour assurer une compatibilité avec plus de navigateurs */
.badge[class*="danger"][data-content="transferred"],
.badge[class*="danger"][data-content="TRANSFERRED"],
.badge[class*="danger"][data-content="Transféré"] {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Styles pour régler le problème spécifique - approche simple */
.badge.badge-danger:contains("TRANSFERRED") {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Nouvelle règle pour spécifiquement cibler le badge dans l'image */
span.badge.badge-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

/* Créer une nouvelle classe à utiliser dans le JavaScript */
.status-transferred {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Styles pour corriger l'affichage des badges Bootstrap */
span.badge {
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

/* S'assurer que tous les badges dans les tableaux sont bien formatés */
table td span.badge {
    display: inline-block;
    padding: 0.3em 0.6em;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    font-weight: 600;
    border-radius: 4px;
}

/* Styles améliorés pour les modales Bootstrap */
.modal-header, .modal-footer {
    background-color: #212529;
    border-color: #495057;
}

.modal-header .modal-title {
    color: #e9ecef;
}

.modal-header .btn-close {
    color: #e9ecef;
    background-color: transparent;
    opacity: 0.7;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

/* Styles pour les tables */
.table {
    color: #e9ecef;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #212529;
}

.table-striped > tbody > tr:nth-of-type(even) {
    background-color: #2c3034;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

/* Style pour les textes dans les tableaux */
.table td {
    color: #ffffff;
}

/* Style pour les boutons dans une table */
.table .btn {
    margin: 2px;
}

/* Style pour les icônes dans une table */
.table .fas {
    margin-right: 5px;
}

.table td .text-success,
.table td .text-danger,
.table td .text-warning,
.table td .text-info {
    font-weight: 500;
}

/* Style pour les statistiques dans le tableau des scénarios */
.table td .d-flex div {
    color: #ffffff;
    font-weight: 500;
}

.text-success {
    color: #2ecc71 !important;
}

.text-danger {
    color: #e74c3c !important;
}

.text-warning {
    color: #f39c12 !important;
}

.text-info {
    color: #3498db !important;
}

.text-white {
    color: #ffffff !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

/* Style pour améliorer la visibilité dans les tableaux */
.table td.text-white {
    color: #ffffff !important;
    opacity: 1;
}

/* Styles pour les animations sur la page des scénarios */
.table tr {
    transition: all 0.3s ease;
}

.table tr:hover td {
    background-color: rgba(52, 152, 219, 0.1);
}

.table tr.removed {
    animation: row-remove 0.5s ease forwards;
}

@keyframes row-remove {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Styles améliorés pour les boutons */
.btn-sm {
    transition: all 0.2s ease;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-sm:active {
    transform: translateY(0);
}

/* Styles pour les boutons d'action */
.table .btn {
    margin: 2px;
    position: relative;
    overflow: hidden;
}

.table .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.table .btn:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Animations pour les notifications */
.toast {
    animation: toast-in-right 0.5s ease;
}

@keyframes toast-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Style pour les boutons en cours de traitement */
.btn.processing {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #495057;
    border-color: #495057;
    color: white;
    pointer-events: none;
}

.btn.processing .fa-spinner {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style pour la mise en évidence des éléments actifs */
.highlight-row {
    animation: highlight-fade 2s ease;
}

@keyframes highlight-fade {
    0% { background-color: rgba(52, 152, 219, 0.3); }
    100% { background-color: transparent; }
}

/* Créer une classe spécifique pour les badges rouges */
.badge.badge-danger.badge-transferred {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Styles pour les badges dans les statuts */
.TRANSFERRED, 
.status-transferred {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Règle spécifique pour forcer le changement de couleur sur le badge de statut "transferred" */
#transferred-badge {
    background-color: #2ecc71 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

/* Correction des modales Bootstrap */
.modal-backdrop {
    --bs-backdrop-zindex: 1040 !important;
    --bs-backdrop-opacity: 0.5 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--bs-backdrop-zindex);
}

.modal-backdrop.show {
    opacity: var(--bs-backdrop-opacity);
}

.modal {
    --bs-modal-zindex: 1045 !important;
    z-index: var(--bs-modal-zindex);
}

.modal-dialog {
    pointer-events: auto;
}

/* Pour s'assurer que le contenu à l'intérieur de la modal est cliquable */
.modal-content {
    position: relative;
    z-index: calc(var(--bs-modal-zindex) + 10);
    pointer-events: auto;
}

/* Pour s'assurer que les boutons dans les modales sont bien cliquables */
.modal-footer .btn,
.modal-header .btn-close,
.modal-body input,
.modal-body textarea,
.modal-body select,
.modal-body button {
    position: relative;
    z-index: calc(var(--bs-modal-zindex) + 15);
    pointer-events: auto;
}

/* Correction de la couleur du texte dans les inputs des modales */
.modal-body input,
.modal-body textarea,
.modal-body select,
.modal-content input,
.modal-content textarea,
.modal-content select {
    color: #fff !important;
    background-color: #333 !important;
    border-color: #555 !important;
}

.modal-body input::placeholder,
.modal-body textarea::placeholder,
.modal-body select::placeholder,
.modal-content input::placeholder,
.modal-content textarea::placeholder,
.modal-content select::placeholder {
    color: #aaa !important;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus,
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.modal-body label,
.modal-content label {
    color: #fff !important;
}

/* Styles pour les options radio améliorées */
.radio-option {
    display: flex;
    align-items: center;
    margin: 10px 0;
    position: relative;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    line-height: 24px;
}

.radio-option label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + label:before {
    border-color: #3498db;
    background-color: #fff;
}

.radio-option input[type="radio"]:checked + label:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3498db;
    transition: all 0.3s ease;
}

.radio-option:hover label:before {
    border-color: #3498db;
}

/* Styles pour les toggles */
.toggle-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.toggle-container input[type="checkbox"] {
    height: 0;
    width: 0;
    opacity: 0;
    position: absolute;
}

.toggle-label {
    cursor: pointer;
    width: 50px;
    height: 26px;
    background: #ccc;
    display: block;
    border-radius: 100px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-label:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-container input:checked + .toggle-label {
    background: #3498db;
}

.toggle-container input:checked + .toggle-label:after {
    left: calc(100% - 3px);
    transform: translateX(-100%);
}

.toggle-text {
    margin-left: 10px;
    font-weight: 500;
}

/* Styles pour les QR codes et 2FA */
.qr-container {
    margin: 20px 0;
    padding: 20px;
    background: #343a40;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #495057;
}

#qrcode {
    margin: 0 auto;
    max-width: 200px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#qrcode canvas,
#qrcode img {
    display: block;
    margin: 0 auto;
    background: white;
}

.manual-setup {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #495057;
}

.secret-key-container {
    display: flex;
    max-width: 400px;
    margin: 15px auto;
}

.secret-key-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #495057;
    border-radius: 4px 0 0 4px;
    font-family: monospace;
    font-size: 14px;
    background: #212529;
    color: #e9ecef;
}

.verification-container {
    margin-top: 20px;
}

.verification-input {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

#verification-code {
    text-align: center;
    font-size: 18px;
    letter-spacing: 2px;
    max-width: 150px;
}

/* Améliorations modal */
.modal-content {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .verification-input {
        flex-direction: column;
    }
    
    #verification-code {
        max-width: 100%;
    }
    
    .secret-key-container {
        max-width: 100%;
    }
}

/* Styles pour le menu responsive */
@media (max-width: 1200px) {
    .navbar {
        flex-direction: column;
        padding: 0;
        align-items: stretch;
        position: relative;
    }
    
    .navbar-logo {
        width: 100%;
        padding: 10px 15px;
        min-width: auto;
        display: flex;
        justify-content: space-between;
    }
    
    .navbar-controls {
        position: absolute;
        top: 10px;
        right: 15px;
        padding: 0;
    }
    
    .username-badge {
        display: none;
    }
    
    .logout-badge {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-items {
        flex-direction: column;
        width: 100%;
        display: none;
        padding: 0;
        background-color: #232629;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }
    
    .nav-items.show {
        display: flex;
        animation: slide-down 0.3s ease-out;
    }
    
    @keyframes slide-down {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-link {
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
        text-align: left;
        transition: background-color 0.2s;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .nav-link.active {
        background-color: rgba(52, 152, 219, 0.2);
    }
    
    .user-info {
        flex-direction: column;
        margin: 0;
        width: 100%;
        padding: 10px 15px;
        background-color: #1a1d20;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        display: none;
        align-items: center;
    }
    
    .nav-items.show + .user-info {
        display: flex;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .username {
        margin-bottom: 15px;
        margin-right: 0;
        text-align: center;
        font-size: 0.95rem;
    }
    
    .logout-button {
        width: auto;
        display: inline-block;
        text-align: center;
        padding: 6px 10px;
        border-radius: 4px;
        transition: background-color 0.2s;
        font-size: 0.85rem;
        margin: 5px 0;
    }
    
    .logout-button:hover {
        background-color: rgba(231, 76, 60, 0.7);
        color: white;
        text-decoration: none;
    }
    
    main {
        padding: 15px 10px;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 8px 12px;
    }
    
    .navbar-controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .username-badge {
        font-size: 0.85rem;
        padding: 3px 6px;
    }
}

/* Styles pour les tableaux responsives */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 15px 10px;
    }
    
    .btn-sm {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Styles pour les très petits écrans */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .navbar-logo a {
        font-size: 1.1rem;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .navbar-controls {
        gap: 8px;
    }
    
    .username-badge {
        font-size: 0.8rem;
        padding: 2px 5px;
    }
    
    .logout-badge {
        width: 28px;
        height: 28px;
    }
    
    .notifications {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Styles pour les contrôles utilisateur */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-right: 10px;
}

.username-badge {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 3px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: rgba(231, 76, 60, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(231, 76, 60, 0.3);
    transition: all 0.2s ease;
}

.logout-badge:hover {
    background-color: rgba(231, 76, 60, 0.7);
    color: white;
    text-decoration: none;
}

/* Ajout du style pour le bouton toggle du menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    width: 48px;
    height: 48px;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Style pour le QR code */
.qr-container {
    text-align: center;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    max-width: 300px;
}

#qrcode img {
    margin: 0 auto;
    display: block;
}

/* Message d'erreur */
.error-message {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --border-color: #404040;
    --bg-color: #2c3034;
    --text-color: #e9ecef;
    --text-color-secondary: #adb5bd;
} 