:root {
    --bg-main: #f8f9fa;
    --bg-panel: #ffffff;
    --bg-header: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --gutter-bg: #e9ecef;
    --gradient-text: linear-gradient(90deg, #3b82f6, #8b5cf6);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --cm-theme: 'eclipse';
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-panel: #1e293b;
    --bg-header: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --warning-bg: #422d0b;
    --warning-text: #fcd34d;
    --gutter-bg: #334155;
    --gradient-text: linear-gradient(90deg, #60a5fa, #a78bfa);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --cm-theme: 'monokai';
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; transition: background-color 0.3s ease, color 0.3s ease; }
html { scroll-behavior: smooth; }

.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.section-title p { color: var(--text-muted); font-size: 1.1rem; }

.btn { padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-weight: 500; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-panel); border-color: var(--primary); color: var(--primary); }
.btn-large { padding: 0.8rem 1.8rem; font-size: 1.1rem; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.875rem; }
.btn-icon { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); transition: 0.3s; }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.landing-body { display: flex; flex-direction: column; min-height: 100vh; }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; background: rgba(var(--bg-header), 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary); }
.nav-links { display: flex; gap: 1rem; align-items: center; }

.hero { display: flex; align-items: center; justify-content: space-between; padding: 5rem 5%; gap: 3rem; flex-wrap: wrap; }
.hero-content { flex: 1; min-width: 300px; }
.hero h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; }
.hero p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; margin-bottom: 2rem; }
.hero-stats { display: flex; gap: 1.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.hero-visual { flex: 1; min-width: 300px; perspective: 1000px; }

.mock-ide { background: #1e1e1e; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid #333; transform: rotateY(-5deg) rotateX(5deg); transition: transform 0.5s; }
.mock-ide:hover { transform: rotateY(0) rotateX(0); }
.mock-header { background: #2d2d2d; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.mock-title { flex: 1; text-align: center; color: #858585; font-size: 0.85rem; font-family: monospace; }
.mock-body { padding: 1.5rem; overflow-x: auto; }
.mock-body pre { margin: 0; font-family: 'Fira Code', monospace; font-size: 0.9rem; line-height: 1.5; color: #d4d4d4; }
.keyword { color: #569cd6; }
.variable { color: #9cdcfe; }
.string { color: #ce9178; }
.property { color: #4fc1ff; }
.function { color: #dcdcaa; }
.built_in { color: #4ec9b0; }

.features-section { padding: 5rem 5%; background: var(--bg-panel); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.feature-card { background: var(--bg-main); padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); transition: 0.3s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.75rem; font-size: 1.25rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

.contact-section { padding: 5rem 5%; max-width: 1000px; margin: 0 auto; }
.contact-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.contact-card { background: var(--bg-panel); padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; transition: 0.3s; }
.contact-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.contact-card a { color: var(--primary); text-decoration: none; font-weight: bold; font-size: 1.1rem; }
.contact-card a:hover { text-decoration: underline; }

footer { margin-top: auto; text-align: center; padding: 2rem; background: var(--bg-header); border-top: 1px solid var(--border-color); color: var(--text-muted); }
.footer-links { margin-top: 1rem; display: flex; gap: 1rem; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.2s; }
.footer-links a:hover { color: var(--primary); }

/* IDE Layout */
.ide-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.ide-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; background: var(--bg-header); border-bottom: 1px solid var(--border-color); height: 55px; }
.ide-logo a { color: var(--primary); text-decoration: none; font-weight: bold; font-size: 1.2rem; }
.ide-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ide-select { padding: 0.35rem; border-radius: 4px; background: var(--bg-panel); color: var(--text-main); border: 1px solid var(--border-color); outline: none; }

.ide-container { display: flex; flex: 1; height: calc(100vh - 55px); }
.ide-panel { display: flex; flex-direction: column; height: 100%; min-width: 200px; }
.editor-panel { flex: 1; }
.preview-panel { flex: 1; background: #fff; display: flex; flex-direction: column; } 

.gutter { background-color: var(--gutter-bg); cursor: col-resize; width: 6px; z-index: 10; transition: background 0.2s; }
.gutter:hover { background-color: var(--primary); }

.tabs { display: flex; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); overflow-x: auto; white-space: nowrap; }
.tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 500; border-bottom: 2px solid transparent; transition: 0.2s; }
.tab-btn:hover { color: var(--text-main); background: var(--bg-main); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-main); }
.tab-content { display: none; height: calc(100% - 41px); }
.tab-content.active { display: block; }

.CodeMirror { height: 100% !important; font-family: 'Fira Code', 'Courier New', monospace; font-size: 14px; }
.php-warning { background: var(--warning-bg); color: var(--warning-text); padding: 0.5rem; font-size: 0.85rem; border-bottom: 1px solid var(--border-color); }
#php-cm { height: calc(100% - 32px); }

.preview-header { padding: 0.5rem 1rem; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.preview-content { flex: 2; position: relative; background: #fff; overflow: auto; }
#preview-frame { width: 100%; height: 100%; border: none; display: block; background: #fff; }
#php-output-container { width: 100%; height: 100%; background: #1e1e1e; color: #d4d4d4; padding: 1rem; overflow: auto; font-family: monospace; display: flex; flex-direction: column; }
#php-output { flex: 1; white-space: pre-wrap; word-break: break-all; margin: 0; }
#php-meta { margin-top: 1rem; font-size: 0.8rem; color: #888; border-top: 1px solid #333; padding-top: 0.5rem; }
.hidden { display: none !important; }

.console-panel { flex: 1; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; background: var(--bg-panel); }
.console-header { padding: 0.5rem 1rem; background: var(--bg-header); border-bottom: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); }
.console-output { flex: 1; overflow-y: auto; padding: 0.5rem; font-family: monospace; font-size: 0.9rem; background: var(--bg-main); }
.log-line { border-bottom: 1px solid var(--border-color); padding: 0.25rem 0.5rem; }
.log-error { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.log-warn { color: var(--warning-text); background: rgba(252, 211, 77, 0.1); }

/* ===== EKSİKSİZ MOBİL UYUM (RESPONSIVE) KISMI ===== */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 1rem; text-align: center; }
    .hero { flex-direction: column; text-align: center; padding: 3rem 5%; }
    .hero h1 { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .hero-buttons .btn { width: 100%; }
    .hero-stats { justify-content: center; flex-wrap: wrap; }
    
    /* IDE Mobile Layout - Altlı Üstlü Yapı */
    .ide-header { height: auto; flex-direction: column; gap: 1rem; padding: 1rem; text-align: center; }
    .ide-controls { justify-content: center; width: 100%; flex-wrap: wrap; }
    .ide-select { width: 100%; margin-bottom: 0.5rem; }
    
    .ide-container { flex-direction: column; height: calc(100vh - 140px); }
    .editor-panel { height: 50%; width: 100% !important; flex: none; }
    
    /* Önizleme panelinin mobilde esnemesi ve daralmaması için ayarlar */
    .preview-panel { height: 50%; width: 100% !important; flex: none; display: flex; flex-direction: column; }
    .preview-content { flex: 2; min-height: 200px; }
    .console-panel { flex: 1; min-height: 100px; }
    
    /* Ayırıcıyı yatay (yukarı-aşağı çekilebilir) hale getiriyoruz */
    .gutter { width: 100%; height: 16px; cursor: row-resize; background-color: var(--gutter-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); position: relative; display: flex; align-items: center; justify-content: center; }
    .gutter::after { content: '===='; color: var(--text-muted); font-size: 12px; letter-spacing: 2px; }
    
    .CodeMirror { font-size: 13px; }
}