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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.navbar {
    background: linear-gradient(90deg, #0f3460 0%, #16213e 100%);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    height: 56px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.navbar-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
    color: #e0e0e0;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 67, 67, 0.4);
}

.icon-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: #ffffff;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1e2a3a 0%, #0f1922 100%);
    border-right: 2px solid #0f3460;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    background: rgba(15, 52, 96, 0.3);
}

.sidebar-header h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #4facfe;
    font-weight: 700;
    letter-spacing: 1px;
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.file-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    margin: 2px 8px;
    border-radius: 6px;
}

.file-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    transform: translateX(4px);
}

.file-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-left: 3px solid #667eea;
}

.file-icon {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    min-width: 38px;
    text-align: center;
    letter-spacing: 0.5px;
}

.file-icon-python {
    background: linear-gradient(135deg, #306998 0%, #FFD43B 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(48, 105, 152, 0.3);
}

.file-icon-html {
    background: linear-gradient(135deg, #E34C26 0%, #F06529 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(227, 76, 38, 0.3);
}

.file-icon-css {
    background: linear-gradient(135deg, #264DE4 0%, #2965F1 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(38, 77, 228, 0.3);
}

.file-icon-default {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(85, 85, 85, 0.3);
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-delete {
    position: absolute;
    right: 8px;
    opacity: 0;
    color: #ff6b6b;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-item:hover .file-delete {
    opacity: 1;
    transform: scale(1.1);
}

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

.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-header {
    background: linear-gradient(90deg, #1e2a3a 0%, #16213e 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#currentFileName {
    font-size: 15px;
    color: #4facfe;
    font-weight: 600;
}

#fileTypeSelector {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #e0e0e0;
    border: 2px solid #0f3460;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#fileTypeSelector:hover {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

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

.CodeMirror {
    height: 100% !important;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.output-section {
    height: 250px;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #0f3460;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f1922 100%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.output-header {
    background: linear-gradient(90deg, #1e2a3a 0%, #16213e 100%);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
}

.output-tabs {
    display: flex;
    gap: 4px;
}

.output-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.output-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    overflow: auto;
}

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

#output {
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #d4d4d4;
    background-color: #1e1e1e;
    min-height: 100%;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.terminal-output {
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #d4d4d4;
    overflow-y: auto;
    height: calc(100% - 36px);
}

.terminal-line {
    margin: 4px 0;
}

.terminal-input-container {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #1e1e1e;
    border-top: 1px solid #3e3e42;
}

.terminal-prompt {
    color: #4ec9b0;
    margin-right: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

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

.terminal-command {
    color: #4ec9b0;
}

.terminal-output-text {
    color: #d4d4d4;
}

.terminal-error {
    color: #f48771;
}

.footer {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-top: 2px solid #0f3460;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -200px;
        height: calc(100% - 48px);
        z-index: 10;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .output-section {
        height: 40vh;
        position: absolute;
        bottom: -40vh;
        width: 100%;
        z-index: 5;
        transition: bottom 0.3s;
    }

    .output-section.open {
        bottom: 0;
    }

    .mobile-only {
        display: block;
    }

    .navbar-actions {
        flex-wrap: wrap;
    }

    .btn {
        font-size: 11px;
        padding: 4px 12px;
    }
}

@media (max-width: 480px) {
    .navbar-title {
        font-size: 12px;
    }

    .output-section {
        height: 50vh;
        bottom: -50vh;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

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