/* Variables CSS */
:root {
    --primary-color: #004a99;
    --primary-dark: #2196F3;
    --success-color: #4CAF50;
    --success-dark: #45a049;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #777;
    --background: #f4f4f4;
    --border-color: #ddd;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Styles généraux */
body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: row;
}
/* Conteneur principal */
.container {
    display: flex;
    min-height: 100vh;
}

/* Barre latérale */
.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    text-align: left;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar.hide {
    transform: translateX(-100%);
}

.sidebar h2 {
    text-align: left;
    color: rgb(125, 123, 123);
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin: 15px 0;
}

.sidebar ul li a {
    display: block;
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar ul li a:hover {
    background: #003366;
}
/* Contenu principal */
.content {
    flex-grow: 1;
    padding: 40px;
    text-align: left;
    margin-left: 270px;
}
.content p {
    text-align: left;
    margin-bottom: 30px;
}

/* Boutons */
button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--primary-dark);
}

.green_button {
    background-color: var(--success-color);
}

.green_button:hover {
    background-color: var(--success-dark);
}

/* Formulaires */
.form, .formuser {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: auto;
}

.form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: fadein 0.5s;
}

@keyframes fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styles utilisateur */
.rosemere-info {
    font-size: 20px;
    color: rgb(222, 38, 38);
    text-align: left;
    margin-bottom: -10px;
}

.user-info, .user-infologin {
    font-size: 15px;
    color: var(--text-muted);
    text-align: left;
    margin: 15px 0 -10px 0;
    background-color: transparent;
}
input, textarea, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0; /* Replace margin-top with margin to balance spacing */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
}

/* Correction pour la barre latérale sur mobile */
@media (max-width: 768px) {
    /* S'assurer que le conteneur prend toute la largeur */
    .container {
        width: 100%;
        margin-left: 0;
    }
    
    /* Ajuster la position de la barre latérale */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Ajuster la marge du contenu principal */
    .content {
        margin-left: 0 !important;
        padding: 15px !important;
        width: 100% !important;
    }
    
    /* Style pour le bouton hamburger */
    .hamburger {
        display: block !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 10px;
        font-size: 20px;
        cursor: pointer;
    }
    .welcome-section p {
        display: none;
    }
}

    .form, .formuser {
        padding: 15px;
        margin: 20px auto;
        width: 90%;
    }

    .sidebar ul li a {
        font-size: 16px;
        padding: 8px;
        color: var(--text-color);
    }

    .rosemere-info {
        font-size: 18px;
    }

    .user-info {
        font-size: 13px;
    }

@media (max-width: 600px) {
    h1, h2 {
        font-size: 20px;
    }

    .content {
        padding: 15px;
    }

    .sidebar h2 {
        font-size: 18px;
    }

    ul {
        padding-left: 1rem;
    }

    input, textarea, select, button {
        font-size: 14px;
    }
}

/* Imprimer */
@media print {
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
    }

    body * {
        visibility: hidden;
    }

    .printable, .printable * {
        visibility: visible;
    }

    .printable {
        position: relative;
        margin: 0;
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }

    th, td {
        word-wrap: break-word;
        font-size: 10px;
    }

    .content h3 {
        font-size: 14px;
        margin-top: 10px;
        page-break-before: always;
    }

    .content h2 {
        display: none;
    }

    .sidebar, .print-button {
        display: none;
    }

    .content {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Classes utilitaires */
.small-input {
    width: 200px;
}

.medium-input {
    width: 400px;
}

/* Chatbox Styles - Professional Version */
#chatbox-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    max-height: 500px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#chatbox-header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
    background-color: #f9f9f9;
}

.message {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
}

.message strong {
    color: #2c3e50;
    margin-right: 5px;
}

.chatbox-input {
    display: flex;
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
    outline: none;
    font-size: 14px;
}

#send-button {
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

#send-button:hover {
    background-color: #1a252f;
}

/* Message styles */
.message.self {
    margin-left: auto;
    background-color: #e8f4fc;
    border-bottom-right-radius: 0;
}

.message.other {
    margin-right: auto;
    border-bottom-left-radius: 0;
    color: #34495e;
}

.message a {
    color: #3498db;
    text-decoration: none;
}

.message a:hover {
    text-decoration: underline;
}

@keyframes newMessage {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.message.new {
    animation: newMessage 0.3s ease-out;
}

.connection-status {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
    text-align: right;
}

.connection-status.connected {
    color: #27ae60;
}

.connection-status.disconnected {
    color: #e74c3c;
}