:root {
    --primary-color: #7b68ee;
    --secondary-color: #6c5ce7;
    --accent-color: #b19fff;
    --dark-bg: #121212;
    --darker-bg: #1e1e1e;
    --card-bg: #282828;
    --text-color: #e2e2e2;
    --border-radius: 0.75rem;
    --typescript-color: #007acc;
    --javascript-color: #f7df1e;
    --nodejs-color: #68a063;
    --gradient-bg: linear-gradient(135deg, #2b2464 0%, #1a1a2e 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    background: var(--gradient-bg);
    background-attachment: fixed;
    max-width: 100%;
    overflow-x: hidden;
}

/* Modern Navbar with Glassmorphism */
.navbar {
    background-color: rgba(30, 30, 40, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Enhanced Card Design */
.card {
    background-color: rgba(40, 40, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
    height: 100%;
}

.card.main-editor {
    border-left: 4px solid var(--primary-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Improved Code Editor */
.code-area {
    font-family: 'Fira Code', 'Courier New', monospace;
    min-height: 450px;
    resize: none !important;
    background-color: rgba(20, 20, 25, 0.9);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    line-height: 1.5;
    tab-size: 4;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    height: 450px !important;
}

.code-area:focus {
    border-color: var(--accent-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.25rem rgba(177, 159, 255, 0.25);
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(123, 104, 238, 0.5);
}

/* Modern Language Selector */
.language-selector {
    background-color: rgba(30, 30, 40, 0.6);
    border-radius: 0.6rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lang-btn {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.2rem;
    background-color: rgba(40, 40, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    color: #aaa;
    transition: all 0.3s ease;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.lang-btn.active {
    background-color: rgba(50, 50, 60, 0.9);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, 
        rgba(123, 104, 238, 1) 0%, 
        rgba(177, 159, 255, 1) 100%);
}

.js-btn.active {
    border-left: 3px solid var(--javascript-color);
}

.ts-btn.active {
    border-left: 3px solid var(--typescript-color);
}

.node-btn.active {
    border-left: 3px solid var(--nodejs-color);
}

/* Target Environment Cards */
.env-option-card {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.env-option-card h5 {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.env-option-card:hover, .env-option-card.selected {
    background-color: rgba(40, 40, 60, 0.8);
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.env-option-card.selected {
    border-left-color: var(--primary-color);
    border-left-width: 6px;
}

/* Feature Pills */
.feature-pill {
    display: inline-flex;
    align-items: center;
    background-color: rgba(123, 104, 238, 0.15);
    color: var(--accent-color);
    border-radius: 50px;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feature-pill:hover {
    background-color: rgba(123, 104, 238, 0.25);
    transform: translateY(-2px);
}

.feature-pill i {
    margin-right: 0.4rem;
    font-size: 1rem;
}

/* Settings Panel - Collapsible */
.settings-panel {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.settings-title {
    display: flex;
    align-items: center;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-title:hover {
    background-color: rgba(123, 104, 238, 0.1);
}

.settings-title.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.settings-content {
transition: max-height 0.3s ease, padding 0.3s ease;
padding: 1.5rem;
overflow: visible;
max-height: 1500px;
}

.settings-title .toggle-icon {
transition: transform 0.3s ease;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Code Stats */
.code-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.stat-item {
    display: flex;
    align-items: center;
}

.stat-item i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

/* Theme Toggler */
.theme-toggler {
    display: flex;
    align-items: center;
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 50px;
    padding: 0.3rem;
    margin-right: 1rem;
}

.theme-option {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-option.active {
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-option i {
    font-size: 1rem;
}

/* Code Execution Preview */
.code-preview {
    background-color: rgba(20, 20, 25, 0.9);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
}

.console-output {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.console-output li {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-output li:last-child {
    border-bottom: none;
}

/* Compare toggle switch */
.compare-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.compare-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.compare-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 30, 40, 0.7);
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-label {
    margin: 0 0.5rem;
    font-weight: 500;
}

/* Custom Pill Container */
.obfuscation-level {
    display: flex;
    justify-content: space-between;
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 50px;
    padding: 0.3rem;
    margin-bottom: 1rem;
}

.level-option {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.level-option.active {
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* History Panel */
.history-item {
    background-color: rgba(30, 30, 40, 0.7);
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid var(--accent-color);
}

.history-item:hover {
    background-color: rgba(40, 40, 60, 0.8);
    transform: translateX(5px);
}

.history-item-title {
    font-weight: 500;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Code Comparison View */
.comparison-view {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.comparison-pane {
    flex: 1;
    background-color: rgba(20, 20, 25, 0.9);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-title {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.comparison-title i {
    margin-right: 0.5rem;
}

/* Tooltip styles */
.custom-tooltip {
    position: relative;
    display: inline-block;
}

.custom-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: rgba(40, 40, 50, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.custom-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Progress bar styling */
.progress {
    height: 10px;
    margin-bottom: 1rem;
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
    background-image: linear-gradient(45deg, 
                      rgba(255, 255, 255, .15) 25%, 
                      transparent 25%, 
                      transparent 50%, 
                      rgba(255, 255, 255, .15) 50%, 
                      rgba(255, 255, 255, .15) 75%, 
                      transparent 75%, 
                      transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* Improved responsive layout for desktop */
.main-layout {
    display: flex;
    flex-wrap: wrap;
}

.sidebar {
    flex: 0 0 300px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.right-sidebar {
    flex: 0 0 300px;
}

/* Enhanced feature cards for better spacing */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Responsive rules */
@media (max-width: 1700px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar, .right-sidebar {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .env-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .feature-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .env-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .language-buttons {
        flex-direction: row;
    }
    
    .comparison-view {
        flex-direction: column;
    }
    
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .env-options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .language-buttons {
        flex-direction: column;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .settings-group {
        margin-bottom: 1rem;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .code-area {
        min-height: 350px;
    }
    
    .btn {
        padding: 0.6rem 1rem;
    }
    
    .theme-toggler {
        margin-right: 0.5rem;
    }
    
    .feature-pill {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}