/* Arabic Calculators Portal - Modern RTL Styling */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --primary-color: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --accent-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --radius: 14px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

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

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
}

/* Navbar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.25rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
  background: #f0fdfa;
  color: var(--primary-color);
}

/* Container */
.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
}

/* Ad Placement Placeholder */
.ad-slot {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Calculator Grid (Homepage) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.tool-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.tool-icon {
  width: 54px;
  height: 54px;
  background: #ccfbf1;
  color: var(--primary-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.tool-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Calculator Wrapper */
.calc-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.calc-box {
  background: var(--card-bg);
  padding: 2.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background-color: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.radio-card {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.radio-card input {
  width: auto;
}

/* Results Box */
.result-box {
  margin-top: 2rem;
  padding: 1.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  display: none;
}

.result-box.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.result-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 0.75rem;
}

.result-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #15803d;
  margin-bottom: 1rem;
}

.result-details {
  border-top: 1px dashed #bbf7d0;
  padding-top: 1rem;
  font-size: 0.95rem;
  color: #1e293b;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}

/* Content & SEO Article Section */
.seo-content {
  background: var(--card-bg);
  padding: 2.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  margin-top: 2rem;
}

.seo-content h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.seo-content h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin: 1.25rem 0 0.5rem;
}

.seo-content p {
  color: #475569;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.seo-content ul, .seo-content ol {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
  color: #475569;
}

.seo-content li {
  margin-bottom: 0.5rem;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .calc-box { padding: 1.5rem; }
  .nav-container { flex-direction: column; gap: 1rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
}
