/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

/* Container principal */
.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #2d2d2d;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e3e;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #007acc;
    margin: 0;
}

.title-input {
    background: #1e1e1e;
    border: 1px solid #3e3e3e;
    color: #d4d4d4;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    width: 250px;
    font-size: 0.9rem;
}

.title-input:focus {
    outline: none;
    border-color: #007acc;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

/* Boutons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-run {
    background: #16825d;
    color: white;
}

.btn-run:hover {
    background: #1a9b6d;
}

.btn-save {
    background: #007acc;
    color: white;
}

.btn-save:hover {
    background: #005a9e;
}

.btn-new {
    background: #4a4a4a;
    color: white;
}

.btn-new:hover {
    background: #5a5a5a;
}

/* Container éditeur */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Éditeurs */
.editors {
    display: flex;
    height: 50%;
    border-bottom: 1px solid #3e3e3e;
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3e3e3e;
}

.editor-panel:last-child {
    border-right: none;
}

.editor-header {
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    border-bottom: 1px solid #3e3e3e;
}

.code-editor {
    flex: 1;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    tab-size: 2;
}

.code-editor:focus {
    outline: none;
    background: #252526;
}

/* Preview */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.preview-header {
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    border-bottom: 1px solid #3e3e3e;
}

.preview-frame {
    flex: 1;
    border: none;
    background: white;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2d2d2d;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    max-width: 400px;
}

.notification.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #16825d;
}

.notification.error {
    background: #c9302c;
}

.notification .url {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .editors {
        flex-direction: column;
    }
    
    .editor-panel {
        border-right: none;
        border-bottom: 1px solid #3e3e3e;
    }
    
    .title-input {
        width: 150px;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3e3e3e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* Syntax highlighting hints (visual) */
.code-editor::placeholder {
    color: #5a5a5a;
    font-style: italic;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: ' ...';
    animation: dots 1s infinite;
}

@keyframes dots {
    0%, 20% { content: ' .'; }
    40% { content: ' ..'; }
    60%, 100% { content: ' ...'; }
}
