/* Multiple Script Exercises - Pygnosis Style */
/* Colors:
   - Background: #010618 (black-color)
   - Primary green: #0CFE25
   - Text: #9AAEC4, #fff
   - Editor background: #0d1525
*/

/* Exercise Content - scoped to avoid conflicts */
/* Note: General exercise styles are inherited from my_new_style.css */

/* Multi-Script Editor Container */
.multi-script-editor-container {
    display: flex;
    margin: 20px 0;
    height: 500px;
    border: 1px solid #0CFE25;
    border-radius: 8px;
    overflow: hidden;
    background-color: #0d1525;
    position: relative;
}

/* Resizer Handle */
.resizer {
    width: 6px;
    background-color: #0CFE25;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s ease;
}

.resizer:hover {
    background-color: #0af020;
}

.resizer::before {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #010618;
    font-size: 14px;
    font-weight: bold;
}

/* File Tree Panel (Left) */
.file-tree-panel {
    width: 280px;
    min-width: 150px;
    max-width: 600px;
    background-color: #0a0f1a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.file-tree-header {
    padding: 16px 15px;
    background-color: #010618;
    border-bottom: 1px solid #0CFE25;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 57px;
    box-sizing: border-box;
}

.project-title {
    color: #0CFE25;
    font-weight: 600;
    font-size: 0.9rem;
}

.file-tree-actions {
    display: flex;
    gap: 8px;
}

.file-action-btn {
    background-color: transparent;
    border: 1px solid #9AAEC4;
    color: #9AAEC4;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.file-action-btn:hover {
    border-color: #0CFE25;
    color: #0CFE25;
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* File Tree Items */
.file-tree-item {
    padding: 8px 10px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 4px;
    color: #9AAEC4;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    justify-content: space-between;
}

.file-tree-item:hover {
    background-color: #1A1F2F;
    color: #fff;
}

.file-tree-item.selected {
    background-color: rgba(12, 254, 37, 0.15);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid #0CFE25;
}

.file-tree-item.folder {
    font-weight: 600;
}

.file-tree-item.file {
    padding-left: 30px;
}

.file-tree-item .icon {
    font-size: 1rem;
}

.file-tree-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.file-tree-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-tree-item:hover .file-tree-item-actions {
    opacity: 1;
}

.folder-menu-btn,
.file-menu-btn {
    background: transparent;
    border: 1px solid #9AAEC4;
    color: #9AAEC4;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.folder-menu-btn:hover,
.file-menu-btn:hover {
    border-color: #0CFE25;
    color: #0CFE25;
}

.delete-btn {
    background-color: #ff4444;
    border: none;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s ease;
}

.delete-btn:hover {
    background-color: #cc0000;
}

/* Context Menu for Folders */
.folder-context-menu {
    position: absolute;
    background-color: #0d1525;
    border: 1px solid #0CFE25;
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.folder-context-menu-item {
    padding: 8px 15px;
    color: #9AAEC4;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-context-menu-item:hover {
    background-color: #1A1F2F;
    color: #0CFE25;
}

.folder-context-menu-item.delete-item {
    color: #ff6b6b;
}

.folder-context-menu-item.delete-item:hover {
    background-color: rgba(255, 68, 68, 0.15);
    color: #ff4444;
}

.folder-context-menu-item .delete-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.folder-context-menu-divider {
    height: 1px;
    background-color: #1A1F2F;
    margin: 5px 0;
}

/* Inline Editing Input */
.inline-edit-input {
    background-color: #010618;
    color: #fff;
    border: 1px solid #0CFE25;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    width: auto;
    min-width: 100px;
    max-width: 180px;
}

.inline-edit-input:focus {
    border-color: #0af020;
    box-shadow: 0 0 4px rgba(12, 254, 37, 0.3);
}

/* Folder Toggle */
.folder-toggle {
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    margin-right: 4px;
}

.folder-children {
    margin-left: 15px;
}

.folder-children.collapsed {
    display: none;
}

/* Code Editor Panel (Right) */
.code-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0d1525;
}

.editor-header {
    padding: 16px 15px;
    background-color: #010618;
    border-bottom: 1px solid #0CFE25;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 57px;
    box-sizing: border-box;
}

.current-file-name {
    color: #0CFE25;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.run-button {
    background-color: #0CFE25;
    color: #010618;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.run-button:hover {
    background-color: #0af020;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(12, 254, 37, 0.3);
}

.run-button:active {
    transform: translateY(0);
}

.run-button:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.code-editor {
    flex: 1;
    background-color: #0d1525;
    color: #50fa7b;
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    resize: none;
    overflow-y: auto;
}

.code-editor:disabled {
    background-color: #0a0f1a;
    color: #555;
    cursor: not-allowed;
}

.code-editor::placeholder {
    color: #555;
    font-style: italic;
}

/* Output Container */
.output-container {
    margin-top: 20px;
    border: 1px solid #0CFE25;
    border-radius: 8px;
    overflow: hidden;
    background-color: #0d1525;
}

.output-header {
    padding: 10px 15px;
    background-color: #010618;
    color: #0CFE25;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #0CFE25;
}

.output-content {
    padding: 15px;
    min-height: 100px;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #9AAEC4;
    line-height: 1.6;
}

.output-content pre {
    color: #50fa7b;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-content .error {
    color: #ff5555;
}

.output-content .success {
    color: #0CFE25;
}

/* Scrollbar Styling */
.file-tree::-webkit-scrollbar,
.code-editor::-webkit-scrollbar,
.output-content::-webkit-scrollbar {
    width: 8px;
}

.file-tree::-webkit-scrollbar-track,
.code-editor::-webkit-scrollbar-track,
.output-content::-webkit-scrollbar-track {
    background: #010618;
}

.file-tree::-webkit-scrollbar-thumb,
.code-editor::-webkit-scrollbar-thumb,
.output-content::-webkit-scrollbar-thumb {
    background: #0CFE25;
    border-radius: 4px;
}

.file-tree::-webkit-scrollbar-thumb:hover,
.code-editor::-webkit-scrollbar-thumb:hover,
.output-content::-webkit-scrollbar-thumb:hover {
    background: #0af020;
}

/* PyGnosis Notification Toast */
.pygnosis-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #0d1525 0%, #1a2332 100%);
    border: 2px solid #ff4444;
    border-radius: 8px;
    padding: 15px 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pygnosis-notification.success {
    border-color: #0CFE25;
}

.pygnosis-notification.error {
    border-color: #ff4444;
}

.pygnosis-notification.warning {
    border-color: #ffa500;
}

.pygnosis-notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pygnosis-notification-content {
    flex: 1;
}

.pygnosis-notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.pygnosis-notification.success .pygnosis-notification-title {
    color: #0CFE25;
}

.pygnosis-notification.error .pygnosis-notification-title {
    color: #ff4444;
}

.pygnosis-notification.warning .pygnosis-notification-title {
    color: #ffa500;
}

.pygnosis-notification-message {
    color: #9AAEC4;
    font-size: 0.85rem;
    line-height: 1.4;
}

.pygnosis-notification-close {
    background: transparent;
    border: none;
    color: #9AAEC4;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.pygnosis-notification-close:hover {
    color: #fff;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Custom Confirmation Dialog */
.pygnosis-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(1, 6, 24, 0.85);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pygnosis-confirm-overlay.active {
    opacity: 1;
}

.pygnosis-confirm-dialog {
    background: linear-gradient(135deg, #0d1525 0%, #1a2332 100%);
    border: 2px solid #0CFE25;
    border-radius: 12px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pygnosis-confirm-dialog.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.pygnosis-confirm-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(12, 254, 37, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.pygnosis-confirm-icon {
    font-size: 2rem;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

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

.pygnosis-confirm-title {
    color: #0CFE25;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.pygnosis-confirm-body {
    padding: 25px;
}

.pygnosis-confirm-message {
    color: #9AAEC4;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.pygnosis-confirm-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(12, 254, 37, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.pygnosis-confirm-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.pygnosis-confirm-cancel {
    background-color: transparent;
    border: 1px solid #9AAEC4;
    color: #9AAEC4;
}

.pygnosis-confirm-cancel:hover {
    border-color: #0CFE25;
    color: #0CFE25;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 254, 37, 0.2);
}

.pygnosis-confirm-delete {
    background-color: #ff4444;
    color: #fff;
}

.pygnosis-confirm-delete:hover {
    background-color: #ff3333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.pygnosis-confirm-delete:active,
.pygnosis-confirm-cancel:active {
    transform: translateY(0);
}

/* Responsive Design */
@media screen and (max-width: 996px) {
    .multi-script-editor-container {
        flex-direction: column;
        height: auto;
    }

    .file-tree-panel {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #0CFE25;
    }

    .code-editor-panel {
        min-height: 400px;
    }

    .resizer {
        display: none; /* Hide resizer on mobile */
    }
}

@media screen and (max-width: 576px) {
    .input-modal-content {
        min-width: 90%;
        padding: 20px;
    }

    .tabs {
        gap: 5px;
    }

    .tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .pygnosis-confirm-dialog {
        min-width: 90%;
        max-width: 90%;
        margin: 0 20px;
    }

    .pygnosis-confirm-footer {
        flex-direction: column;
    }

    .pygnosis-confirm-btn {
        width: 100%;
    }
}

/* Exercise Tab - More Emphasized Green (Newly Completed) */
button.exercise-tab.finished-exercise-active {
    position: relative;
    color: #00ff55 !important; /* More emphasized green for newly completed */
    font-weight: bold;
    animation: colorPulse 0.3s ease-in-out;
}

/* Ensure green color is maintained even when tab is active */
button.exercise-tab.finished-exercise-active.active {
    color: #00ff55 !important;
}

button.exercise-tab.finished-exercise.active {
    color: #0CFE25 !important;
}

@keyframes colorPulse {
    from {
        opacity: 0.5;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

