@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700;800&family=Open+Sans:wght@400;600&display=swap");

:root {
  /* Pladis Global Theme */
  --primary-color: #631932;
  /* Pladis Red */
  --primary-hover: #660828;
  --burgundy: #631932;
  /* Pladis Maroon */
  --burgundy-light: #772641;
  --cream-bg: #fcfbf9;
  /* Light Cream Background */
  --text-color: #333333;
  --text-light: #666666;
  --white: #ffffff;
  --border-color: #e0e0e0;
  --font-heading: "K24", sans-serif;
  --font-body: "K24", sans-serif;
}

/* Dark Mode Variables (Optional / Backend ONLY if needed) */
body.dark-mode {
  --cream-bg: #121212;
  --text-color: #ecf0f1;
  --text-light: #bdc3c7;
  --white: #1e1e1e;
  --border-color: #333333;
  --burgundy: #2c3e50;
  --primary-color: #ff4d6d;
}

/* Snow Effect (Canvas) */
#snow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: #bdc3c7;
  background-color: var(--cream-bg);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Increase font size for English due to K24 font metrics */
html[lang="en"] body {
  font-size: 1.5rem;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom Font for RTL */
@font-face {
  font-family: "K24";
  src: url("fonts/k24_regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "K24";
  src: url("fonts/k24_bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

/* RTL Support */
body[dir="rtl"] {
  text-align: right;
  direction: rtl;
  font-family: var(--font-body);
}

body[dir="rtl"] .hero {
  text-align: right;
}

body[dir="rtl"] .section-title {
  text-align: right;
  border-left: none;
  padding-left: 0;
  border-right: 5px solid #f1c40f;
  padding-right: 20px;
}

/* Global Container */
.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  height: 80px;
}

/* Logo */
.logo h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--burgundy);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
}

.logo a {
  text-decoration: none;
}

/* Desktop Nav */
.desktop-nav .nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.desktop-nav .nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.3s;
  position: relative;
}

.desktop-nav .nav-links a:hover,
.desktop-nav .nav-links a.active {
  color: var(--burgundy);
}

.desktop-nav .nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.login-icon-btn {
  font-size: 1.5rem;
  color: var(--gray);
  transition: color 0.3s;
}

.login-icon-btn:hover {
  color: var(--burgundy);
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
}

.lang-btn {
  background: transparent;
  border: 1px solid #e0e0e0;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-color);
  transition: all 0.3s;
}

.lang-btn:hover {
  background: #f9f9f9;
  border-color: var(--gold);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  /* Align right for LTR */
  background: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 1001;
}

/* RTL Adjustment for Lang Menu */
body[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-dropdown:hover .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

.lang-menu a {
  display: block;
  padding: 8px 15px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-menu a:hover {
  background: var(--cream-bg);
  color: var(--burgundy);
}

.flag-icon {
  width: 24px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--burgundy);
  cursor: pointer;
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  /* Hidden off-screen */
  width: 280px;
  height: 100%;
  background-color: #ffffff !important;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

body[dir="rtl"] .mobile-menu {
  right: auto;
  left: -300px;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
}

.mobile-menu.active {
  right: 0;
}

body[dir="rtl"] .mobile-menu.active {
  left: 0;
  right: auto;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.mobile-nav-links {
  list-style: none;
}

.mobile-nav-links li {
  margin-bottom: 15px;
}

.mobile-nav-links a {
  font-size: 1.1rem;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  display: block;
  padding: 10px;
  border-radius: 5px;
}

.mobile-nav-links a:hover {
  background: var(--cream-bg);
  color: var(--burgundy);
}

.close-menu {
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

/* Responsive */
@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }
}

/* Hero Section - Burgundy/Maroon Pladis Theme */
/* Hero Slider */
.hero-slider {
  position: relative;
  width: 100%;
  min-height: 600px;
  overflow: hidden;
  background-color: var(--burgundy);
  color: var(--white);
}

/* Static Hero for Subpages */
.hero {
  background: linear-gradient(135deg, var(--burgundy) 0%, #4a0f23 100%);
  color: var(--white);
  text-align: left;
  padding: 80px 0;
  display: flex;
  align-items: center;
  position: relative;
}

.slide-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Gradient Fade for blending with next section */
.hero-slider::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  /* Adjust height for smoothness */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--burgundy-light) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  z-index: 1;
}

.slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1);
  transition: transform 10s ease-out; /* Slow zoom effect */
  z-index: -1;
}

.slide.active .slide-bg {
  transform: scale(1.1); /* Zoom to 110% */
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.slide .container {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Slider Navigation */
.prev-btn,
.next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  z-index: 10;
  font-size: 24px;
  transition: background 0.3s;
}

.prev-btn:hover,
.next-btn:hover {
  background: var(--burgundy);
  color: var(--white);
}

/* Slider Dots */
.slider-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 15;
}

.dot {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dot.active,
.dot:hover {
  background-color: var(--white);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.prev-btn {
  left: 20px;
}

.next-btn {
  right: 20px;
}

body[dir="rtl"] .prev-btn {
  left: auto;
  right: 20px;
}

body[dir="rtl"] .next-btn {
  right: auto;
  left: 20px;
}

/* Reuse existing Hero Content styles */
.hero-content {
  max-width: 700px;
  z-index: 5;
  position: relative;
}

.hero-content h2 {
  font-family: var(--font-heading);
  font-size: 4rem;
  /* Increased size */
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.1;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 1.5rem;
  /* Increased size */
  margin-bottom: 40px;
  font-weight: 400;
  color: var(--white);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 25px;
  line-height: 1.1;
  color: var(--white);
  text-shadow: none;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 40px;
  font-weight: 400;
  opacity: 0.9;
  color: var(--white);
}

/* Pladis "Parallelogram" Button Style */
.btn {
  display: inline-block;
  padding: 15px 40px;
  background-color: #e6002a;
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  border-radius: 0;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%);
  /* Angled left edge */
  transition:
    background 0.3s,
    transform 0.2s;
  margin-left: -5px;
  text-transform: uppercase;
}

/* RTL Button Flip (Removed clipped style for rounded) */
body[dir="rtl"] .btn {
  margin-right: 0;
  margin-left: 0;
}

.btn:hover {
  background-color: #b6afaf86;
  /* White on hover */
  color: var(--burgundy);
  box-shadow: 0 0 15px rgb(109, 33, 50);
}

/* btn hover removed */

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--burgundy);
}

/* About Section */
.about-section {
  padding: 80px 20px;
  background-color: var(--burgundy-light);
  /* Lighter background for sections */
}

.section-title {
  margin-bottom: 50px;
  text-align: left;
  /* Gold accent bar */
  border-left: 5px solid #f1c40f;
  padding-left: 20px;
}

.section-title h2 {
  font-family: var(--font-heading);
  color: #f1c40f;
  /* Gold color */
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

/* About Content Text */
.about-content p {
  font-size: 1.35rem;
  /* Increased size */
  color: #ffffff;
  /* High contrast white */
  line-height: 1.9;
  font-weight: 500;
  margin-bottom: 20px;
}

.section-title p {
  /* Style for the subtitle in section header */
  font-size: 1.2rem;
  color: #e0e0e0;
  font-size: 1.1rem;
  color: #eee;
  max-width: 700px;
}

/* Products - Dark Cards */
/* Product Card Styles */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.product-card-wrapper {
  position: relative;
  height: auto;
  /* Let JS or Content decide */
  z-index: 1;
}

.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  /* JS will flip this to absolute */
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  /* Shrink to fit */
  transition:
    all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    z-index 0.01s linear 0.4s;
  /* Smooth motion + Z-index delay on return */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 10;
}

/* Hover Effect: Expansion */
.product-card-wrapper:hover {
  z-index: 2000;
}

.product-card-wrapper:hover .product-card {
  top: -20px;
  left: -20px;
  width: calc(100% + 40px);
  /* Grow outwards */
  height: auto;
  min-height: unset;
  /* Ensure space for description */
  z-index: 1000;
  /* High z-index on hover */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  justify-content: flex-start;
  transition:
    all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    z-index 0s linear 0s;
  /* Instant z-index on hover */
}

/* Rotating Gradient Border */
.product-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    transparent,
    transparent,
    #ff9f43,
    #ff6b6b
  );
  animation: rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -2;
}

.product-card-wrapper:hover .product-card::before {
  opacity: 1;
}

/* Inner white background */
.product-card::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #fff;
  border-radius: 10px;
  z-index: -1;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.product-img {
  height: 280px;
  opacity: 1;
  margin: 10px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.4s ease;
  border-bottom: 1px solid #eee;
}

.product-card-wrapper:hover .product-img {
  height: 300px;
  /* Grow slightly on hover */
}

.product-info {
  padding: 10px 15px;
  /* Reduced padding initially */
  text-align: center;
  position: relative;
  z-index: 2;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Align top */
  height: auto;
  transition: all 0.3s;
}

.product-card-wrapper:hover .product-info {
  justify-content: flex-start;
  padding: 20px;
  /* Expand padding on hover */
}

.product-info h3 {
  font-size: 1.4rem;
  /* Increased from 1.1rem */
  /* Slightly smaller initially */
  color: var(--burgundy);
  margin: 0;
  font-family: var(--font-heading);
  transition: all 0.3s;
  white-space: normal;
  /* Ensure title wraps */
  line-height: 1.2;
}

.product-card-wrapper:hover .product-info h3 {
  font-size: 1.6rem;
  /* Increased from 1.4rem */
  margin-bottom: 15px;
  /* Add space below title */
}

.product-desc {
  font-size: 1.2rem;
  /* Increased from 0.95rem */
  color: #333;
  line-height: 1.6;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.5s ease 0.2s;
  white-space: normal;
  /* Force wrap */
  word-wrap: break-word;
  /* Handle long words */
  overflow-wrap: break-word;
}

.product-card-wrapper:hover .product-desc {
  opacity: 1;
  max-height: 500px;
  /* Allow expansion */
}

.product-price {
  color: #e6cf08;
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
}

/* Footer - Darkest Burgundy */
footer {
  background-color: #631932;
  /* Almost black */
  color: #ccc;
  padding: 60px 0 30px;
  font-size: 0.9rem;
  border-top: 2px solid var(--burgundy-light);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.footer-col h3 {
  color: var(--white);
  margin-bottom: 20px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  /* Increased from 1.1rem */
  font-weight: 800;
  text-transform: uppercase;
}

.footer-col p,
.footer-col ul li,
.footer-col a {
  font-size: 1.1rem;
  /* Increased base size */
  line-height: 1.6;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a:hover {
  text-decoration: underline;
}

/* Social Icons RTL Support */
.social-icons-list {
  display: flex;
  gap: 15px; /* Ensures equal spacing in LTR & RTL */
  flex-wrap: wrap;
}

.social-icon {
  color: white !important;
  font-size: 1.5rem !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  color: var(--gold) !important;
  text-decoration: none !important;
}

.footer-bottom {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 1rem;
  /* Increased from 0.85rem */
  opacity: 0.9;
}

/* Form inputs for Pladis style */
.form-control {
  background: var(--white);
  border: 2px solid #e0e0e0;
  border-radius: 0;
  /* Square edges */
  padding: 15px;
  font-family: var(--font-heading);
}

/* Contact Page Styles */
.contact-info-col h3,
.contact-form-col h3 {
  font-size: 2rem !important;
}

.contact-info-col h4 {
  font-size: 1.4rem !important;
  color: var(--burgundy) !important;
}

.contact-info-col p {
  font-size: 1.2rem !important;
  color: #333 !important;
  font-weight: 500;
}

.contact-form-col label {
  font-size: 1.1rem !important;
}

.contact-form-col input,
.contact-form-col textarea {
  font-size: 1.1rem !important;
}

.contact-form-col .btn {
  font-size: 1.2rem !important;
  padding: 15px 0 !important;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Admin Styles - Premium Redesign */
.admin-body {
  background-color: #f4f7f6;
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background-color: var(--burgundy);
  color: var(--white);
  flex-shrink: 0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.admin-sidebar .logo {
  padding: 0 20px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.admin-sidebar .logo h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--white);
}

.admin-nav a {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-heading);
  font-weight: 500;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

.admin-nav a:hover,
.admin-nav a.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
  border-left-color: var(--primary-color);
}

.admin-main {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e1e1;
}

.admin-header-row h2 {
  font-family: var(--font-heading);
  color: var(--text-color);
}

/* Admin Cards */
.admin-card {
  background: var(--white);
  border-radius: 8px;
  /* Softer for admin interior */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid #eee;
}

.admin-card h3 {
  margin-bottom: 20px;
  color: var(--burgundy);
  font-family: var(--font-heading);
}

/* Admin Tables */
.admin-table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  background-color: #f9f9f9;
  color: #555;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-family: var(--font-heading);
}

.admin-table tr:hover {
  background-color: #fcfcfc;
}

.admin-table td img {
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Admin Form Elements */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.admin-form-group {
  margin-bottom: 20px;
}

.admin-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #444;
  font-size: 0.9rem;
}

/* Action Buttons */
.action-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-right: 5px;
}

.edit-btn {
  background-color: #e3f2fd;
  color: #1976d2;
}

.delete-btn {
  background-color: #ffebee;
  color: #c62828;
}

.edit-btn:hover {
  background-color: #bbdefb;
}

.delete-btn:hover {
  background-color: #ffcdd2;
}

/* Login Page Styling */
.login-body {
  background-color: var(--cream-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-card {
  background: var(--white);
  padding: 40px;
}
/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--cream-bg);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    opacity 0.5s ease-out,
    visibility 0.5s ease-out;
}

#preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  width: 120px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Admin RTL/LTR Sidebar Logic */

/* Switcher Positioning */
body[dir="ltr"] .admin-lang-switch {
  right: 30px;
  left: auto;
}
body[dir="rtl"] .admin-lang-switch {
  left: 30px;
  right: auto;
}

/* Sidebar Positioning */
body[dir="ltr"] .admin-sidebar {
  left: 0;
  right: auto;
}
body[dir="rtl"] .admin-sidebar {
  right: 0;
  left: auto;
}

/* Main Content Margin */
body[dir="ltr"] .admin-main {
  margin-left: 260px;
  margin-right: 0;
}
body[dir="rtl"] .admin-main {
  margin-right: 260px;
  margin-left: 0;
}

/* Responsive Sidebar (Mobile) */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%); /* Hidden by default LTR */
    width: 260px;
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
    position: fixed;
    top: 0;
    height: 100vh;
  }

  body[dir="rtl"] .admin-sidebar {
    transform: translateX(100%); /* Hidden by default RTL */
    right: 0;
    left: auto;
  }

  .admin-sidebar.active {
    transform: translateX(0) !important;
  }

  .admin-main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px;
  }
}

/* Admin Mobile Responsiveness */
.admin-mobile-header {
  display: none;
  background: #fff;
  padding: 15px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  height: 60px; /* Fixed height to create space */
}

@media (max-width: 992px) {
  /* Hide Sidebars margins on main content */
  .admin-main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 20px !important;
    padding-top: 80px !important; /* Space for fixed header */
  }

  /* Hide Sidebar by default */
  /* Hide Sidebar by default */
  .admin-sidebar {
    position: fixed; /* Ensure fixed positioning for tablets too */
    top: 0;
    height: 100vh;
    transform: translateX(calc(-100% - 10px)); /* Hide to left for LTR */
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
    width: 260px; /* Ensure fixed width */
  }

  html[dir="rtl"] .admin-sidebar {
    transform: translateX(calc(100% + 10px)); /* Hide to right for RTL */
    left: auto;
    right: 0;
  }

  /* Show Sidebar when active */
  .admin-sidebar.active {
    transform: translateX(0) !important;
  }

  /* Mobile Header Visible */
  .admin-mobile-header {
    display: flex;
  }

  /* Adjust language switcher position on mobile */
  .admin-lang-switch {
    position: fixed;
    top: 15px;
    right: 60px !important;
    left: auto !important;
    z-index: 1002 !important;
  }
  html[dir="rtl"] .admin-lang-switch {
    left: 60px !important;
    right: auto !important;
  }

  /* Stack Stats Cards */
  .stats-row {
    flex-direction: column;
  }

  /* Responsive Grid */
  .admin-form-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  /* Overlay for sidebar */
  .admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
  }
  .admin-overlay.active {
    display: block;
  }
}
