/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --muted: #4b5563;
  --border: #e0e7ff;
}

body {
  font-family: "Poppins", "Inter", sans-serif;
  background: #f8fafc;
  color: #1a1a2e;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated Background */
.background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
      90deg,
      rgba(59, 130, 246, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.95;
  z-index: -1;
  animation: shiftGrid 26s linear infinite;
}

.background::before,
.background::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(72px);
}

.background::before {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, #a7e0ff 60%, transparent 100%);
}

.background::after {
  width: 300px;
  height: 300px;
  bottom: -90px;
  right: -90px;
  background: radial-gradient(circle, #d1ffb0 55%, transparent 100%);
}

@keyframes shiftGrid {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 46px 46px;
  }
}

/* Layout */
.container {
  max-width: 780px;
  margin: 100px auto 64px;
  padding: 0 32px;
  text-align: center;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 16px;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.1px;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-brand:hover {
  color: #1e40af;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #1e293b;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.09rem;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.2s;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Typography */
.label {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 600;
  opacity: 0.92;
}

.title {
  font-family: "Lemonada", cursive;
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 38px;
  line-height: 1.1;
  background: linear-gradient(
    90deg,
    #1e293b 10%,
    var(--primary) 50%,
    #7dd3fc 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 3px 10px rgba(59, 130, 246, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: text-shadow 0.3s;
}

.title .brand {
  position: relative;
  z-index: 1;
  padding-bottom: 2px;
}

.title .brand::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, var(--primary), #7dd3fc);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.4s;
}

.title .brand:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.emoji {
  font-size: 2.1rem;
  filter: drop-shadow(0 2px 7px rgba(59, 130, 246, 0.23));
  transition: transform 0.2s;
}

.emoji:hover {
  transform: scale(1.12);
}

/* Card & Section */
.card,
.contact-section {
  background: #fff;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.09), 0 0 0 1.5px var(--border);
  border: 1.2px solid var(--border);
  text-align: left;
  font-size: 1.12rem;
  margin: 0 auto 28px;
  transition: box-shadow 0.2s;
}

.card:hover,
.contact-section:hover {
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.13);
}

.card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

/* Enhanced Card Styles */
.card,
.blog-post {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.08),
    0 1.5px 6px rgba(0, 0, 0, 0.04);
  padding: 2rem 2.2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s;
}
.card:hover,
.blog-post:hover {
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* Contact Section */
#contact h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contact h2 i {
  margin-bottom: 8px;
  color: #4f8cff;
  font-size: 2rem;
}

#contact p {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Buttons */
.btn.gradient-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  color: #fff;
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 32px;
  text-decoration: none;
  font-size: 1.15rem;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.17);
  transition: all 0.18s;
  border: none;
  cursor: pointer;
  margin: 0 auto;
  margin-top: 10px;
  width: fit-content;
}

.btn.gradient-btn i {
  font-size: 1.18rem;
}

.btn.gradient-btn:hover,
.btn.gradient-btn:focus {
  transform: translateY(-2.5px);
  box-shadow: 0 7px 20px rgba(59, 130, 246, 0.23);
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
}

/* Enhanced Button Styles */
.btn,
.gradient-btn {
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.4em;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.09);
  transition: background 0.2s, box-shadow 0.2s;
}
.btn:hover,
.gradient-btn:hover {
  background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.social-icons a {
  background: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.4rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
  text-decoration: none;
}

.social-icons a:hover,
.social-icons a:focus {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
  border-color: var(--primary);
}

/* Footer */
.footer {
  text-align: center;
  color: #64748b;
  font-size: 1.01rem;
  padding: 28px 0 14px;
  transition: color 0.2s;
}

.footer:hover {
  color: var(--primary);
}

/* =================
     Responsive Design
     ================*/

/* Large screens (default) */
/* Already handled above */

/* Medium screens */
@media (max-width: 1024px) {
  .post-title {
    color: #3b82f6;
    font-size: 1rem;
    margin-bottom: 8px;
  }
  .container {
    max-width: 98vw;
    padding: 0 16px;
    margin: 60px auto 36px;
  }
  .navbar {
    padding: 14px 0 8px;
    flex-direction: column;
    gap: 12px;
  }
  .title {
    font-size: 2rem;
  }
  .emoji {
    font-size: 1.2rem;
  }
  .card,
  .contact-section {
    padding: 16px;
    font-size: 1rem;
    margin-bottom: 16px;
  }
  .nav-links {
    /* display: none; */
  }
  .emoji {
    display: none;
  }
  .nav-brand {
    display: none;
  }

  .post-container {
    max-width: 780px;
    margin: 60px auto 40px;
    padding: 0 32px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.09), 0 0 0 1.5px var(--border);
    border: 1.2px solid var(--border);
    text-align: left;
    font-size: 0.8rem;
  }
  .post-title {
    color: #3b82f6;
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .post-meta {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 24px;
  }
}

/* Small screens */
@media (max-width: 700px) {
  .post-container {
    max-width: 780px;
    margin: 60px auto 40px;
    padding: 0 32px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.09), 0 0 0 1.5px var(--border);
    border: 1.2px solid var(--border);
    text-align: left;
    font-size: 0.8rem;
  }
  .post-title {
    color: #3b82f6;
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .post-meta {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .container {
    max-width: 100vw;
    padding: 0 5vw;
    margin: 40px 0 20px;
  }

  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    isplay: none;
    padding-top: 8px;
  }

  .nav-brand {
    font-size: 1.1rem;
    text-align: center;
  }

  .title {
    font-size: 1.5rem;
    line-height: 1.3;
    text-align: center;
    word-break: break-word;
    margin-bottom: 24px;
    flex-direction: column;
  }

  .emoji {
    font-size: 1.2rem;
    margin-top: 10px;
  }

  .card,
  .contact-section {
    padding: 24px 16px;
    font-size: 0.96rem;
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .card h2 {
    font-size: 1.1rem;
  }

  .btn.gradient-btn {
    font-size: 1rem;
    padding: 10px 20px;
    width: 100%;
    max-width: 300px;
  }

  .social-icons {
    gap: 12px;
    margin-top: 20px;
  }

  .social-icons a {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .footer {
    font-size: 0.88rem;
    padding: 20px 0 10px;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .post-title {
    color: #3b82f6;
    font-size: 1rem;
    margin-bottom: 8px;
  }
  .post-container {
    max-width: 780px;
    margin: 60px auto 40px;
    padding: 0 32px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.09), 0 0 0 1.5px var(--border);
    border: 1.2px solid var(--border);
    text-align: left;
    font-size: 0.8rem;
  }
  .post-title {
    color: #3b82f6;
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .post-meta {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .container {
    padding: 0 4vw;
    margin: 24px 0 12px;
  }

  .title {
    font-size: 1.2rem;
  }

  .card,
  .contact-section {
    padding: 20px 12px;
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .navbar {
    padding: 10px 0;
  }

  .nav-links {
    gap: 6px;
    isplay: none;
  }

  .btn.gradient-btn {
    font-size: 0.95rem;
    padding: 10px;
  }

  .social-icons a {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .footer {
    font-size: 0.82rem;
    padding: 14px 0;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .container {
    padding: 0 1vw;
    margin: 10px 0 4px 0;
  }
  .title {
    font-size: 0.8rem;
  }
  .card,
  .contact-section {
    padding: 4vw 1vw;
    font-size: 0.8rem;
  }
  .navbar,
  .nav-links {
    gap: 2px;
  }
}
.post-container {
  max-width: 780px;
  margin: 60px auto 40px;
  padding: 0 32px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.09), 0 0 0 1.5px var(--border);
  border: 1.2px solid var(--border);
  text-align: left;
  font-size: 1.12rem;
}
.post-title {
  color: #3b82f6;
  font-size: 2rem;
  margin-bottom: 8px;
}
.post-meta {
  color: #6366f1;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.post-content {
  font-size: 1.13rem;
  color: #22223b;
  margin-bottom: 1.2rem;
  line-height: 1.8;
}
.post-body h1,
.post-body h2,
.post-body h3 {
  color: #3b82f6;
}
.post-body img {
  max-width: 100%;
  border-radius: 8px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  margin-top: 24px;
}
.back-link:hover {
  color: #1e40af;
}
.share-btn {
  background: #f1f5f9;
  border: none;
  color: #3b82f6;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s, color 0.18s;

  margin-bottom: 12px;

  margin-top: 12px;
}
.share-btn:hover {
  background: #e0e7ff;
  color: #1e40af;
}
.copy-success {
  color: #16a34a;
  font-size: 0.98rem;
  margin-left: 8px;
  transition: opacity 0.3s;
}

/* Arabic font and RTL support for post body */
.post-body[lang="ar"],
.post-body.arabic {
  font-family: "Cairo", "Tajawal", "Amiri", Arial, Helvetica, sans-serif;
  direction: rtl;
  text-align: right;
  font-size: 1rem;
  line-height: 2.1;
  letter-spacing: 0.01em;
  word-break: break-word;
}

/* Markdown table style for post page */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: #f9fafb;
  border-radius: 10px;
  overflow: hidden;
  font-size: 1.05em;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.07);
}

.post-body th {
  background: #3b82f6;
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid #dbeafe;
}

.post-body td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.post-body tr:last-child td {
  border-bottom: none;
}

.post-body tr:nth-child(even) {
  background: #f1f5f9;
}

/* Arabic/RTL table support */
.post-body[lang="ar"] table,
.post-body.arabic table {
  direction: rtl;
  font-family: inherit;
}

.post-body[lang="ar"] th,
.post-body.arabic th,
.post-body[lang="ar"] td,
.post-body.arabic td {
  text-align: right;
}

/* Arabic tables style */
.post-body[lang="ar"] table,
.post-body.arabic table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px 0;
  background: #f6fff8;
  border-radius: 12px;
  overflow: hidden;
  direction: rtl;
  font-family: inherit;
  font-size: 1.05em;
  box-shadow: 0 2px 12px rgba(25, 135, 84, 0.07);
}

.post-body[lang="ar"] th,
.post-body.arabic th {
  background: #198754;
  color: #fff;
  padding: 10px 14px;
  text-align: right;
  font-weight: 700;
  border-bottom: 2px solid #c7f5d9;
}

.post-body[lang="ar"] td,
.post-body.arabic td {
  padding: 10px 14px;
  border-bottom: 1px solid #e3fbe8;
  text-align: right;
}

.post-body[lang="ar"] tr:last-child td,
.post-body.arabic tr:last-child td {
  border-bottom: none;
}

.post-body[lang="ar"] tr:nth-child(even),
.post-body.arabic tr:nth-child(even) {
  background: #e9fbe5;
}
