@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

body {
  /* Using a modern Arabic font for better aesthetics */
  font-family: 'Cairo', sans-serif;
  background-color: #f8f9fa; /* A light grey background from Bootstrap's color palette */
}

/* Slider Styles */
.slider-container {
  margin-bottom: 30px;
  position: relative;
}

.slider-item {
  position: relative;
  height: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
}

.slider-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: 30px;
}

.slider-content h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.slider-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.slider-content .btn {
  padding: 10px 20px;
  font-size: 1.1rem;
}

/* Homepage Sections */
.section-title {
  margin: 30px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0d6efd;
}

/* Section Header like "وصل حديثاً" */
.section-header {
  background-color: #343a40; /* Dark gray background */
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  direction: rtl;
}

.section-header h3 {
  color: white;
  margin: 0;
  font-size: 1.25rem;
}

.section-header .badge {
  background-color: #dc3545; /* Dark red background */
  color: white;
  font-size: 0.875rem;
  padding: 0.5em 0.75em;
}

.section-header .btn-outline-light {
  border-color: #fff;
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.section-header .btn-outline-light:hover {
  background-color: #fff;
  color: #343a40;
}

/* Fixed Sidebar Menu Styles */
@media (min-width: 992px) {
  .main-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
  }
  
  .sidebar-menu {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    width: 280px;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    direction: rtl;
    overflow-y: auto;
    flex-shrink: 0;
  }
}

.sidebar-header {
  padding: 20px;
  background-color: #343a40;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h4 {
  margin: 0;
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu > ul > li {
  position: relative;
  border-bottom: 1px solid #eee;
}

.sidebar-menu > ul > li > a {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.sidebar-menu > ul > li > a:hover {
  background-color: #f8f9fa;
}

.sidebar-menu > ul > li > a .arrow {
  float: left;
  transition: transform 0.2s;
}

.sidebar-menu > ul > li:hover > a .arrow {
  transform: rotate(90deg);
}

/* Subcategory display styles */
.subcategory-container {
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.subcategory-container h5 {
  color: #333;
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.subcategory-grid a {
  color: #495057;
  text-decoration: none;
  padding: 8px;
  display: block;
  border-radius: 4px;
  transition: all 0.2s;
}

.subcategory-grid a:hover {
  background-color: #e9ecef;
  color: #dc3545;
}

/* Overlay for mobile */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1030;
  display: none;
}

.menu-overlay.open {
  display: block;
}

/* Mobile sidebar (Drawer) */
@media (max-width: 991.98px) {
  .sidebar-menu {
    position: fixed;
    top: 0;
    left: -320px; /* Hidden by default */
    width: 320px;
    height: 100vh;
    background-color: white;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: left 0.3s ease;
    direction: rtl;
    overflow-y: auto;
  }
  
  .sidebar-menu.open {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: block;
  }
}

@media (min-width: 992px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Product grid */
.product-grid {
  flex: 1;
}

/* Styles for the admin sidebar (to be used later) */
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: #343a40; /* Dark sidebar */
  padding-top: 1rem;
  overflow-y: auto;
}

.admin-sidebar .nav-link {
  color: #c2c7d0;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  color: #fff;
}

/* Additional mobile responsiveness for larger logo and text */
@media (max-width: 576px) {
  .slider-item {
    height: 300px;
  }
  
  .slider-content h2 {
    font-size: 1.5rem;
  }
  
  .slider-content p {
    font-size: 1rem;
  }
  
  .section-header h3 {
    font-size: 1.1rem;
  }
}

/* Even larger adjustments for extra small mobile screens */
@media (max-width: 360px) {
  .slider-item {
    height: 250px;
  }
  
  .slider-content {
    padding: 20px;
  }
  
  .slider-content h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  
  .slider-content p {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  
  .section-header h3 {
    font-size: 1rem;
  }
  
  .section-header .btn-outline-light {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
}

/* Login Required Modal - Beautiful Mobile-Friendly Design */
.login-modal-content {
  border: none;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-modal-body {
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.login-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.login-icon-wrapper i {
  font-size: 2.5rem;
  color: white;
}

.login-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.login-modal-message {
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  opacity: 0.95;
}

.login-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.login-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
}

.login-btn:hover {
  background: #f8f9fa;
  color: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  width: 100%;
  backdrop-filter: blur(10px);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-2px);
}

.cancel-btn:active {
  transform: translateY(0);
}

.login-modal-footer {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.login-modal-footer .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

.register-link {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  transition: all 0.3s ease;
}

.register-link:hover {
  color: #f8f9fa;
  text-decoration: none;
}

/* Modal Backdrop Enhancement */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

/* Mobile-specific adjustments */
@media (max-width: 576px) {
  .login-modal-body {
    padding: 2rem 1.25rem;
  }
  
  .login-icon-wrapper {
    width: 70px;
    height: 70px;
    margin-bottom: 1.25rem;
  }
  
  .login-icon-wrapper i {
    font-size: 2rem;
  }
  
  .login-modal-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  
  .login-modal-message {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .login-btn,
  .cancel-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .modal-dialog {
    margin: 1rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .login-modal-body {
    padding: 1.75rem 1rem;
  }
  
  .login-icon-wrapper {
    width: 60px;
    height: 60px;
  }
  
  .login-icon-wrapper i {
    font-size: 1.75rem;
  }
  
  .login-modal-title {
    font-size: 1.1rem;
  }
  
  .login-modal-message {
    font-size: 0.85rem;
  }
}

/* Animation for modal backdrop */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translateY(-50px);
}

.modal.show .modal-dialog {
  transform: translateY(0);
}