/* Responsive Styles */
/* Base styles for all devices */
:root {
  --primary-color: #2e7d32;
  --secondary-color: #1976d2;
  --bg-color: #f5f5f5;
  --text-color: #333;
  --card-bg: #ffffff;
  --sidebar-width: 250px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

/* Responsive navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: var(--card-bg);
  height: var(--header-height);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Responsive containers */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

/* Responsive sidebar */
.user-sidebar,
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--card-bg);
  padding: 20px 0;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 90;
}

.admin-sidebar {
  top: 0;
}

/* Responsive content area */
.content,
.admin-content {
  flex: 1;
  padding: 20px;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

/* Responsive cards */
.stat-card,
.action-card,
.order-card,
.product-card,
.wishlist-card,
.address-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin-bottom: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Responsive grids */
.stats-container,
.actions-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.products-grid,
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* Media Queries */
/* Tablet & Small Laptops */
@media screen and (max-width: 992px) {
  :root {
    --sidebar-width: 200px;
  }

  .stats-container,
  .actions-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .product-card,
  .wishlist-card {
    min-width: unset;
  }
}

/* Mobile devices (portrait) */
@media screen and (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .user-sidebar,
  .admin-sidebar {
    transform: translateX(-100%);
    width: 80%;
    max-width: 300px;
  }

  .user-sidebar.active,
  .admin-sidebar.active {
    transform: translateX(0);
  }

  .content,
  .admin-content {
    margin-left: 0;
  }

  .stats-container,
  .actions-container {
    grid-template-columns: 1fr;
  }

  .products-grid,
  .wishlist-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  /* Adjust forms for mobile */
  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100%;
  }

  /* Adjust tables for mobile */
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
  }

  td {
    border: none;
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  td:before {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    content: attr(data-label);
  }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  .navbar {
    padding: 0 10px;
  }

  .products-grid,
  .wishlist-grid {
    grid-template-columns: 1fr;
  }

  .home-btn span,
  .logout-btn span {
    display: none;
  }

  .user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-header h1 {
    font-size: 1.5rem;
  }
}

/* Animation for mobile menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 80;
}

.sidebar-overlay.active {
  display: block;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #d19a9a; /* warna latar belakang */
}

.container {
  display: flex;
  height: 100vh;
}

.left-side {
  flex: 1;
  background-color: #2d572c; /* warna hijau */
  color: white;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.left-side h1 {
  font-size: 48px;
  margin: 0;
}

.left-side h2 {
  font-size: 24px;
  margin: 0;
}

.left-side p {
  margin-top: 20px;
  font-size: 18px;
}

.right-side {
  flex: 1;
  background-color: white;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

form {
  width: 100%;
  max-width: 400px;
}

form h1 {
  text-align: center;
  margin-bottom: 20px;
}

form label {
  margin-top: 10px;
  display: block;
}

form input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.login-button {
  width: 100%;
  background-color: #4caf50; /* warna hijau tombol */
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  margin-top: 15px;
  cursor: pointer;
}

.login-button:hover {
  background-color: #45a049;
}

.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.options a {
  text-decoration: none;
}

.options p {
  text-align: center;
  margin-top: 20px;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 15px;
  background: #f5f5f5;
  border-radius: 25px;
}

.search-container input {
  border: none;
  background: none;
  padding: 8px;
  width: 300px;
  outline: none;
}

.cart-container {
  max-width: 1200px;
  margin: 80px auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.cart-summary {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.primary-button {
  background: #2e7d32;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.primary-button:hover {
  background: #1b5e20;
}

/* Notifikasi */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification {
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification.success {
  background: #4caf50;
  color: white;
}
.notification.error {
  background: #f44336;
  color: white;
}
.notification.info {
  background: #2196f3;
  color: white;
}

/* Wishlist */
.wishlist-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 5px;
}

.wishlist-btn.active {
  color: #f44336;
}

/* Admin Dashboard */
.admin-dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #1a237e;
  color: white;
  padding: 20px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* About Page Styles */
.about-container {
  margin-top: 80px;
  padding: 2rem 5%;
  max-width: 1200px;
  margin: 80px auto;
}

.about-content {
  margin-top: 2rem;
  line-height: 1.6;
}

/* Contact Page Styles */
.contact-container {
  margin-top: 80px;
  padding: 2rem 5%;
  max-width: 800px;
  margin: 80px auto;
}

.contact-info {
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.contact-form button {
  background: #2e7d32;
  color: white;
  padding: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.contact-form button:hover {
  background: #1b5e20;
}

.admin-logo,
.user-logo {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.admin-logo:hover,
.user-logo:hover {
  opacity: 0.8;
}

.home-btn {
  padding: 8px 15px;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.home-btn:hover {
  background: #1b5e20;
}

/* Menambahkan atau memodifikasi CSS untuk logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-container img {
  /* Ukuran logo yang lebih kecil */
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Memperbaiki alignment logo dengan teks */
.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  color: #2e7d32;
  text-decoration: none;
}
