/* Editor Styles */
.editor-section {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px); /* Augmenté pour tenir compte du padding/margin du header */
    background: #1e1e1e;
    color: #fff;
    margin-top: 16px; /* Ajout d'une marge en haut */
}

.editor-header {
    background: #252525;
    padding: 1rem;
    border-bottom: 1px solid #333;
}

.script-info {
    margin-bottom: 1rem;
}

.script-info h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

.description {
    margin: 0.5rem 0 0;
    color: #888;
    font-size: 0.9rem;
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.editor-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0 0.5rem;
    border-right: 1px solid #333;
}

.toolbar-group:last-child {
    border-right: none;
}

.editor-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-sidebar {
    width: 300px;
    background: #252525;
    border-left: 1px solid #333;
    display: none;
    flex-direction: column;
}

.editor-sidebar.active {
    display: flex;
}

.doc-header {
    padding: 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.doc-search {
    margin-bottom: 1rem;
}

.doc-section {
    margin-bottom: 1.5rem;
}

.doc-section h4 {
    color: #ddd;
    margin: 0 0 0.5rem 0;
}

.doc-example {
    background: #1e1e1e;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.doc-example pre {
    margin: 0;
}

.editor-container {
    flex: 1;
    position: relative;
}

#editor {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    font-size: 14px;
    font-family: 'Fira Code', monospace;
}

.output-panel {
    height: 200px;
    background: #252525;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.output-header {
    padding: 0.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    background: none;
    border: none;
    color: #888;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tab:hover {
    background: #333;
    color: #fff;
}

.tab.active {
    background: #444;
    color: #fff;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.output-content {
    flex: 1;
    overflow-y: auto;
    display: none;
    padding: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.output-content.active {
    display: block;
}

.output-status {
    padding: 0.3rem 0.5rem;
    background: #333;
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-item svg {
    width: 14px;
    height: 14px;
}

.input {
    background: #333;
    border: 1px solid #444;
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    min-width: 120px;
}

.input:focus {
    outline: none;
    border-color: #0066cc;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #444;
    color: #fff;
}

.btn-secondary:hover {
    background: #555;
}

.btn-ghost {
    background: none;
    color: #888;
}

.btn-ghost:hover {
    background: #333;
    color: #fff;
}

.btn-icon {
    padding: 0.3rem;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
}

.btn-icon:hover {
    color: #fff;
}

.modified-indicator {
    color: #ffd700;
    font-size: 1.5rem;
    margin: 0 0.5rem;
    visibility: hidden;
}

.modified-indicator.active {
    visibility: visible;
}

/* Output entries styling */
.output-entry {
    margin-bottom: 0.3rem;
}

.output-entry .timestamp {
    color: #666;
    margin-right: 0.5rem;
}

.output-entry .content {
    color: #ddd;
}

.output-entry.error {
    color: #ff6b6b;
}

.output-entry.warning {
    color: #ffd93d;
}

.output-entry.success {
    color: #6bff6b;
}

/* History entries */
.history-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

.history-entry:hover {
    background: #2a2a2a;
}

.history-entry .timestamp {
    font-size: 0.8rem;
    color: #666;
}

/* Problems panel */
.problem-entry {
    padding: 0.5rem;
    border-left: 3px solid;
    margin-bottom: 0.3rem;
}

.problem-entry.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.problem-entry.warning {
    border-color: #ffd93d;
    background: rgba(255, 217, 61, 0.1);
}

/* Documentation styling */
.doc-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-section li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #333;
}

.doc-section code {
    background: #1e1e1e;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #0066cc;
}

/* Editor theme overrides */
.ace_gutter {
    background: #252525 !important;
}

.ace_gutter-cell {
    color: #666 !important;
}

.ace_gutter-active-line {
    background: #333 !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}