/* Styles généraux pour toutes les pages */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #36a93e;
}

.container {
    max-width: 90%;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Styles pour les galeries et les cartes SVG */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.svg-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
    position: relative; /* Clé pour le positionnement des boutons */
}

.svg-card:hover {
    transform: translateY(-5px);
}

.svg-card a {
    text-decoration: none;
    color: inherit;
}

.svg-container {
    position: relative;
    width: 100%;
    height: 200px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dae9f6; /* Bleu très clair */
}

.svg-container svg {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #ddd;
    display: block;
}

.info {
    padding: 15px;
    border-top: 1px solid #eee;
}

.info h3 {
    margin: 0 0 5px;
    color: #0056b3;
    font-size: 1.2em;
}

.info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

/* Styles de la pagination et des contrôles */
.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination a, .pagination a:hover, .pagination button {
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    border-radius: 5px;
}

.pagination a:hover {
    background-color: #ddd;
}

.pagination span {
    padding: 8px 16px;
    margin: 0 5px;
    color: #555;
}

/* Styles pour les contrôles de la galerie */
.controls {
    display: flex;
    justify-content: center; /* Conserve votre alignement central */
    align-items: flex-start; /* Aligne les éléments en haut */
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap; /* Permet le retour à la ligne sur les petits écrans */
}

.controls-block {
    display: flex;
    align-items: center; /* Aligne les éléments verticalement */
    gap: 10px;
}

/* Styles pour le formulaire de recherche */
.search-form {
    display: flex;
    align-items: center; /* Aligne les éléments du formulaire verticalement */
    gap: 10px;
}

.search-form input[type="text"] {
    width: 150px; /* Réduction de la largeur pour un meilleur affichage */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-form button {
    padding: 8px 16px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

/* Styles pour les boutons */
.help-icon {
    cursor: pointer;
    font-size: 1.5em;
    color: #007bff;
    margin-left: 5px;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.help-icon:hover {
    color: #0056b3;
    background-color: #e9ecef;
}

/* Styles pour la modal d'aide à la recherche */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 85%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.add-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: #0056b3;
}

/* Styles pour les messages */
.message.success {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #d4edda;
    color: #155724;
}

.message.error {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #f8d7da;
    color: #721c24;
}

/* Styles pour le bouton de mise sous tension (Connexion/Déconnexion) */
.auth-status {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 20px;
    gap: 10px;
    z-index: 100;
}

.auth-status span {
    font-weight: bold;
    color: #555;
}

.auth-status .header-btn {
    text-decoration: none;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.auth-status .header-btn:hover {
    background-color: #0056b3;
}

.power-button {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.power-button:hover {
    transform: scale(1.1);
}

.power-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-sizing: border-box;
}

.power-button.disconnected {
    background-color: #dc3545; /* Rouge pour Déconnecté */
}

.power-button.disconnected::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 2px;
    height: 12px;
    background-color: #fff;
    transform: translateX(-50%);
}

.power-button.connected {
    background-color: #28a745; /* Vert pour Connecté */
}

/* Styles pour les boutons d'action sur les miniatures (index.php) */
.action-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 2;
}
.action-buttons a {
    font-size: 1.2em;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, transform 0.2s;
}
.download-button {
    background-color: #28a745;
}
.download-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}
.edit-button {
    background-color: #ffc107;
    color: #212529;
    font-size: 1.2em;
}
.edit-button:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}
.delete-button {
    background-color: #dc3545;
}
.delete-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

/* Styles pour les tables d'information (page de détail) */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.info-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.info-table tr:nth-child(even) {
    background-color: #f2f2f2;
}
.info-table td:first-child {
    font-weight: bold;
    width: 30%;
    background-color: #e9ecef;
}

/* Styles pour la page d'inscription et de connexion */
.login-container, .register-container {
    background-color: #fff;
    padding: 30px; /* Réduction du padding pour les petits écrans */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 80%; /* Utilisation d'un pourcentage pour la largeur */
    max-width: 400px; /* Largeur maximale pour les grands écrans */
    text-align: center;
    margin: 50px auto;
}

.login-link, .register-link {
    display: block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Styles pour la vue invité */
.info.guest-blur {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.svg-card:hover .info.guest-blur {
    filter: blur(0);
}

/* Nouvelles règles pour enlever le flou au survol de la souris */
.svg-card:hover .svg-container {
    filter: blur(0);
}

.login-message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0); /* Moins opaque pour voir le dessin */
    color: #333;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 10;
}

.login-message-overlay:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* --- DETAIL & EDIT & ADD PAGE SPECIFIC STYLES --- */
.detail-content, .main-content-grid {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}
.detail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.detail-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative; /* Clé pour le positionnement des boutons */
}
.detail-header h1 {
    margin: 0;
}
.detail-svg-container, .svg-preview-container, .svg-display {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #dae9f6; /* Bleu très clair */
}
.detail-svg-container svg, .svg-preview-container svg, .svg-display svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.back-button, .back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.2s;
}
.back-button:hover, .back-link:hover {
    background-color: #5a6268;
}

/* Form Styling (add.php, edit.php, etc.) */
.form-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}
.form-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-card label {
    font-weight: bold;
    color: #333;
}
.form-card input[type="text"],
.form-card input[type="file"],
.form-card textarea,
.form-card select {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}
.form-card textarea {
    min-height: 100px;
    resize: vertical;
}
.form-card button[type="submit"] {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s;
    align-self: flex-start;
}
.form-card button[type="submit"]:hover {
    background-color: #0056b3;
}
.form-card .cancel-button {
    background-color: #6c757d;
    margin-left: 10px;
}
.form-card .cancel-button:hover {
    background-color: #5a6268;
}
.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
}
.password-strength-meter {
    height: 7px;
    background: #ddd;
    border-radius: 5px;
    margin-top: 5px;
}
.password-strength-meter-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s, background-color 0.3s;
    width: 0;
}
.password-requirements p {
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
}
.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.password-requirements li {
    color: #ff0000;
    font-size: 0.85em;
    padding: 2px 0;
    transition: color 0.3s;
}
.password-requirements li.valid {
    color: #008000;
}
.drop-zone {
    padding: 40px;
    border: 2px dashed #009578;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}
.drop-zone:hover {
    border-color: #007a61;
}
.drop-zone__prompt {
    color: #aaa;
    font-size: 1.2em;
    pointer-events: none;
}
.drop-zone__input {
    display: none;
}

/* Styles pour le bouton de connexion */
.submit-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.submit-btn:hover {
    background-color: #0056b3;
}

/* Conteneur pour les liens en bas */
.links-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Style pour le lien "Mot de passe oublié" */
.forgot-password-link, .register-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover, .register-link:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Correction du style du conteneur de connexion pour qu'il soit bien aligné */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 50px auto;
}

/* Le formulaire doit prendre toute la largeur pour le bon alignement des champs */
.login-container form {
    width: 100%;
}
/* Styles pour le bouton de rafraîchissement */
.refresh-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.2s;
}

.refresh-button:hover {
    background-color: #5a6268;
}