:root {
  --bg-color: #050505;
  --text-color: #ffffff;
  --grid-color: rgba(255, 255, 255, 0.1);
  --accent-color: #00f0ff;
  --accent-secondary: #7000ff;
  --font-main: 'IBM Plex Sans Arabic', sans-serif;
  --grid-width: 1px;
  --padding-mobile: 1.5rem;
  --padding-tablet: 2rem;
  --padding-desktop: 3rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 14px;
  /* Smaller base font for mobile */
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.15), transparent 40%);
  color: var(--text-color);
  font-family: var(--font-main);
  line-height: 1.5;
  direction: rtl;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

ul {
  list-style: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile First Grid System --- */
/* Default: Single Column / Stacked */
.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  /* Single column by default */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-bottom: var(--grid-width) solid var(--grid-color);
  padding-left: var(--padding-mobile);
  padding-right: var(--padding-mobile);
  margin-left: calc(-1 * var(--padding-mobile));
  margin-right: calc(-1 * var(--padding-mobile));
}

.grid-item {
  border-bottom: var(--grid-width) solid var(--grid-color);
  /* Stacked items need bottom border */
  padding: 2rem 1.5rem;
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Project cards in grid should not have padding from grid-item */
.grid-item.project-card {
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--grid-width) solid var(--grid-color);
}

.site-header .grid-container {
  border-bottom: none;
  grid-template-columns: 1fr auto;
  /* Logo left, Nav right (or hamburger) */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-cell {
  padding: 1rem 0;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-cell {
  padding: 1rem 0;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  /* Hidden by default (desktop first approach for this element, overridden in mobile query) */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2000;
  padding: 0;
}

.hamburger span {
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.desktop-nav {
  display: block;
  /* Visible by default */
}

/* Mobile Specific Styles */
@media (max-width: 767px) {
  .hamburger {
    display: flex !important;
  }

  .desktop-nav {
    display: none !important;
  }
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1500;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu.is-active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu ul {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mobile-menu a {
  font-size: 2rem;
  font-weight: 700;
}

/* Contact Buttons */
.contact-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 140px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  background: var(--text-color);
  color: var(--bg-color);
}

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

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
}

.main-nav ul {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Hero */
.hero {
  margin-top: 60px;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero .grid-container {
  border-bottom: none;
}

.hero-content {
  padding: 3rem 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 10vw, 3.5rem);
  /* Fluid font size for mobile */
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  letter-spacing: -1px;
  background: linear-gradient(to bottom right, #fff, #aaa);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-slides {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 2rem;
}

/* Hero Contact Buttons */
.hero-contact-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* Hero Image */
.hero-image {
  display: none;
  /* Hidden on mobile by default */
}

.hero-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 50%;
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

/* Sections */
.section-header h2 {
  padding: 3rem 1.5rem;
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(to right, #fff, #666);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Services & Philosophy Cards */
.service-card h3,
.feature h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.service-card p,
.feature p {
  font-size: 1rem;
  color: #aaa;
  margin-bottom: 1.5rem;
}

/* About */
.about-main,
.about-side {
  padding: 3rem 1.5rem;
  border-bottom: var(--grid-width) solid var(--grid-color);
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.about p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #ccc;
}

/* Footer */
.footer-content {
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.email-link {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 1rem;
  word-break: break-all;
}

.copyright {
  padding: 1.5rem;
  color: #444;
  font-size: 0.8rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}


/* --- Tablet (min-width: 768px) --- */
@media (min-width: 768px) {
  html {
    font-size: 15px;
  }

  .grid-container {
    grid-template-columns: repeat(12, 1fr);
    /* Switch to 12 col grid */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: var(--padding-tablet);
    padding-right: var(--padding-tablet);
    margin-left: calc(-1 * var(--padding-tablet));
    margin-right: calc(-1 * var(--padding-tablet));
    margin-left: auto;
    margin-right: auto;
  }

  /* Reset stacked borders and add grid borders */
  .grid-item {
    border-bottom: none;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  /* Header */
  .site-header .grid-container {
    display: grid;
    /* Back to grid */
  }

  .hamburger {
    display: none !important;
  }

  .desktop-nav {
    display: block !important;
  }

  .mobile-menu {
    display: none;
  }

  .logo-cell {
    grid-column: span 3;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  .nav-cell {
    grid-column: span 9;
  }

  .main-nav ul {
    gap: 2rem;
    font-size: 0.9rem;
  }

  /* Hero */
  .hero-content {
    grid-column: span 12;
    padding: 4rem 2rem;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  .hero h1 {
    font-size: 5rem;
    line-height: 1.2;
    padding-bottom: 1rem;
  }

  /* Hero 2-Column Layout for Desktop */
  .hero-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
  }

  .hero-grid .hero-content {
    grid-column: span 7;
  }

  .hero-grid .hero-image {
    grid-column: span 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  /* Sections */
  .section-header h2 {
    grid-column: span 12;
    padding: 4rem 2rem;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  /* 2 Column Grid for Tablet */
  .services-grid .grid-item,
  .philosophy-grid .grid-item {
    grid-column: span 6;
    border-bottom: var(--grid-width) solid var(--grid-color);
    /* Bottom border for rows */
  }

  /* Recent grid for tablet */
  .recent-grid .grid-item {
    grid-column: span 6;
    border-bottom: var(--grid-width) solid var(--grid-color);
    border-left: var(--grid-width) solid var(--grid-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Remove bottom border for last row items if needed, or keep for grid look */

  /* About */
  .about-main {
    grid-column: span 12;
    border-left: var(--grid-width) solid var(--grid-color);
  }

  .about-side {
    grid-column: span 12;
    border-left: var(--grid-width) solid var(--grid-color);
    border-right: none;
  }

  /* Footer */
  .footer-content {
    grid-column: span 12;
    padding: 6rem 2rem;
    border-left: var(--grid-width) solid var(--grid-color);
  }
}


/* --- Desktop (min-width: 1024px) --- */
@media (min-width: 1024px) {
  html {
    font-size: 16px;
  }

  .grid-container {
    padding-left: var(--padding-desktop);
    padding-right: var(--padding-desktop);
    margin-left: calc(-1 * var(--padding-desktop));
    margin-right: calc(-1 * var(--padding-desktop));
    margin-left: auto;
    margin-right: auto;
  }

  /* 3 Column Grid for Desktop */
  .services-grid .grid-item,
  .philosophy-grid .grid-item {
    grid-column: span 4;
  }

  /* Projects Grid */
  .featured-grid .grid-item {
    grid-column: span 4;
    border-bottom: var(--grid-width) solid var(--grid-color);
  }

  .recent-grid .grid-item {
    grid-column: span 4;
    /* 3 columns on desktop */
    border-bottom: var(--grid-width) solid var(--grid-color);
    border-left: var(--grid-width) solid var(--grid-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .about-main {
    grid-column: span 7;
    border-bottom: none;
    padding-left: 4rem;
    /* More space for text */
  }

  .about-side {
    grid-column: span 5;
    border-right: var(--grid-width) solid var(--grid-color);
    border-bottom: none;
    border-left: none;
  }

  /* Hero Massive Type */
  .hero h1 {
    font-size: clamp(5rem, 10vw, 9rem);
  }

  /* Footer */
  .footer-content {
    flex-direction: row;
    align-items: flex-end;
  }

  .contact-info h2 {
    font-size: 4rem;
  }

  .email-link {
    font-size: 2rem;
  }

  .copyright {
    grid-column: span 12;
    border-left: var(--grid-width) solid var(--grid-color);
    text-align: center;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* Blog Styles - Spacious Gallery Variant */
#blog.projects {
  padding: 4rem 0;
}

.recent-grid {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 2rem;
  border-bottom: none;
}

/* Blog grid specific padding */
#blogGrid.grid-container,
#blogGrid.recent-grid {
  padding-left: var(--padding-mobile);
  padding-right: var(--padding-mobile);
  margin-left: calc(-1 * var(--padding-mobile));
  margin-right: calc(-1 * var(--padding-mobile));
}

@media (min-width: 768px) {
  #blogGrid.grid-container,
  #blogGrid.recent-grid {
    padding-left: var(--padding-tablet);
    padding-right: var(--padding-tablet);
    margin-left: calc(-1 * var(--padding-tablet));
    margin-right: calc(-1 * var(--padding-tablet));
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  #blogGrid.grid-container,
  #blogGrid.recent-grid {
    padding-left: var(--padding-desktop);
    padding-right: var(--padding-desktop);
    margin-left: calc(-1 * var(--padding-desktop));
    margin-right: calc(-1 * var(--padding-desktop));
    margin-left: auto;
    margin-right: auto;
  }
}

.recent-grid .grid-item {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0;
  border-left: none;
  border-bottom: none;
}

/* Override grid system for blog grid */
#blogGrid .grid-item {
  grid-column: span 1 !important;
}

#blogGrid {
  display: grid;
  gap: 3rem;
  padding: 2rem 0;
  grid-template-columns: 1fr;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #blogGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #blogGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

#blogGrid .project-card {
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  gap: 0;
}

#blogGrid .project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.4);
}

#blogGrid .project-image {
  width: 100%;
  height: 350px;
  overflow: hidden;
  position: relative;
  background: rgba(112, 0, 255, 0.1);
}

#blogGrid .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

#blogGrid .project-card:hover .project-image img {
  transform: scale(1.05);
}

#blogGrid .project-content {
  width: 100%;
  box-sizing: border-box;
  padding: 2.5rem;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#blogGrid .project-content h4 {
  font-size: 1.5rem;
  margin: 0;
  color: #fff;
  font-weight: 600;
  line-height: 1.4;
}

#blogGrid .blog-date {
  color: #888;
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#blogGrid .blog-date::before {
  content: "📅";
  font-size: 0.85rem;
}

#blogGrid .blog-categories {
  color: #aaa;
  font-size: 0.85rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#blogGrid .blog-categories::before {
  content: "🏷️";
  font-size: 0.85rem;
}

#blogGrid .project-content p {
  color: #ccc;
  font-size: 1rem;
  line-height: 1.7;
  margin: 0.5rem 0 0 0;
}

#blogGrid [data-post-id] {
  cursor: pointer;
}

#blogGrid .project-link-icon {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: 50px;
  height: 50px;
  background: rgba(0, 240, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  border: 2px solid rgba(0, 240, 255, 0.3);
}

#blogGrid .project-card:hover .project-link-icon {
  opacity: 1;
  transform: scale(1.1);
}

#blogGrid .project-link-icon::after {
  content: "→";
  color: var(--accent-color);
  font-size: 1.5rem;
  font-weight: bold;
}

/* Responsive adjustments for spacious gallery */
@media (max-width: 767px) {
  #blogGrid {
    gap: 2rem;
    padding: 1.5rem 0;
    padding-left: var(--padding-mobile);
    padding-right: var(--padding-mobile);
  }

  #blogGrid .project-image {
    height: 250px;
  }

  #blogGrid .project-content {
    padding: 1.5rem;
  }

  #blogGrid .project-content h4 {
    font-size: 1.3rem;
  }
}

@media (min-width: 1024px) {
  #blogGrid .project-image {
    height: 400px;
  }

  #blogGrid .project-content {
    padding: 3rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.modal-content {
  background: rgba(5, 5, 5, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 240, 255, 0.1);
}

.modal-large {
  max-width: 800px;
}

.close-modal {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 2rem;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--accent-color);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #fff;
  font-size: 2rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ccc;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.error-message {
  color: #ff4444;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-danger {
  background: #ff4444;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #cc0000;
}

/* Post Detail Styles */
/* Post Page Container */
.post-page-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 4rem 1.5rem;
}

.post-detail-page {
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.post-detail {
  color: #fff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.post-detail-image {
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 2rem;
  background: rgba(112, 0, 255, 0.2);
  box-sizing: border-box;
}

.post-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-detail h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  color: #fff;
  line-height: 1.3;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.post-detail-date {
  color: #888;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.post-detail-meta {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-categories,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.meta-label {
  color: #888;
  font-size: 0.9rem;
  font-weight: 600;
}

.category-tag {
  display: inline-block;
  background: rgba(112, 0, 255, 0.2);
  border: 1px solid rgba(112, 0, 255, 0.4);
  border-radius: 12px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-secondary);
}

.tag-item {
  display: inline-block;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-color);
}

.blog-categories {
  color: #aaa;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

/* Blog Website Link Button */
.blog-website-link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-website-link .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
}

.post-website-link {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-website-link .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  padding: 1rem 2rem;
}

.post-detail-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #ccc;
  white-space: pre-wrap;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .post-detail-image {
    height: 250px;
  }
  
  .post-detail h1 {
    font-size: 2rem;
  }
  
  .post-detail-content {
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .post-page-container {
    padding: 4rem 2rem;
  }
  
  .post-detail-page {
    padding: 0;
  }
  
  .post-detail h1 {
    font-size: 3rem;
  }
  
  .post-detail-content {
    font-size: 1.2rem;
    max-width: 100%;
  }
}

@media (min-width: 1024px) {
  .post-page-container {
    padding: 5rem 3rem;
  }
  
  .post-detail h1 {
    font-size: 3.5rem;
  }
  
  .post-detail-content {
    font-size: 1.3rem;
    line-height: 2;
  }
}

/* Admin Styles */
.admin-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.admin-posts-list {
  margin-top: 2rem;
}

.admin-posts-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-posts-header h3 {
  color: #fff;
  font-size: 1.5rem;
}

.admin-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.admin-post-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.3s ease;
}

.admin-post-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
}

.admin-post-preview {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-post-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-post-info {
  flex: 1;
}

.admin-post-info h4 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.admin-post-date {
  color: #888;
  font-size: 0.85rem;
}

.admin-post-actions {
  display: flex;
  gap: 0.5rem;
}

/* Admin Key Icon */
.admin-key {
  display: inline-block;
  margin-right: 1rem;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.admin-key:hover {
  opacity: 1;
  transform: scale(1.1);
}

.copyright {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .admin-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Admin Page Styles */
#loginScreen {
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  max-width: 400px;
  width: 100%;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #fff;
  font-size: 2rem;
}

.back-link {
  text-align: center;
  margin-top: 1.5rem;
}

.back-link a {
  color: #aaa;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.back-link a:hover {
  color: var(--accent-color);
}

#adminDashboard {
  min-height: 100vh;
  display: block;
}

.admin-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.admin-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 {
  color: #fff;
  font-size: 2rem;
  margin: 0;
}

.admin-header-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Dashboard Stats */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card h3 {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-card p {
  color: #aaa;
  font-size: 0.9rem;
}

/* Admin Filters */
.admin-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-select,
.filter-input {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
}

.filter-input {
  flex: 1;
  min-width: 200px;
}

/* Form Enhancements */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 767px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.form-hint {
  display: block;
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
}

.form-group select:focus {
  outline: none;
  border-color: var(--accent-color);
}

.form-group select[multiple] {
  min-height: 100px;
}

/* Image Upload Container */
.image-upload-container {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.image-upload-container input {
  flex: 1;
}

.image-preview {
  margin-top: 0.5rem;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

/* Tags Display */
.tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-color);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.tag-remove:hover {
  background: rgba(0, 240, 255, 0.2);
}

/* Post Status Badges */
.post-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.status-published {
  background: rgba(0, 255, 0, 0.1);
  color: #00ff00;
  border: 1px solid rgba(0, 255, 0, 0.3);
}

.status-draft {
  background: rgba(255, 255, 0, 0.1);
  color: #ffff00;
  border: 1px solid rgba(255, 255, 0, 0.3);
}

.status-scheduled {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-color);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.admin-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.post-categories {
  color: #888;
  font-size: 0.85rem;
}

/* Media Library */
.media-library-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.media-library-actions input {
  flex: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.media-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.media-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
}

.media-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.media-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  justify-content: center;
}

/* Quill Editor Styles */
.ql-container {
  font-family: var(--font-main);
  direction: rtl;
  font-size: 1rem;
}

.ql-editor {
  min-height: 300px;
  color: #fff;
}

.ql-toolbar {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 8px 0 0;
}

.ql-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.ql-snow .ql-stroke {
  stroke: #fff;
}

.ql-snow .ql-fill {
  fill: #fff;
}

.ql-snow .ql-picker-label {
  color: #fff;
}

.ql-snow .ql-picker-options {
  background: rgba(5, 5, 5, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    flex-direction: column;
  }

  .filter-input {
    min-width: 100%;
  }

  .image-upload-container {
    flex-direction: column;
  }

  .media-library-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}