/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --transition: all 0.3s ease;
  --whatsapp-green: #25D366;
  --accent-color: #e74c3c;
  --border-color: #eeeeee;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  direction: rtl;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  font-size: 1.5rem;
  color: var(--text-main);
  transition: var(--transition);
}

.social-icons a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.social-icons .whatsapp-icon { color: var(--whatsapp-green); }
.social-icons .instagram-icon { color: #E1306C; }
.social-icons .facebook-icon { color: #1877F2; }
.social-icons .tiktok-icon { color: #000000; }

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 5%;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* Product Card */
.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.product-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  width: 100%;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: #333;
}

.btn-whatsapp {
  background-color: var(--whatsapp-green);
  color: #fff;
}

.btn-whatsapp:hover {
  background-color: #20b858;
}

/* Footer */
footer {
  background-color: var(--card-bg);
  padding: 30px 5%;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

.footer-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-main);
}

.footer-social .social-icons {
  justify-content: center;
}

.footer-social .social-icons a {
  font-size: 2rem;
}

/* Admin Styles */
.admin-container {
  max-width: 800px;
  margin: 50px auto;
  padding: 30px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.login-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-weight: 500;
}

.form-control {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
}

/* Admin Dashboard */
.admin-dashboard {
  display: none;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius);
}

.admin-form .form-group:last-child {
  grid-column: span 2;
}

.admin-products-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-products-table th,
.admin-products-table td {
  padding: 15px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}

.admin-products-table th {
  background: var(--bg-color);
  font-weight: 700;
}

.admin-products-table img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.btn-danger {
  background-color: var(--accent-color);
  color: white;
  width: auto;
  padding: 8px 12px;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-edit {
  background-color: #3498db;
  color: white;
  width: auto;
  padding: 8px 12px;
}

.btn-edit:hover {
  background-color: #2980b9;
}

.action-buttons {
  display: flex;
  gap: 5px;
}

@media (max-width: 600px) {
  .admin-form {
    grid-template-columns: 1fr;
  }
  .admin-form .form-group:last-child {
    grid-column: 1;
  }
  .admin-products-table th,
  .admin-products-table td {
    padding: 10px 5px;
  }
  .action-buttons {
    flex-direction: column;
  }
  .product-title {
    font-size: 1rem;
  }
  .product-price {
    font-size: 1rem;
  }
  .btn {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
  .logo {
    font-size: 1.4rem;
  }
}
