/* Modern Code Editor Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

#codeEditorApp {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
}

#codeEditorApp::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 0;
}

#codeEditorApp > * {
    position: relative;
    z-index: 1;
}

/* Header Styles */
#codeEditorApp header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "title tabs buttons";
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

#codeEditorApp header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 69, 19, 0.3), transparent);
}

#codeEditorApp h1 {
    grid-area: title;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Tab Navigation */
#codeEditorApp .tabs-container {
    grid-area: tabs;
    background: rgba(30, 41, 59, 0.6);
    padding: 0.25rem;
    border-radius: 12px;
    display: flex;
    gap: 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    justify-self: center;
}

#codeEditorApp .tab-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
    font-family: inherit;
}

#codeEditorApp .tab-button:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.8);
    transform: translateY(-1px);
}

#codeEditorApp .tab-button.active {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

#codeEditorApp .tab-button.active::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 6px;
    pointer-events: none;
}

/* Action Buttons */
#codeEditorApp .action-buttons {
    grid-area: buttons;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-self: end;
}

#codeEditorApp .action-button {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
    font-family: inherit;
}

#codeEditorApp .action-button svg {
    width: 18px;
    height: 18px;
}

#codeEditorApp .reset-button {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#codeEditorApp .reset-button:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

#codeEditorApp .run-button {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#codeEditorApp .run-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

#codeEditorApp .print-button {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#codeEditorApp .print-button:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

#codeEditorApp .action-button:active {
    transform: translateY(0) scale(0.98);
}

/* Editor Area */
#codeEditorApp main {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    position: relative;
    overflow: hidden;
}

/* Editor Container */
#codeEditorApp .editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

/* Line Numbers */
#codeEditorApp .line-numbers {
    background: rgba(15, 23, 42, 0.8);
    color: #64748b;
    padding: 2rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    text-align: right;
    width: 60px;
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
    user-select: none;
    white-space: pre;
    flex-shrink: 0;
}

#codeEditorApp .line-numbers .line-number {
    padding: 0 0.75rem;
    display: block;
    transition: color 0.2s ease;
}

#codeEditorApp .line-numbers .line-number:hover {
    color: #94a3b8;
}

/* Clear Button for Individual Editors */
#codeEditorApp .clear-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    z-index: 10;
    opacity: 0.7;
}

#codeEditorApp .clear-button:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    opacity: 1;
}

#codeEditorApp .clear-button:active {
    transform: translateY(0) scale(0.98);
}

#codeEditorApp .clear-button svg {
    width: 16px;
    height: 16px;
}

/* Copy Button for Individual Editors */
#codeEditorApp .copy-button {
    position: absolute;
    top: 1rem;
    right: 4rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    border: none;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.2);
    z-index: 10;
    opacity: 0.7;
}

#codeEditorApp .copy-button:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    opacity: 1;
}

#codeEditorApp .copy-button:active {
    transform: translateY(0) scale(0.98);
}

#codeEditorApp .copy-button svg {
    width: 16px;
    height: 16px;
}

#codeEditorApp .code-textarea {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border: none;
    outline: none;
    resize: none;
    flex: 1;
    height: 100%;
    padding: 2rem 2rem 2rem 1rem;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    font-weight: 400;
    caret-color: #06b6d4;
    selection-color: rgba(59, 130, 246, 0.3);
    position: relative;
}

#codeEditorApp .code-textarea::placeholder {
    color: #64748b;
    font-style: italic;
}

#codeEditorApp .code-textarea:focus {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Preview iframe */
#codeEditorApp iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: 0;
}

#codeEditorApp .preview-container {
    width: 100%;
    height: 100%;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

#codeEditorApp .preview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981, #f59e0b, #ef4444);
    z-index: 1;
}

/* Custom Scrollbar */
#codeEditorApp ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#codeEditorApp ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
}

#codeEditorApp ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #475569, #334155);
    border-radius: 6px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

#codeEditorApp ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
}

#codeEditorApp ::-webkit-scrollbar-corner {
    background: rgba(15, 23, 42, 0.5);
}

/* Vue Transitions */
.fade-enter-active, .fade-leave-active {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
    transform: translateY(8px);
}

/* Responsive Design */
@media (max-width: 768px) {
    #codeEditorApp {
        height: 90vh;
        border-radius: 12px;
        margin: 0.5rem;
    }
    
    #codeEditorApp header {
        padding: 1rem;
        grid-template-columns: 1fr auto;
        grid-template-areas: 
            "title buttons"
            "tabs tabs";
        gap: 1rem;
    }
    
    #codeEditorApp h1 {
        font-size: 1.25rem;
        justify-self: start;
    }
    
    #codeEditorApp .action-buttons {
        justify-self: end;
        gap: 0.75rem;
    }
    
    #codeEditorApp .action-button {
        width: 2.75rem;
        height: 2.75rem;
    }
    
    #codeEditorApp .action-button svg {
        width: 16px;
        height: 16px;
    }

    /* 在移动端隐藏打印按钮 */
    #codeEditorApp .print-button {
        display: none;
    }
    
    #codeEditorApp .tabs-container {
        justify-self: center;
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
    }
    
    #codeEditorApp .tab-button {
        flex: 1;
        text-align: center;
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }
    
    #codeEditorApp .clear-button {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.25rem;
        height: 2.25rem;
    }
    
    #codeEditorApp .clear-button svg {
        width: 14px;
        height: 14px;
    }
    
    #codeEditorApp .copy-button {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.25rem;
        height: 2.25rem;
    }
    
    #codeEditorApp .copy-button svg {
        width: 14px;
        height: 14px;
    }
    
    #codeEditorApp .code-textarea {
        padding: 1rem;
        font-size: 13px;
    }
    
    #codeEditorApp .line-numbers {
        width: 50px;
        padding: 1rem 0;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #codeEditorApp {
        margin: 0.25rem;
        border-radius: 8px;
    }
    
    #codeEditorApp header {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    #codeEditorApp h1 {
        font-size: 1.1rem;
    }
    
    #codeEditorApp .action-buttons {
        gap: 0.5rem;
    }
    
    #codeEditorApp .action-button {
        width: 2.5rem;
        height: 2.5rem;
    }
    
        #codeEditorApp .action-button svg {
        width: 14px;
        height: 14px;
    }

    /* 在移动端隐藏打印按钮 */
    #codeEditorApp .print-button {
        display: none;
    }

    #codeEditorApp .action-buttons .history-navigation-buttons {
        margin-right: 0.3rem;
    }
    
    #codeEditorApp .action-buttons .nav-button {
        width: 1.5rem;
        height: 1rem;
    }
    
    #codeEditorApp .action-buttons .nav-button svg {
        width: 10px;
        height: 10px;
    }
    
    #codeEditorApp .tab-button {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    #codeEditorApp .clear-button {
        top: 0.5rem;
        right: 0.5rem;
        width: 2rem;
        height: 2rem;
    }
    
    #codeEditorApp .clear-button svg {
        width: 12px;
        height: 12px;
    }
    
    #codeEditorApp .copy-button {
        top: 0.5rem;
        right: 0.5rem;
        width: 2rem;
        height: 2rem;
    }
    
    #codeEditorApp .copy-button svg {
        width: 12px;
        height: 12px;
    }
    
    #codeEditorApp .code-textarea {
        padding: 0.75rem;
        font-size: 12px;
    }
    
    #codeEditorApp .line-numbers {
        width: 40px;
        padding: 0.75rem 0;
        font-size: 12px;
    }
}

/* Loading Animation for Better UX */
#codeEditorApp .editor-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Syntax highlighting hints with CSS */
#codeEditorApp .code-textarea[data-lang="html"] {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

#codeEditorApp .code-textarea[data-lang="css"] {
    background: linear-gradient(135deg, #1e3a2a 0%, #0f2a1a 100%);
}

#codeEditorApp .code-textarea[data-lang="js"] {
    background: linear-gradient(135deg, #2a1e3a 0%, #1a0f2a 100%);
}

/* Line numbers for different languages */
#codeEditorApp .editor-container:has(.code-textarea[data-lang="html"]) .line-numbers {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
}

#codeEditorApp .editor-container:has(.code-textarea[data-lang="css"]) .line-numbers {
    background: linear-gradient(135deg, rgba(30, 58, 42, 0.9) 0%, rgba(15, 42, 26, 0.9) 100%);
}

#codeEditorApp .editor-container:has(.code-textarea[data-lang="js"]) .line-numbers {
    background: linear-gradient(135deg, rgba(42, 30, 58, 0.9) 0%, rgba(26, 15, 42, 0.9) 100%);
}

/* History Container Styles */
#codeEditorApp .history-container {
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#codeEditorApp .history-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#codeEditorApp .history-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#codeEditorApp .history-actions {
    display: flex;
    gap: 0.75rem;
}

#codeEditorApp .clear-all-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

#codeEditorApp .clear-all-button:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

#codeEditorApp .clear-all-button:active {
    transform: translateY(0);
}

#codeEditorApp .history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#codeEditorApp .history-item {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
}

#codeEditorApp .history-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

#codeEditorApp .history-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

#codeEditorApp .history-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

#codeEditorApp .history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#codeEditorApp .history-item-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

#codeEditorApp .history-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.25;
}

#codeEditorApp .history-timestamp {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

#codeEditorApp .history-item-stats {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(51, 65, 85, 0.4);
}

#codeEditorApp .history-line-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

#codeEditorApp .stats-label {
    color: #64748b;
    font-weight: 500;
}

#codeEditorApp .stats-total {
    font-weight: 600;
    color: #38bdf8;
    padding: 0.125rem 0.375rem;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    min-width: 1.5rem;
    text-align: center;
}

#codeEditorApp .stats-detail {
    color: #94a3b8;
    padding: 0.125rem 0.25rem;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 3px;
    font-size: 0.7rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

#codeEditorApp .stats-detail:nth-child(3) {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

#codeEditorApp .stats-detail:nth-child(4) {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

#codeEditorApp .stats-detail:nth-child(5) {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

#codeEditorApp .history-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 页面右上角的历史记录导航按钮组 */
#codeEditorApp .action-buttons .history-navigation-buttons {
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    margin-right: 0.5rem;
}

#codeEditorApp .action-buttons .nav-button {
    width: 2rem;
    height: 1.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(100, 116, 139, 0.1);
    color: #94a3b8;
    border-radius: 0;
    position: relative;
}

#codeEditorApp .action-buttons .nav-button:hover:not(:disabled) {
    background: rgba(100, 116, 139, 0.3);
    color: #e2e8f0;
    transform: translateY(-1px);
}

#codeEditorApp .action-buttons .nav-button:active:not(:disabled) {
    background: rgba(100, 116, 139, 0.4);
    transform: translateY(0) scale(0.98);
}

#codeEditorApp .action-buttons .nav-button:disabled {
    color: rgba(100, 116, 139, 0.3);
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.2);
    opacity: 0.5;
}

#codeEditorApp .action-buttons .nav-next {
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

#codeEditorApp .action-buttons .nav-prev {
    border-top: none;
}

#codeEditorApp .action-buttons .nav-button svg {
    transition: transform 0.2s ease;
    width: 12px;
    height: 12px;
}

#codeEditorApp .action-buttons .nav-button:hover:not(:disabled) svg {
    transform: scale(1.1);
}

#codeEditorApp .load-button,
#codeEditorApp .delete-button {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Expand Button for History Items */
#codeEditorApp .expand-button {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

#codeEditorApp .expand-button:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#codeEditorApp .expand-button svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#codeEditorApp .expand-button svg.rotate-180 {
    transform: rotate(180deg);
}

#codeEditorApp .load-button {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

#codeEditorApp .load-button:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

#codeEditorApp .delete-button {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

#codeEditorApp .delete-button:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* History Details */
#codeEditorApp .history-details {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

#codeEditorApp .history-code-section {
    margin-bottom: 1rem;
}

#codeEditorApp .history-code-section:last-child {
    margin-bottom: 0;
}

#codeEditorApp .history-code-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 0.5rem 0;
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: inline-block;
}

/* History Code Header */
#codeEditorApp .history-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#codeEditorApp .history-code-header h4 {
    margin: 0;
    flex: 1;
}

#codeEditorApp .history-code-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

#codeEditorApp .history-copy-button,
#codeEditorApp .history-load-button {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    font-size: 0.75rem;
}

#codeEditorApp .history-copy-button {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

#codeEditorApp .history-copy-button:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

#codeEditorApp .history-load-button {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

#codeEditorApp .history-load-button:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2);
}

#codeEditorApp .history-copy-button:active,
#codeEditorApp .history-load-button:active {
    transform: translateY(0) scale(0.98);
}

#codeEditorApp .history-code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin: 0;
    overflow-x: auto;
    white-space: pre;
    max-height: 200px;
    overflow-y: auto;
}

#codeEditorApp .history-preview {
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

#codeEditorApp .history-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    gap: 1rem;
}

#codeEditorApp .empty-icon {
    opacity: 0.6;
    color: #475569;
}

#codeEditorApp .history-empty p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

#codeEditorApp .history-empty p.text-sm {
    font-size: 0.875rem;
    color: #64748b;
    opacity: 0.8;
}

/* Responsive Design for History */
@media (max-width: 768px) {
    #codeEditorApp .history-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    #codeEditorApp .history-header h3 {
        font-size: 1.1rem;
    }
    
    #codeEditorApp .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    #codeEditorApp .clear-all-button {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    #codeEditorApp .history-list {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    #codeEditorApp .history-item {
        padding: 0.75rem;
    }
    
    #codeEditorApp .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    #codeEditorApp .history-item-title {
        width: 100%;
    }
    
    #codeEditorApp .history-title {
        font-size: 0.8rem;
    }
    
    #codeEditorApp .history-timestamp {
        font-size: 0.7rem;
    }
    
    #codeEditorApp .history-item-stats {
        padding: 0.4rem;
        margin-bottom: 0.4rem;
    }
    
    #codeEditorApp .history-line-count {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    #codeEditorApp .stats-total {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }
    
    #codeEditorApp .stats-detail {
        font-size: 0.65rem;
        padding: 0.1rem 0.2rem;
    }
    
    #codeEditorApp .history-item-actions {
        align-self: flex-end;
    }
    

    
    #codeEditorApp .load-button,
    #codeEditorApp .delete-button {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    #codeEditorApp .expand-button {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    #codeEditorApp .copy-button {
        right: 3.25rem;
        width: 2.25rem;
        height: 2.25rem;
    }
    
    #codeEditorApp .history-details {
        padding: 0.75rem;
    }
    
    #codeEditorApp .history-code {
        font-size: 0.75rem;
        padding: 0.5rem;
        max-height: 150px;
    }
    
    #codeEditorApp .history-code-section h4 {
        font-size: 0.8rem;
    }
    
    #codeEditorApp .history-copy-button,
    #codeEditorApp .history-load-button {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    #codeEditorApp .history-copy-button svg,
    #codeEditorApp .history-load-button svg {
        width: 12px;
        height: 12px;
    }
    
    #codeEditorApp .history-code-actions {
        gap: 0.25rem;
    }
    
    #codeEditorApp .history-preview {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    #codeEditorApp .history-timestamp {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    #codeEditorApp .history-header {
        padding: 0.75rem;
    }
    
    #codeEditorApp .history-header h3 {
        font-size: 1rem;
    }
    
    #codeEditorApp .clear-all-button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    #codeEditorApp .history-list {
        padding: 0.5rem;
    }
    
    #codeEditorApp .history-item {
        padding: 0.5rem;
    }
    
    #codeEditorApp .history-title {
        font-size: 0.75rem;
    }
    
    #codeEditorApp .history-timestamp {
        font-size: 0.65rem;
    }
    
    #codeEditorApp .history-item-stats {
        padding: 0.3rem;
        margin-bottom: 0.3rem;
    }
    
    #codeEditorApp .history-line-count {
        font-size: 0.65rem;
        gap: 0.25rem;
    }
    
    #codeEditorApp .stats-total {
        font-size: 0.65rem;
        padding: 0.1rem 0.25rem;
    }
    
    #codeEditorApp .stats-detail {
        font-size: 0.6rem;
        padding: 0.05rem 0.15rem;
    }
    
    #codeEditorApp .history-preview {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    #codeEditorApp .load-button,
    #codeEditorApp .delete-button {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    #codeEditorApp .expand-button {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    #codeEditorApp .copy-button {
        right: 2.75rem;
        width: 2rem;
        height: 2rem;
    }
    
    #codeEditorApp .history-details {
        padding: 0.5rem;
    }
    
    #codeEditorApp .history-code {
        font-size: 0.7rem;
        padding: 0.375rem;
        max-height: 120px;
    }
    
    #codeEditorApp .history-code-section h4 {
        font-size: 0.75rem;
    }
    
    #codeEditorApp .history-copy-button,
    #codeEditorApp .history-load-button {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    #codeEditorApp .history-copy-button svg,
    #codeEditorApp .history-load-button svg {
        width: 10px;
        height: 10px;
    }
    
    #codeEditorApp .history-code-actions {
        gap: 0.125rem;
    }
    
    #codeEditorApp .load-button svg,
    #codeEditorApp .delete-button svg,
    #codeEditorApp .expand-button svg {
        width: 12px;
        height: 12px;
    }
    

}