@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary: #d97706;
    --primary-dark: #b45309;
    --primary-light: #fef3c7;
    --secondary: #1e293b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 1.5rem;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 80px;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo span { color: var(--primary); }

nav { display: flex; gap: 2rem; }
nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    transition: color 0.3s;
}
nav a.active, nav a:hover { color: var(--primary); }

.currency-select {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card.dark {
    background: var(--secondary);
    color: white;
}

.stat-label { color: var(--text-muted); font-weight: 700; margin-bottom: 0.5rem; }
.stat-card.dark .stat-label { color: #94a3b8; }
.stat-value { font-size: 2rem; font-weight: 900; }
.stat-value span { font-size: 1rem; font-weight: 400; opacity: 0.7; }

/* Tables - Vertical Layout */
.section-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 3rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.data-row:last-child { border-bottom: none; }
.data-row:hover { background: var(--bg); }

.row-label { display: flex; align-items: center; gap: 1rem; font-weight: 800; }
.row-values { display: flex; gap: 2rem; text-align: left; }
.val-group { display: flex; flex-direction: column; }
.val-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.val-price { font-weight: 900; font-size: 1.125rem; }
.val-price.up { color: var(--success); }
.val-price.down { color: var(--danger); }

/* Calculator */
.calc-card {
    max-width: 700px;
    margin: 0 auto 3rem;
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-weight: 700; color: var(--secondary); }
.input-group input, .input-group select {
    padding: 1rem;
    border-radius: 1rem;
    border: 2px solid var(--border);
    font-size: 1.125rem;
    font-weight: 800;
    outline: none;
}

.input-group input:focus { border-color: var(--primary); }

.result-box {
    background: var(--secondary);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
}

.result-value { font-size: 3rem; font-weight: 900; color: var(--primary); }

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-about p { color: var(--text-muted); margin-top: 1rem; }
.footer-links h3 { margin-bottom: 1.5rem; font-size: 1.125rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { text-decoration: none; color: var(--text-muted); font-weight: 600; }
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Prose Styles for Static Pages */
.prose {
    max-width: 65ch;
    color: var(--text-main);
    line-height: 1.75;
}

.prose-slate {
    color: #475569;
}

.prose-slate h1,
.prose-slate h2 {
    color: #0f172a;
}

.text-slate-900 {
    color: #0f172a;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-400 {
    color: #94a3b8;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.font-black {
    font-weight: 900;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-12 {
    margin-top: 3rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.bg-white {
    background-color: white;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.italic {
    font-style: italic;
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.75;
}

.prose-lg h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

.prose-lg h2 {
    font-size: 1.75rem;
    line-height: 1.3;
}

.max-w-none {
    max-width: none;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.prose p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.prose a:hover {
    text-decoration: underline;
}

.prose ul {
    list-style-type: disc;
    padding-right: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose ol {
    list-style-type: decimal;
    padding-right: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose code {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.875em;
}

.prose pre {
    background: var(--secondary);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.prose blockquote {
    border-right: 4px solid var(--primary);
    padding-right: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose hr {
    border: none;
    border-top: 2px solid var(--border);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prose strong {
    font-weight: 900;
    color: var(--secondary);
}

.prose em {
    font-style: italic;
}

/* Content Section */
.content-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.content-section h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
}

.content-section h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.content-section p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.content-section ul {
    list-style: none;
    padding-right: 0;
    margin: 1.5rem 0;
}

.content-section li {
    position: relative;
    padding-right: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.content-section li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--primary);
    font-weight: 900;
    font-size: 1.25rem;
}

.content-section strong {
    color: var(--secondary);
    font-weight: 900;
}

.content-wrapper {
    line-height: 1.8;
    color: var(--text-muted);
}

.table-description {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.table-description p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    nav { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .form-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .data-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .row-values { width: 100%; justify-content: space-between; }

    .prose h1 { font-size: 1.75rem; }
    .prose h2 { font-size: 1.25rem; }

    .content-section {
        padding: 2rem 1.5rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .content-section h3 {
        font-size: 1.25rem;
    }

    .content-section h4 {
        font-size: 1.125rem;
    }

    .table-description {
        padding: 1rem;
    }
}
