﻿:root {
    --bg: #fdfbf7; /* Parchment/Cream */
    --surface: #ffffff;
    --surface2: #f8f5f0;
    --primary: #881337; /* Deep Sufi Crimson / Maroon */
    --primary-hover: #4c0519;
    --primary-light: #fff1f2;
    --gold: #d97706; /* Classic Gold */
    --text-main: #27272a;
    --text-muted: #71717a;
    --border: #e5e5e5;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(136, 19, 55, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    background-image: linear-gradient(rgba(136, 19, 55, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 19, 55, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
}

.urdu-text, .i18n[data-ur], .i18n[data-rm] { font-family: 'Noto Nastaliq Urdu', 'Amiri', serif; }

a { color: var(--primary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Topbar */
.topbar { background: var(--primary-hover); color: #fecdd3; padding: 8px 0; font-size: 13px; border-bottom: 2px solid var(--gold); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.topbar-links { display: flex; gap: 15px; align-items: center; }
.topbar-links a { color: #fecdd3; }
.topbar-links a:hover { color: white; }

/* Lang Switcher */
.lang-switcher { position: relative; }
.lang-btn { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 4px 10px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.lang-menu { position: absolute; top: 100%; right: 0; background: white; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); margin-top: 5px; min-width: 120px; display: none; z-index: 1000; overflow: hidden; }
.lang-menu.show { display: block; }
.lang-option { padding: 8px 15px; color: var(--text-main); cursor: pointer; font-size: 13px; font-weight: 500; }
.lang-option:hover { background: var(--surface2); color: var(--primary); }

/* Header & Nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 32px; color: var(--primary); }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 22px; font-weight: 700; color: var(--primary-hover); letter-spacing: 0.5px; }
.logo-sub { font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-weight: bold;}

.main-nav { display: flex; gap: 8px; }
.nav-link { color: var(--text-muted); font-weight: 500; padding: 8px 16px; border-radius: var(--radius); transition: 0.3s; font-size: 15px; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* Hero */
.page-hero { text-align: center; padding: 60px 20px 40px; }
.page-hero h1 { font-size: 42px; margin-bottom: 15px; color: var(--primary-hover); font-weight: 800; font-family: 'Amiri', serif;}
.page-hero p { font-size: 18px; color: var(--text-muted); max-width: 650px; margin: 0 auto; }

/* Tools Grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; padding: 20px 0 60px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: var(--radius); padding: 30px; text-align: left; transition: 0.3s; display: block; box-shadow: var(--shadow); }
html[dir="rtl"] .tool-card { text-align: right; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.tool-icon { width: 60px; height: 60px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 20px; }
.tool-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--primary-hover); }
.tool-card p { color: var(--text-muted); font-size: 15px; line-height: 1.5; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.panel-header { background: var(--surface2); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.panel-label { font-weight: 600; color: var(--text-main); font-size: 15px; }
textarea { width: 100%; min-height: 250px; background: transparent; border: none; padding: 20px; color: var(--text-main); font-size: 20px; resize: vertical; outline: none; }
textarea::placeholder { color: #cbd5e1; }

/* Buttons */
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 14px 28px; border-radius: 50px; font-weight: 600; font-size: 16px; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 12px rgba(136, 19, 55, 0.2); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 6px 16px rgba(136, 19, 55, 0.3); transform: translateY(-2px); }
.icon-btn { background: transparent; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; transition: 0.2s; padding: 4px; }
.icon-btn:hover { color: var(--primary); }

/* Stats Bar */
.stats-bar { display: flex; justify-content: space-between; background: var(--surface); padding: 12px 20px; border-radius: var(--radius); border: 1px solid var(--border); margin: 15px 0; font-size: 14px; box-shadow: var(--shadow); }
.stat-item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.stat-val { color: var(--primary); font-weight: bold; background: var(--primary-light); padding: 2px 10px; border-radius: 12px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 4px solid var(--primary); padding: 40px 0 20px; margin-top: 60px; text-align: center; }
.footer-logo { font-size: 20px; font-weight: 700; color: var(--primary-hover); margin-bottom: 10px; }
.footer-text { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.footer-links { list-style: none; display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }

/* Toast */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--primary-hover); color: #fff; padding: 12px 24px; border-radius: 30px; font-weight: 600; box-shadow: var(--shadow-hover); opacity: 0; transition: 0.3s; z-index: 1000; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.conv-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
@media (max-width: 768px) { .conv-grid { grid-template-columns: 1fr; } .main-nav { display: none; } }
