/* Enhanced Blog Post Styles */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  direction: rtl;
}

.blog-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* Back Button */
.back-button-wrapper {
  margin-bottom: 2rem;
  margin-top: 120px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-background);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  font-weight: 500;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.back-btn i {
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.back-btn:hover i {
  transform: translateX(4px);
}

/* Main Blog Post Card */
.blog-post-card {
  background: var(--card-background);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
}

.blog-post-card:hover {
  box-shadow: var(--shadow-xl);
}

/* Image Gallery */
.image-gallery-wrapper {
  position: relative;
  background: #000;
}

.image-carousel {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.image-container {
  position: relative;
  height: 400px;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-base);
}

.image-container:hover .gallery-image {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-base);
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel Controls */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 50px;
  height: 50px;
  z-index: 10;
}

.carousel-control-prev {
  right: 20px;
}

.carousel-control-next {
  left: 20px;
}

.carousel-control-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: var(--transition-base);
  box-shadow: var(--shadow-md);
}

.carousel-control:hover .carousel-control-icon {
  background: white;
  transform: scale(1.1);
}

.carousel-control-icon i {
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  transition: var(--transition-base);
  cursor: pointer;
}

.carousel-indicators button.active,
.carousel-indicators button:hover {
  background: white;
  border-color: white;
}

/* Lightbox */
.lightbox-content {
  background: rgba(0, 0, 0, 0.95);
  border: none;
}

.lightbox-header {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1000;
  background: none;
  border: none;
  padding: 1rem;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close i {
  font-size: 1.5rem;
  color: white;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  height: 100vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

/* Post Content */
.post-content {
  padding: 2.5rem;
}

.post-header {
  margin-bottom: 2rem;
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  background: var(--background-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.meta-item i {
  font-size: 1.1rem;
  color: var(--primary-color);
}

/* Post Body */
.post-body {
  margin-bottom: 2rem;
}

.post-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  text-align: justify;
  padding: 1.5rem;
  background: var(--background-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

/* Videos Section */
.videos-section {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-color);
}

.section-title i {
  font-size: 1.75rem;
  color: var(--primary-color);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
}

.external-video {
  padding: 2rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
}

.external-video-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: white;
  text-decoration: none;
  transition: var(--transition-base);
}

.external-video-link:hover {
  color: white;
  transform: translateY(-2px);
}

.external-video-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.external-video-link span {
  font-size: 1.1rem;
  font-weight: 500;
}

.external-video-link i:last-child {
  font-size: 1.25rem;
}

/* Admin Actions */
.admin-actions {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--radius-xl);
  border: 1px solid #f59e0b;
}

.admin-actions-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-actions-title::before {
  content: "🔐";
  font-size: 1.5rem;
}

.admin-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.delete-form {
  display: inline-block;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-base);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.edit-btn {
  background: var(--warning-color);
  color: white;
}

.edit-btn:hover {
  background: #d97706;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.delete-btn {
  background: var(--danger-color);
  color: white;
}

.delete-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-btn i {
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-container {
    padding: 1rem 0.5rem;
  }

  .post-content {
    padding: 1.5rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .image-carousel {
    height: 250px;
  }

  .image-container {
    height: 250px;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .admin-buttons {
    flex-direction: column;
  }

  .admin-btn {
    justify-content: center;
  }

  .post-meta {
    flex-direction: column;
    align-items: center;
  }

  .carousel-control-icon {
    width: 40px;
    height: 40px;
  }

  .carousel-control-icon i {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .post-title {
    font-size: 1.75rem;
  }

  .post-text {
    font-size: 1rem;
    padding: 1rem;
  }

  .videos-section {
    padding: 1.5rem;
  }

  .admin-actions {
    padding: 1.5rem;
  }

  .back-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Animation Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply animations */
.blog-post-card {
  animation: fadeInUp 0.6s ease-out;
}

.back-btn {
  animation: scaleIn 0.4s ease-out;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
.back-btn:focus,
.admin-btn:focus,
.carousel-control:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
