/* ErrorFixly - Main Stylesheet */
:root {
    --bg: #0a0e1a;
    --bg-2: #131825;
    --bg-3: #1a2033;
    --card: #161b2c;
    --card-hover: #1c2238;
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* System font stack as fallback - prevents FOIT/FOUT */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-display: swap;
}
body.rtl { font-family: 'Cairo', 'Inter', -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif; direction: rtl; }
a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }
code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; }
img { max-width: 100%; height: auto; }

.ef-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.ef-main { flex: 1; padding: 30px 0; }

/* ================= HEADER ================= */
.ef-header { background: var(--bg-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px); }
.ef-header .ef-container { display: flex; align-items: center; gap: 20px; padding: 14px 20px; }
.ef-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text); }
.ef-logo i { color: var(--primary); font-size: 24px; }
.ef-logo:hover { color: var(--text); }

.ef-search-form { flex: 1; max-width: 600px; position: relative; display: flex; }
.ef-search-form i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.rtl .ef-search-form i { left: auto; right: 16px; }
.ef-search-form input { flex: 1; padding: 12px 16px 12px 44px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 14px; font-family: inherit; }
.rtl .ef-search-form input { padding: 12px 44px 12px 16px; }
.ef-search-form input:focus { outline: none; border-color: var(--primary); }
.ef-search-form button { padding: 12px 20px; margin-left: 8px; background: var(--primary); color: white; border: none; border-radius: var(--radius); font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.2s; }
.rtl .ef-search-form button { margin-left: 0; margin-right: 8px; }
.ef-search-form button:hover { background: var(--primary-dark); }

.ef-lang-switcher { position: relative; }
.ef-lang-btn { padding: 10px 14px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-family: inherit; font-size: 14px; }
.ef-lang-menu { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); min-width: 180px; box-shadow: var(--shadow); overflow: hidden; z-index: 50; }
.rtl .ef-lang-menu { right: auto; left: 0; }
.ef-lang-menu a { display: block; padding: 10px 14px; color: var(--text-2); font-size: 14px; }
.ef-lang-menu a:hover { background: var(--card-hover); color: var(--text); }
.ef-lang-switcher:hover .ef-lang-menu { display: block; }

.ef-nav { background: var(--bg-2); border-bottom: 1px solid var(--border); overflow-x: auto; }
.ef-nav .ef-container { display: flex; gap: 4px; padding: 8px 20px; }
.ef-nav a { display: flex; align-items: center; gap: 6px; padding: 8px 14px; color: var(--text-2); font-size: 14px; white-space: nowrap; border-radius: 8px; transition: all 0.2s; }
.ef-nav a:hover { background: var(--card); color: var(--text); }

/* ================= HERO (homepage) ================= */
.ef-hero { padding: 60px 0 40px; text-align: center; }
.ef-hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 12px; background: linear-gradient(135deg, var(--primary-light), var(--info)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ef-hero p { font-size: 18px; color: var(--text-3); max-width: 700px; margin: 0 auto 30px; }
.ef-hero-search { max-width: 700px; margin: 0 auto; position: relative; }
.ef-hero-search input { width: 100%; padding: 20px 24px 20px 56px; font-size: 18px; background: var(--card); border: 2px solid var(--border-strong); border-radius: var(--radius-lg); color: var(--text); font-family: inherit; transition: all 0.2s; }
.rtl .ef-hero-search input { padding: 20px 56px 20px 24px; }
.ef-hero-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.15); }
.ef-hero-search i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; }
.rtl .ef-hero-search i { left: auto; right: 20px; }

.ef-stats { display: flex; justify-content: center; gap: 40px; margin-top: 32px; }
.ef-stat { text-align: center; }
.ef-stat-num { font-size: 28px; font-weight: 800; color: var(--primary-light); }
.ef-stat-label { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }

/* ================= SECTIONS ================= */
.ef-section { margin: 40px 0; }
.ef-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ef-section-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ef-section-title i { color: var(--primary); }
.ef-section-link { font-size: 14px; color: var(--text-3); }

/* ================= CARDS ================= */
.ef-grid { display: grid; gap: 16px; }
.ef-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ef-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ef-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.ef-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    display: block;
    color: var(--text);
}
.ef-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }

.ef-error-card { position: relative; }
.ef-error-code { display: inline-block; padding: 4px 10px; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--primary-light); margin-bottom: 8px; }
.ef-error-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.ef-error-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.ef-error-meta span { display: flex; align-items: center; gap: 4px; }

.ef-platform-card { padding: 24px; text-align: center; }
.ef-platform-icon { font-size: 32px; margin-bottom: 12px; }
.ef-platform-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.ef-platform-count { font-size: 12px; color: var(--text-3); }

/* ================= ERROR DETAIL PAGE ================= */
.ef-error-detail { display: grid; grid-template-columns: 1fr 320px; gap: 30px; }
@media (max-width: 900px) { .ef-error-detail { grid-template-columns: 1fr; } }

.ef-error-header { background: linear-gradient(135deg, var(--card) 0%, var(--bg-3) 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; margin-bottom: 24px; }
.ef-error-header h1 { font-size: 28px; line-height: 1.3; margin-bottom: 12px; }
.ef-error-code-big { display: inline-block; padding: 8px 16px; background: var(--primary); color: white; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.ef-error-message { padding: 16px; background: rgba(239,68,68,0.1); border-left: 4px solid var(--danger); border-radius: 6px; margin: 16px 0; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.rtl .ef-error-message { border-left: none; border-right: 4px solid var(--danger); }

.ef-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.ef-badge-platform { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.ef-badge-category { background: rgba(16,185,129,0.15); color: var(--success); }
.ef-badge-severity-low { background: rgba(16,185,129,0.15); color: var(--success); }
.ef-badge-severity-medium { background: rgba(59,130,246,0.15); color: var(--info); }
.ef-badge-severity-high { background: rgba(245,158,11,0.15); color: var(--warning); }
.ef-badge-severity-critical { background: rgba(239,68,68,0.15); color: var(--danger); }

.ef-section-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.ef-section-block h2 { font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.ef-section-block h2 i { color: var(--primary); }
.ef-section-block p { color: var(--text-2); margin-bottom: 12px; }
.ef-section-block ul, .ef-section-block ol { padding-left: 24px; color: var(--text-2); }
.rtl .ef-section-block ul, .rtl .ef-section-block ol { padding-left: 0; padding-right: 24px; }
.ef-section-block li { margin-bottom: 8px; }

.ef-quick-fix { background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.05)); border: 1px solid rgba(16,185,129,0.3); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.ef-quick-fix-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--success); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.ef-quick-fix p { color: var(--text); margin: 0; font-size: 15px; }

/* Solutions */
.ef-solution { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.ef-solution-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--bg-3); cursor: pointer; }
.ef-solution-number { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.ef-solution-title { flex: 1; margin: 0 16px; font-weight: 600; }
.ef-solution-meta { display: flex; gap: 8px; }
.ef-difficulty { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.ef-difficulty-easy { background: rgba(16,185,129,0.15); color: var(--success); }
.ef-difficulty-medium { background: rgba(245,158,11,0.15); color: var(--warning); }
.ef-difficulty-hard { background: rgba(239,68,68,0.15); color: var(--danger); }
.ef-solution-body { padding: 20px; }
.ef-solution-body ol { padding-left: 20px; }
.rtl .ef-solution-body ol { padding-left: 0; padding-right: 20px; }
.ef-solution-body li { margin-bottom: 12px; line-height: 1.7; }
.ef-solution-note { margin-top: 16px; padding: 12px; background: rgba(59,130,246,0.1); border-left: 3px solid var(--info); border-radius: 4px; font-size: 13px; color: var(--text-2); }
.rtl .ef-solution-note { border-left: none; border-right: 3px solid var(--info); }

/* FAQ */
.ef-faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ef-faq-q { padding: 16px 20px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.ef-faq-q::after { content: '+'; font-size: 20px; color: var(--text-3); }
.ef-faq-item.active .ef-faq-q::after { content: '−'; }
.ef-faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: all 0.3s; color: var(--text-2); }
.ef-faq-item.active .ef-faq-a { padding: 0 20px 16px; max-height: 500px; }

/* Helpful vote */
.ef-helpful { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 20px 0; text-align: center; }
.ef-helpful h3 { font-size: 16px; margin-bottom: 12px; }
.ef-helpful-buttons { display: flex; gap: 8px; justify-content: center; }
.ef-helpful-btn { padding: 8px 24px; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); cursor: pointer; font-family: inherit; transition: all 0.2s; }
.ef-helpful-btn:hover { background: var(--primary); border-color: var(--primary); }

/* Sidebar */
.ef-sidebar { position: sticky; top: 80px; align-self: start; }
.ef-sidebar-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.ef-sidebar-block h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); margin-bottom: 12px; }
.ef-sidebar-info dt { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.ef-sidebar-info dd { color: var(--text); margin-bottom: 14px; font-size: 14px; }

/* Comments */
.ef-comment { padding: 16px; background: var(--bg-3); border-radius: var(--radius); margin-bottom: 12px; }
.ef-comment-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.ef-comment-author { font-weight: 600; color: var(--primary-light); }
.ef-comment-date { color: var(--text-3); }
.ef-comment-content { color: var(--text-2); }
.ef-worked { display: inline-block; padding: 2px 8px; background: rgba(16,185,129,0.2); color: var(--success); border-radius: 4px; font-size: 11px; margin-left: 8px; }

.ef-comment-form input, .ef-comment-form textarea { width: 100%; padding: 12px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; margin-bottom: 10px; }
.ef-comment-form textarea { min-height: 100px; resize: vertical; }
.ef-comment-form .checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; color: var(--text-2); }
.ef-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.ef-btn:hover { background: var(--primary-dark); color: white; }
.ef-btn-secondary { background: var(--bg-3); border: 1px solid var(--border-strong); }
.ef-btn-secondary:hover { background: var(--card-hover); }

/* Ads */
.ef-ad { margin: 20px 0; text-align: center; overflow: hidden; max-width: 100%; }
.ef-ad-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.ef-ad img { max-width: 100%; height: auto; border-radius: 8px; }

/* Footer */
.ef-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 40px 0 20px; margin-top: 60px; }
.ef-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
@media (max-width: 700px) { .ef-footer-grid { grid-template-columns: 1fr 1fr; } }
.ef-footer-col h3 { font-size: 18px; margin-bottom: 8px; }
.ef-footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); margin-bottom: 14px; }
.ef-footer-col ul { list-style: none; }
.ef-footer-col li { margin-bottom: 8px; }
.ef-footer-col a { color: var(--text-2); font-size: 14px; }
.ef-footer-col p { color: var(--text-3); font-size: 14px; }
.ef-footer-bottom { padding-top: 20px; border-top: 1px solid var(--border); text-align: center; color: var(--text-3); font-size: 13px; }

/* Empty / No results */
.ef-empty { text-align: center; padding: 60px 20px; }
.ef-empty i { font-size: 48px; color: var(--text-3); margin-bottom: 16px; }
.ef-empty h2 { margin-bottom: 8px; }
.ef-empty p { color: var(--text-3); margin-bottom: 20px; }

@media (max-width: 768px) {
    .ef-hero h1 { font-size: 28px; }
    .ef-hero p { font-size: 15px; }
    .ef-stats { gap: 20px; flex-wrap: wrap; }
    .ef-header .ef-container { flex-wrap: wrap; }
    .ef-search-form { order: 3; flex-basis: 100%; }
}
