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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: #2d2d30;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e42;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

header h1 {
    font-size: 24px;
    color: #ffffff;
}

.execution-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #007acc;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    transition: transform 0.2s;
}

.execution-counter:hover {
    transform: scale(1.05);
}

.counter-icon {
    font-size: 16px;
}

#counterValue {
    font-weight: 700;
    font-size: 15px;
}

.counter-label {
    opacity: 0.9;
    font-size: 12px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

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

.editor-header {
    background: #2d2d30;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e42;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor {
    flex: 1;
    overflow: hidden;
}

.right-panel {
    width: 45%;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

.tabs {
    display: flex;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #d4d4d4;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: #37373d;
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #007acc;
}

.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

.output-header {
    background: #2d2d30;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e42;
}

.output-area, .terminal-area, .debug-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-area {
    color: #00ff00;
}

.terminal-input {
    display: flex;
    align-items: center;
    background: #2d2d30;
    padding: 10px 15px;
    border-top: 1px solid #3e3e42;
}

.terminal-prompt {
    color: #00ff00;
    margin-right: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.terminal-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    outline: none;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

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

.btn-secondary {
    background: #3e3e42;
    color: #d4d4d4;
}

.btn-secondary:hover {
    background: #505053;
}

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

.btn-share:hover {
    background: #10624a;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.btn-icon:hover {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #2d2d30;
    padding: 0;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 20px;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #d4d4d4;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-modal:hover {
    background: #3e3e42;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.package-install {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.package-install input {
    flex: 1;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    font-size: 14px;
}

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

.package-list h3 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 16px;
}

.packages-list-content {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.package-item {
    padding: 8px;
    border-bottom: 1px solid #3e3e42;
    color: #d4d4d4;
    font-size: 14px;
}

.package-item:last-child {
    border-bottom: none;
}

.package-output {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

.error {
    color: #f48771;
}

.success {
    color: #89d185;
}

.share-link {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.share-link input {
    width: 100%;
    padding: 10px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    font-size: 14px;
    margin-top: 10px;
}

.share-link button {
    margin-top: 10px;
}

.save-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.save-form input {
    flex: 1;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    font-size: 14px;
}

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

.modal-large {
    max-width: 800px;
}

.saved-codes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.saved-code-item {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.saved-code-item:hover {
    background: #252526;
    border-color: #007acc;
}

.saved-code-info {
    flex: 1;
}

.saved-code-title {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.saved-code-meta {
    font-size: 12px;
    color: #858585;
}

.saved-code-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.fork-badge {
    display: inline-block;
    background: #3e3e42;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #d4d4d4;
    margin-left: 8px;
}
