/* Code Editor Styles */
.code-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(135deg, rgba(5, 5, 5, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-editor-modal.active {
    display: flex;
    opacity: 1;
}

/* Animated background pattern */
.code-editor-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 220, 130, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 220, 130, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.5;
}

.code-editor-header {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.code-editor-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 220, 130, 0.3), transparent);
}

.code-editor-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #00dc82 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.code-editor-title i {
    background: linear-gradient(135deg, #00dc82 0%, #007AFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.code-editor-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-editor-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.code-editor-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.1), rgba(0, 122, 255, 0.1));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.code-editor-btn:hover::before {
    opacity: 1;
}

.code-editor-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 220, 130, 0.4);
    color: #00dc82;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 220, 130, 0.2);
}

.code-editor-btn:active {
    transform: translateY(0);
}

.code-editor-btn.primary {
    background: linear-gradient(135deg, #00dc82 0%, #00b36b 100%);
    color: #050505;
    border-color: #00dc82;
    box-shadow: 0 4px 15px rgba(0, 220, 130, 0.3);
}

.code-editor-btn.primary:hover {
    background: linear-gradient(135deg, #00b36b 0%, #00995a 100%);
    box-shadow: 0 6px 20px rgba(0, 220, 130, 0.4);
    transform: translateY(-2px);
}

.code-editor-btn i {
    position: relative;
    z-index: 1;
}

.code-editor-btn span {
    position: relative;
    z-index: 1;
}

.code-editor-btn.close-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.code-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.code-editor-tabs {
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    position: relative;
    z-index: 5;
}

.code-editor-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 220, 130, 0.2), transparent);
}

.code-editor-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    border: 1px solid transparent;
}

.code-editor-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.05), rgba(0, 122, 255, 0.05));
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.code-editor-tab:hover::before {
    opacity: 1;
}

.code-editor-tab:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.code-editor-tab.active {
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.15), rgba(0, 122, 255, 0.1));
    color: #00dc82;
    border: 1px solid rgba(0, 220, 130, 0.3);
    box-shadow: 0 4px 12px rgba(0, 220, 130, 0.15);
    transform: translateY(-1px);
}

.code-editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00dc82, transparent);
    border-radius: 2px;
}

.code-editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.code-editor-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 50%;
    min-width: 400px;
}

.code-editor-panel {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.code-editor-panel.active {
    display: flex;
}

.code-editor-textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: #050505;
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    tab-size: 2;
    letter-spacing: 0.3px;
    position: relative;
    background-image: 
        linear-gradient(transparent 0%, transparent calc(100% - 1px), rgba(255, 255, 255, 0.03) calc(100% - 1px)),
        linear-gradient(90deg, rgba(0, 220, 130, 0.05) 0%, transparent 0%);
    background-size: 100% 24px, 60px 100%;
    background-position: 0 0, 0 0;
}

.code-editor-textarea::placeholder {
    color: #64748b;
    font-style: italic;
}

.code-editor-textarea:focus {
    background-color: #050505;
}

/* Scrollbar styling for textarea */
.code-editor-textarea::-webkit-scrollbar {
    width: 10px;
}

.code-editor-textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.code-editor-textarea::-webkit-scrollbar-thumb {
    background: rgba(0, 220, 130, 0.2);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.code-editor-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 220, 130, 0.4);
    background-clip: padding-box;
}

.code-editor-preview {
    flex: 1;
    background: #ffffff;
    border: none;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.1);
}

.code-editor-preview::before {
    content: 'Önizleme';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cbd5e1;
    font-size: 0.875rem;
    pointer-events: none;
    opacity: 0.3;
    z-index: -1;
}

.code-editor-resizer {
    width: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: col-resize;
    transition: all 0.25s ease;
    position: relative;
}

.code-editor-resizer::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 220, 130, 0.2);
    transform: translateX(-50%);
    transition: all 0.25s ease;
}

.code-editor-resizer:hover {
    background: rgba(0, 220, 130, 0.1);
}

.code-editor-resizer:hover::before {
    width: 4px;
    background: rgba(0, 220, 130, 0.6);
    box-shadow: 0 0 10px rgba(0, 220, 130, 0.4);
}

.code-editor-footer {
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.code-editor-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 220, 130, 0.3), transparent);
}

.code-editor-footer #status-text {
    color: #00dc82;
    font-weight: 600;
    margin-left: 6px;
}

.code-editor-footer span[style*="color: #00dc82"] {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.code-editor-language-select {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300dc82' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.code-editor-language-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 220, 130, 0.3);
    transform: translateY(-1px);
}

.code-editor-language-select:focus {
    border-color: rgba(0, 220, 130, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.1);
}

/* Light Mode */
[data-theme="light"] .code-editor-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

[data-theme="light"] .code-editor-modal::before {
    background-image: 
        linear-gradient(rgba(0, 220, 130, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 220, 130, 0.02) 1px, transparent 1px);
}

[data-theme="light"] .code-editor-header,
[data-theme="light"] .code-editor-tabs,
[data-theme="light"] .code-editor-footer {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .code-editor-header::after,
[data-theme="light"] .code-editor-footer::before {
    background: linear-gradient(90deg, transparent, rgba(0, 220, 130, 0.2), transparent);
}

[data-theme="light"] .code-editor-title {
    background: linear-gradient(135deg, #0f172a 0%, #00dc82 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .code-editor-btn {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

[data-theme="light"] .code-editor-btn::before {
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.08), rgba(0, 122, 255, 0.08));
}

[data-theme="light"] .code-editor-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #00dc82;
    border-color: rgba(0, 220, 130, 0.3);
}

[data-theme="light"] .code-editor-textarea {
    background: #ffffff;
    color: #0f172a;
    background-image: 
        linear-gradient(transparent 0%, transparent calc(100% - 1px), rgba(15, 23, 42, 0.03) calc(100% - 1px)),
        linear-gradient(90deg, rgba(0, 220, 130, 0.03) 0%, transparent 0%);
}

[data-theme="light"] .code-editor-textarea::-webkit-scrollbar-thumb {
    background: rgba(0, 220, 130, 0.15);
}

[data-theme="light"] .code-editor-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 220, 130, 0.3);
}

[data-theme="light"] .code-editor-tab {
    color: #475569;
}

[data-theme="light"] .code-editor-tab::before {
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.05), rgba(0, 122, 255, 0.05));
}

[data-theme="light"] .code-editor-tab:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

[data-theme="light"] .code-editor-tab.active {
    background: linear-gradient(135deg, rgba(0, 220, 130, 0.12), rgba(0, 122, 255, 0.08));
    border-color: rgba(0, 220, 130, 0.25);
}

[data-theme="light"] .code-editor-language-select {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

[data-theme="light"] .code-editor-language-select:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(0, 220, 130, 0.3);
}

[data-theme="light"] .code-editor-resizer::before {
    background: rgba(0, 220, 130, 0.15);
}

[data-theme="light"] .code-editor-resizer:hover::before {
    background: rgba(0, 220, 130, 0.4);
}

[data-theme="light"] .code-editor-footer #status-text {
    color: #00b36b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .code-editor-content {
        flex-direction: column;
    }
    
    .code-editor-panels {
        max-width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 50%;
    }
    
    .code-editor-resizer {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
}

