* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    height: 100%;
}

.editor-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.editor-header {
    padding: 0.5rem 1rem;
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

.editor-header h1 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-controls .control-button {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    height: fit-content;
    width: 100%;
    background-color: #f5f5f5;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.control-group h3 {
    color: #ecf0f1;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.control-button {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    height: 32px;
    display: flex;
    align-items: center;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 2px;
    white-space: nowrap;
    gap: 8px;
}

.control-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.control-button:active {
    transform: translateY(1px);
}

.control-button i {
    flex-shrink: 0;
}

.control-button span {
    flex: 1;
}

.editor-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: calc(100vh - 200px); /* Hauteur totale moins l'espace pour le header et les contrôles */
    overflow-y: auto;
}

.input-section, .preview-section {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#input-text, #output-text {
    width: 100%;
    height: 100%;
    padding: 1rem;
    border: none;
    resize: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    line-height: 1.6;
    background: transparent;
}

#input-text:focus {
    outline: none;
}

#output-text {
    background-color: #f8f9fa;
}

/* Styles pour les boutons spécifiques */
#undo, #redo {
    padding: 0.5rem;
    min-width: 40px;
    justify-content: center;
}

/* Animation pour les boutons */
.control-button.copied {
    background-color: #2ecc71;
    animation: pulse 0.5s;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .editor-content {
        grid-template-columns: 1fr;
    }
    
    .editor-controls {
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
    }
    
    .button-group {
        width: 100%;
        justify-content: space-between;
    }
}

.active-section {
    width: 100%;
    flex-shrink: 0; /* Empêche la textarea de rétrécir */
}

.textarea-container {
    position: relative;
    width: 100%;
}

.textarea-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #4a90e2;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.textarea-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.copy-button, .save-button {
    padding: 8px;
    background-color: #4a90e2;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.copy-button:hover, .save-button:hover {
    opacity: 1;
    background-color: #357abd;
}

.copy-button.copied {
    background-color: #2ecc71;
    animation: pulse 0.5s;
}

.save-button.saved {
    background-color: #2ecc71;
    animation: pulse 0.5s;
}

.history-section {
    width: 100%;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    flex-shrink: 0; /* Empêche la section historique de rétrécir */
}

.history-section.hidden {
    display: none;
}

.history-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.history-item:hover {
    background: #e9ecef;
    border-color: #4a90e2;
    transform: translateX(5px);
}

.history-item .timestamp {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.history-item .preview {
    margin-top: 5px;
    font-family: monospace;
    font-size: 13px;
    color: #495057;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 80px;
    max-height: 100px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

/* Style de la scrollbar pour l'aperçu */
.history-item .preview::-webkit-scrollbar {
    width: 6px;
}

.history-item .preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-item .preview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-item .preview::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Style de la scrollbar pour l'historique */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Style de la scrollbar pour editor-content */
.editor-content::-webkit-scrollbar {
    width: 8px;
}

.editor-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Styles pour le système d'onglets */
.tabs-container {
    display: flex;
    height: 100%;
    width: 100%;
    background-color: #f5f5f5;
}

.tabs-list {
    width: 200px;
    background-color: #e0e0e0;
    padding: 10px 0;
    border-right: 1px solid #ccc;
}

.tab-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s;
    color: #666;
    gap: 10px;
}

.tab-button i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.tab-button span {
    flex: 1;
}

.tab-button:hover {
    background-color: #d0d0d0;
}

.tab-button.active {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
    border-left: 3px solid #007bff;
}

.tabs-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
} 