@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap");

:root {
  /* Premium Dark Theme Palette */
  --bg-dark: #050505;
  --bg-card: #101010;
  --bg-glass: rgba(20, 20, 20, 0.7);

  --text-main: #ffffff;
  --text-muted: #9ca3af;

  /* Scania/Automotive Brand Colors */
  --brand-blue: #0056b3;
  /* Deep Blue */
  --brand-gold: #d4af37;
  /* Metallic Gold */
  --brand-red: #dc2626;
  /* Performance Red */

  --gradient-gold: linear-gradient(135deg, #d4af37, #fcd34d);
  --gradient-blue: linear-gradient(135deg, #1e3a8a, #3b82f6);

  --border-glass: 1px solid rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.1);

  --font-main: "Cairo", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  background-image: radial-gradient(
      circle at 10% 20%,
      rgba(0, 86, 179, 0.15) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(212, 175, 55, 0.08) 0%,
      transparent 20%
    );
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-gold);
}

/* --- Header & Nav --- */
.main-header {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-glass);
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.5rem;
  color: white;
  letter-spacing: 1px;
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo span {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

nav a:hover,
nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* --- Search Bar --- */
.search-container {
  position: relative;
  width: 300px;
  margin-right: 2rem;
}

.search-container input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: 50px;
  width: 100%;
  color: white;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.search-container input:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--brand-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.9rem;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  padding: 4rem 5%;
  max-width: 1600px;
  margin: 0 auto;
}

.product-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: var(--border-glass);
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.05);
}

/* --- Video Facade (Click to Play) --- */
.product-media {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #000;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.product-card:hover .product-media img {
  transform: scale(1.08);
}

.video-facade {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.video-facade:hover .video-thumb {
  opacity: 0.4;
  transform: scale(1.05);
}

.play-button {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(212, 175, 55, 0.2);
  border: 2px solid var(--brand-gold);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--brand-gold);
  font-size: 1.5rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s;
  z-index: 5;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.video-facade:hover .play-button {
  background: var(--brand-gold);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.video-active {
  width: 100%;
  height: 100%;
}

.category-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.category-badge.used {
  background: rgba(220, 38, 38, 0.8);
  color: white;
}

.category-badge.new {
  background: rgba(5, 150, 105, 0.8);
  color: white;
}

.category-badge.service {
  background: rgba(217, 119, 6, 0.8);
  color: white;
}

.card-content {
  padding: 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 20, 0) 0%,
    rgba(10, 10, 10, 0.8) 100%
  );
}

.card-content h3 {
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.card-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  min-height: 3rem;
}

.contact-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  padding: 0.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
  margin-top: auto;
}

.contact-btn:hover {
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* --- Floating Contact Widget --- */
.floating-contact {
  position: fixed;
  bottom: 30px;
  left: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 2000;
}

.social-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn img {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.social-btn:hover {
  transform: scale(1.1) translateY(-5px);
}

.whatsapp:hover {
  background: #25d366;
}

.telegram:hover {
  background: #0088cc;
}

/* --- Footer --- */
.main-footer {
  background: #080808;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4rem 5% 2rem;
  margin-top: 5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  max-width: 1600px;
  margin: 0 auto;
}

.footer-col h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--brand-gold);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: var(--brand-gold);
  padding-right: 5px;
}

.footer-bottom {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #555;
  font-size: 0.9rem;
}

/* Admin Dashboard Overrides */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  background: #080808;
  border-left: var(--border-glass);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: var(--border-glass);
}

.sidebar-logo img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 2px solid var(--brand-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.nav-item {
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.3s;
  background: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border-right: 3px solid var(--brand-gold);
}

/* Forms */
.form-card {
  background: #0f0f0f;
  border: var(--border-glass);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

input,
select,
textarea {
  width: 100%;
  padding: 1.2rem;
  background: #050505;
  border: 1px solid #333;
  border-radius: 10px;
  color: white;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
  outline: none;
}

label {
  font-weight: 700;
  color: white;
  margin-bottom: 0.8rem;
  display: block;
  font-size: 0.95rem;
}

.upload-area {
  border: 2px dashed #333;
  border-radius: 15px;
  padding: 4rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.01);
}

.upload-area:hover {
  border-color: var(--brand-gold);
  background: rgba(212, 175, 55, 0.05);
}

.btn-primary {
  background: var(--gradient-gold);
  color: #000;
  /* Contrast for gold */
  font-weight: 800;
  padding: 1.2rem;
  border-radius: 12px;
  border: none;
  font-size: 1.1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
  background: #eab308;
}

/* Responsive */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 1rem;
  }

  .search-container {
    width: 100%;
    margin: 0;
  }

  .product-grid {
    padding: 2rem 5%;
    grid-template-columns: 1fr;
  }

  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 1rem;
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    justify-content: space-between;
    border-left: none;
    border-bottom: 1px solid #333;
  }

  .sidebar-logo {
    display: none;
  }

  .floating-contact {
    left: 20px;
    bottom: 20px;
  }
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--brand-gold);
  padding: 5px;
  animation: pulse-gold 2s infinite;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

@keyframes pulse-gold {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 20px rgba(212, 175, 55, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
}

.loader-text {
  margin-top: 1.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brand-gold);
  letter-spacing: 2px;
  animation: fadeText 1.5s infinite alternate;
}

@keyframes fadeText {
  from { opacity: 0.5; }
  to { opacity: 1; }
}
