/* Executor Styles */
.executor-container {
    position: relative;
    max-width: 600px;
    width: 100%;
}

.executor-window {
    background: var(--dark-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    animation: slideInUp 1s ease 0.5s both;
}

.executor-window:hover {
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
    border-color: var(--primary);
}

.executor-header {
    background: var(--dark-lighter);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control.close {
    background: #ff5f56;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #27ca3f;
}

.control:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.executor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.executor-title i {
    color: var(--primary);
}

.executor-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--success);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.executor-toolbar {
    background: var(--dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1px;
    overflow-x: auto;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: max-content;
    position: relative;
}

.tool-btn:hover,
.tool-btn.active {
    background: var(--primary);
    color: white;
}

.tool-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.executor-content {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.code-editor {
    flex: 2;
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--dark);
}

.line-numbers {
    background: var(--dark-light);
    border-right: 1px solid var(--border);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    user-select: none;
    min-width: 40px;
}

.line-numbers span {
    line-height: 1.5;
    margin-bottom: 0;
}

.code-area {
    flex: 1;
    position: relative;
}

#code-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 1rem;
    resize: none;
    line-height: 1.5;
}

#code-input::placeholder {
    color: var(--text-muted);
}

.output-panel {
    flex: 1;
    background: var(--dark-card);
    border-top: 1px solid var(--border);
}

.panel-header {
    background: var(--dark-light);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.clear-output {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.clear-output:hover {
    background: var(--error);
    color: white;
}

.output-content {
    height: calc(100% - 40px);
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.5rem;
}

.output-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.output-line.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.output-line.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.output-line.info {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.timestamp {
    color: var(--text-muted);
    font-weight: 600;
    min-width: fit-content;
}

.message {
    flex: 1;
}

.executor-footer {
    background: var(--dark-lighter);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ping {
    color: var(--success);
    font-weight: 600;
}

/* Code Syntax Highlighting */
.code-highlight {
    color: var(--primary);
}

.code-string {
    color: var(--success);
}

.code-comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-keyword {
    color: var(--secondary);
    font-weight: 600;
}

.code-function {
    color: var(--accent);
}

/* Script Library Modal */
.script-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.script-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--dark-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.modal-header {
    background: var(--dark-lighter);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.script-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.script-card {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.script-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.script-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.script-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.script-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.script-tag {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .executor-container {
        max-width: 100%;
    }
    
    .executor-content {
        height: 300px;
    }
    
    .executor-toolbar {
        padding: 0;
    }
    
    .tool-btn {
        font-size: 0.7rem;
        padding: 0.5rem 0.75rem;
    }
    
    .footer-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .script-grid {
        grid-template-columns: 1fr;
    }
}