/* ShopKapilAgro Admin Dashboard - Modern UI */

:root {
  --primary: #2f9e44;
  --primary-light: #5acd6a;
  --primary-dark: #278a3a;
  --primary-bg: #f5fff5;
  --secondary: #6c757d;
  --success: #2f9e44;
  --danger: #dc3545;
  --warning: #ffc107;
  --light: #f8f9fa;
  --dark: #343a40;
  --border-radius: 10px;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

body {
  background-color: var(--primary-bg);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
}

/* ===== NAVBAR STYLING ===== */
.navbar {
  background-color: white !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  padding: 0.8rem 1.5rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.navbar .nav-link {
  position: relative;
  padding: 0.7rem 1rem;
  margin: 0 0.2rem;
  border-radius: 6px;
  font-weight: 500;
  transition: var(--transition);
}

.navbar .nav-link:hover {
  background-color: rgba(47, 158, 68, 0.08);
  color: var(--primary);
}

.navbar .nav-link.active {
  background-color: rgba(47, 158, 68, 0.12);
  color: var(--primary);
}

.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 10%;
  width: 80%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px;
}

/* Admin name badge */
#adminNameDisplay {
  font-weight: 600;
  color: var(--primary-dark);
  padding: 0.4rem 1rem;
  background-color: rgba(47, 158, 68, 0.12);
  border-radius: 20px;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
}

#adminNameDisplay:before {
  margin-right: 5px;
}

/* Logout button */
.btn-danger {
  background-color: #dc3545;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-danger:hover {
  background-color: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

/* ===== DASHBOARD HEADERS ===== */
h2.text-success {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2.text-success:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, rgba(47, 157, 68, 0.2) 0%, rgba(47, 157, 68, 1) 50%, rgba(47, 157, 68, 0.2) 100%);
  border-radius: 2px;
}

/* ===== CARD STYLING ===== */
.card {
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
  background-color: white;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(47, 157, 68, 0.1);
  border-color: rgba(47, 157, 68, 0.3);
}

.card-body {
  padding: 1.8rem;
}

.card-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.2rem;
  font-size: 1.25rem;
}

/* Dashboard menu cards */
.text-center.shadow-sm.h-100.border-success {
  border-top: 4px solid var(--primary) !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

/* Card headings */
.card h4.text-success {
  color: var(--primary-dark) !important;
  font-weight: 600;
  margin-bottom: 18px;
  font-size: 1.4rem;
}

/* Card descriptions */
.card p.text-muted {
  color: var(--secondary) !important;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== FORM STYLING ===== */
.form-control,
.form-select {
  border-radius: 8px;
  padding: 0.6rem 1rem;
  border: 1px solid #ced4da;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(47, 158, 68, 0.25);
  border-color: var(--primary-light);
}

label.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #495057;
}

/* ===== BUTTON STYLING ===== */
.btn {
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-success {
  background-color: var(--primary);
  border: none;
  color: white;
  box-shadow: 0 4px 6px rgba(47, 157, 68, 0.1);
}

.btn-success:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(47, 157, 68, 0.15);
}

.btn-success:active {
  transform: translateY(0);
}

.btn-outline-success {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-success:hover {
  background-color: var(--primary);
  color: white;
}

.btn-warning {
  background-color: var(--warning);
  border: none;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* ===== PRODUCT & CATEGORY CARDS ===== */
.productsContainer .card,
.categoriesContainer .card {
  height: 100%;
  transition: var(--transition);
}

.productsContainer .card-img-top,
.categoriesContainer .card-img-top {
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ===== MODAL STYLING ===== */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: var(--primary-bg);
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ===== UTILITIES ===== */
.shadow-sm {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

.text-success {
  color: var(--primary) !important;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 992px) {
  .navbar .navbar-toggler {
    border: none;
    padding: 0.5rem;
  }

  .navbar .navbar-toggler:focus {
    box-shadow: none;
  }

  .navbar-collapse {
    padding: 1rem 0;
  }

  .navbar .nav-link {
    padding: 0.5rem 1rem;
    margin: 0.2rem 0;
  }

  .container.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 768px) {
  .card-body {
    padding: 1.5rem;
  }

  h2.text-success {
    font-size: 1.8rem;
  }

  .btn {
    padding: 0.5rem 1rem;
  }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(47, 157, 68, 0.6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container.py-5 {
  animation: fadeIn 0.4s ease-out;
}