* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  direction: rtl;
  background-color: #11171e;
  color: white;
}

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

/* Common Section Styles */
.section {
  margin-bottom: 60px;
  display: flex;
  flex-direction: row;
  gap: 30px;
}

.section-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-media {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 24px;
  color: white;
  font-weight: bold;
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 20px;
  color: #007bff;
  margin-bottom: 20px;
  line-height: 1.4;
}

.section-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
}

/* Books Section */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  width: 100%;
}

.books-rows {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.books-row {
  display: flex;
  gap: 15px;
}

.book-card {
  position: relative;
  width: 100%;
  min-width: 120px;
  max-width: 200px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background-color: #2a374a;
  transition: transform 0.3s ease;
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.book-info {
  padding: 10px;
}

.book-title {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
  color: white;
}

.book-author {
  font-size: 10px;
  color: #cccccc;
  margin-bottom: 10px;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
  background-color: #007bff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.book-card:hover .play-button {
  opacity: 1;
}

/* Anywhere Section */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  width: 100%;
}

.feature-card {
  position: relative;
  height: 200px;
  border-radius: 5px;
  overflow: hidden;
}

.feature-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta-button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 30px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  align-self: flex-start;
}

/* RTL/LTR Support */
html[lang="ar"] {
  direction: rtl;
}

html[lang="ar"] .section {
  flex-direction: row;
}

html[lang="ar"] .cta-button {
  align-self: flex-start;
}

html[lang="en_US"] {
  direction: ltr;
}

html[lang="en_US"] .section {
  flex-direction: row-reverse;
}

html[lang="en_US"] .cta-button {
  align-self: flex-start;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .section {
    flex-direction: column !important; /* Override RTL/LTR on mobile */
  }

  html[lang="ar"] .section-content,
  html[lang="en_US"] .section-content {
    order: -1;
    margin-bottom: 30px;
  }

  .books-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem 0;
  }

  .books-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
  }

  .book-card {
    flex: 0 0 calc(33.333% - 1rem);
    min-width: initial;
    max-width: initial;
  }
}

@media (max-width: 768px) {
  .book-card {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

@media (max-width: 576px) {
  .book-card {
    flex: 0 0 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .book-cover {
    height: 200px;
  }

  .book-info {
    padding: 15px;
  }

  .book-title {
    font-size: 14px;
  }

  .book-author {
    font-size: 12px;
  }
}
