/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* Styles pour la page de connexion */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2575fc;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Styles pour le tableau de bord */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content {
    flex: 1;
    padding: 20px;
    margin-left: 250px;
    background-color: #f5f5f5;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Styles pour les tableaux */
.items-table-container {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table td.editable {
    cursor: pointer;
}

.table td.editable:hover {
    background-color: #f0f7ff;
}

.table .actions {
    display: flex;
    gap: 5px;
}

/* Styles pour la pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Styles pour les formulaires */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row.checkboxes {
    flex-wrap: wrap;
}

.form-row.checkboxes .form-group {
    flex: 0 0 auto;
    margin-right: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group.checkbox label {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="checkbox"] {
    width: auto;
}

/* Styles pour les boutons */
.btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: #e9ecef;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    color: #495057;
    transition: background-color 0.3s, color 0.3s;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-primary {
    background-color: #2575fc;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1a5dca;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Styles pour les modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    max-width: 600px;
    width: 90%;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalOpenAnimation 0.3s;
}

@keyframes modalOpenAnimation {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal .close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.modal .close:hover {
    color: #333;
}

/* Styles pour l'aperçu du code */
.preview-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

pre#preview-code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    overflow: auto;
    max-height: 500px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Styles pour les imports/exports */
.import-container,
.export-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.import-form {
    margin-top: 10px;
}

.export-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Styles pour la recherche */
.search-container {
    position: relative;
    width: 300px;
}

#search-items {
    padding-right: 30px;
}

#clear-search {
    position: absolute;
    right: 5px;
    top: 5px;
    background: none;
    border: none;
    font-size: 16px;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
}

/* Styles pour les alertes */
#alert-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .content {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .section-actions {
        width: 100%;
    }
    
    .search-container {
        width: 100%;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }
}