body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding-top: 60px; /* Espace pour la top-nav fixe */
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card {
    background-color: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1rem 1.5rem;
    background-color: var(--card-header-bg);
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.card-body {
    padding: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Header / Top Navigation */
.top-nav {
    background-color: var(--bg-secondary-color);
    padding: 0 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.top-nav .nav-links a {
    margin: 0 1rem;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.impersonation-banner {
    background-color: #ffc107; /* Jaune alerte */
    color: #333;
    padding: 10px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1050; /* Au-dessus de la plupart des éléments */
    border-bottom: 2px solid #e0a800;
}

.impersonation-banner .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.impersonation-banner p {
    margin: 0;
    font-weight: 500;
}

.impersonation-banner .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.impersonation-banner .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Ajuster le corps de la page si la bannière est présente */
body.impersonating {
    padding-top: 50px; /* Hauteur approximative de la bannière */
}

/* Style pour la cloche de notifications */
.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell .fa-bell {
    font-size: 1.5rem;
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    display: none; /* Affiché par JS */
    animation: bounceIn 0.5s;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.notification-panel {
    position: absolute;
    top: 150%;
    right: 0;
    width: 350px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1100;
}

.notification-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 12px 15px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f9f9f9;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item .notification-content p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.notification-item .notification-content small {
    font-size: 0.75em;
    color: #888;
}

/* Community Page Styles */
.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.domain-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.domain-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.domain-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.domain-info h2 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
}

.domain-info p {
    font-size: 0.9em;
    color: #666;
    flex-grow: 1;
}

.domain-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #555;
}

/* Forum Table Styles */
.forum-table .forum-column-title {
    width: 60%;
}
.forum-table .forum-column-stats {
    width: 15%;
    text-align: center;
}
.forum-table .forum-column-activity {
    width: 25%;
}

.forum-table .thread-title {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}
.forum-table .thread-author {
    font-size: 0.8em;
    color: #777;
}

/* Thread/Post Styles */
.thread-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    display: flex;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.post-author {
    flex-basis: 150px;
    padding: 20px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    background-color: #f9f9f9;
}

.author-avatar {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 10px;
}

.author-name {
    font-weight: 600;
}

.post-content {
    flex-grow: 1;
    padding: 20px;
}

.post-meta {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.post-body {
    line-height: 1.6;
}

.theme-switcher {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 15px;
    display: flex;
    align-items: center;
}

[data-theme="light"] .theme-switcher .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-switcher .fa-moon {
    display: none;
}

/* Système de Vue Liste/Grille */
.view-switcher .btn {
    padding: 0.5rem 0.75rem;
    text-transform: none;
    letter-spacing: 0;
}

.view-switcher .btn.active {
    background-color: var(--primary-color);
    color: #fff;
}

.grid-view {
    display: none; /* Caché par défaut */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.view-grid .grid-view {
    display: grid;
}

.view-grid .table-view {
    display: none;
}

.ticket-card {
    transition: all 0.3s ease;
}

.ticket-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.badge {
    padding: 0.4em 0.7em;
    border-radius: 0.25rem;
    font-size: 85%;
    font-weight: 600;
}

.badge-ouvert { background-color: #28a745; color: white; }
.badge-en_cours { background-color: #ffc107; color: #212529; }
.badge-ferme { background-color: #6c757d; color: white; }

/* Vue Kanban */
.kanban-board {
    display: none;
    grid-template-columns: repeat(4, 1fr); /* 4 colonnes pour les statuts */
    gap: 1.5rem;
}

.view-grid .kanban-board {
    display: grid;
}

.kanban-column {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1rem;
}

.kanban-column h4 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.kanban-tasks {
    min-height: 200px; /* Espace pour le drag-and-drop futur */
}

.task-card {
    margin-bottom: 1rem;
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-muted-color);
    display: flex;
    justify-content: space-between;
}

/* Page des Actifs */
.asset-card {
    transition: all 0.2s ease-in-out;
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Styles pour GridStack Dashboard */
.grid-stack {
    background: var(--bg-color);
}

.grid-stack-item-content {
    background: var(--bg-secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 1rem;
    overflow: auto !important; /* Pour permettre le scroll dans les widgets */
}

/* Style de la poignée de redimensionnement pour qu'elle soit visible dans les deux thèmes */
.ui-resizable-handle {
    filter: invert(0.8);
}

/* Styles pour les listes de widgets */
.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list .event-date {
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-right: 1rem;
    font-weight: 600;
}

/* Page des Tarifs (Pricing) */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pricing-card {
    border: 2px solid var(--border-color);
    text-align: center;
}

.pricing-card.recommended {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pricing-card .card-header {
    position: relative;
}

.pricing-card .badge-recommended {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card .price {
    margin: 1.5rem 0;
}

.pricing-card .price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.pricing-card .price-period {
    font-size: 1rem;
    color: var(--text-muted-color);
}

.features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list .fa-check {
    color: #28a745;
    margin-right: 0.5rem;
}

.features-list .fa-times {
    color: #dc3545;
    margin-right: 0.5rem;
}

/* Page d'Aide */
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.help-card {
    text-align: center;
    transition: all 0.3s ease;
}

.help-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.help-card i {
    color: var(--primary-color);
}

/* Bandeau de Consentement aux Cookies */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    z-index: 1100;
    display: none; /* Caché par défaut */
    border-top: 1px solid var(--border-color);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-content p {
    margin: 0;
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

/* Aide Contextuelle */
.contextual-help {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 15px;
    display: flex;
    align-items: center;
    color: var(--text-muted-color);
    transition: color 0.2s ease;
}

.contextual-help:hover {
    color: var(--primary-color);
}

#help-modal .modal-content {
    background-color: var(--bg-secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#help-modal .modal-header {
    border-bottom: 1px solid var(--border-color);
}

.user-menu {
    position: relative;
    cursor: pointer;
}

.user-menu .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-secondary-color);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid var(--border-color);
}

.user-menu:hover .dropdown-content {
    display: block;
}

.user-menu .dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.user-menu .dropdown-content a:hover {
    background-color: var(--bg-color);
}
