/* Agri Theme Customizations */
:root {
  --bs-primary: #2e7d32;
  --bs-success: #2e7d32;
  --bs-body-bg: #f5f5f9;
  --primary: #2e7d32;
  --secondary: #8592a3;
  --agri-dark: #1b5e20;
  --agri-light: #e8f5e9;
  --sidebar-bg: #1b5e20;
  --sidebar-text: #e8f5e9;
  --sidebar-active-bg: rgba(255, 255, 255, 0.15);
  --sidebar-gradient-start: #2e7d32; /* Soft Dark Green */
  --sidebar-gradient-end: #1b5e20; /* Darker Green end */
}

/* General Typography */
body {
  font-family: 'Public Sans', sans-serif;
  color: #566a7f;
  background-color: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6 {
  color: #384551;
  font-weight: 600;
}

/* Sidebar Styling */
#layout-menu {
  background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%) !important;
  box-shadow: 4px 0 12px 0 rgba(0, 0, 0, 0.1);
}

#layout-menu .menu-link {
  color: var(--sidebar-text) !important;
  transition: all 0.2s ease-in-out;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 0.5rem;
}

#layout-menu .menu-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
  color: #fff !important;
}

/* Active Menu Item */
#layout-menu .menu-item.active .menu-link {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 10px 0 rgba(0,0,0,0.1);
}

/* Sidebar Icons */
#layout-menu .menu-icon {
  color: inherit !important;
  font-size: 1.4rem;
}

/* Brand Text Styling */
.brand-text {
    color: #ffffff !important;
    font-size: 1.25rem !important;
    text-transform: capitalize !important; /* "Chitra Crop Science" */
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 6px;
    display: inline-block;
}
/* Admin Branding (header) */
.agri-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.agri-logo {
  height: 42px;
  width: auto;
}
/* Constrain Django admin header branding */
#header { background-color: #ffffff; }
#header .agri-brand { padding: 8px 12px; }
#header .agri-logo { height: 36px !important; width: auto !important; }
#header img { height: 36px !important; width: auto !important; }
#header #site-name { font-size: 20px; margin: 0; color: #2e7d32; }
/* Accent line */
.brand-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background-color: #a5d6a7; /* Light Green Accent */
    border-radius: 2px;
}

/* Section Headings */
#layout-menu .menu-header-text {
  color: #c8e6c9 !important; /* Muted Light Green */
  opacity: 0.9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Hide Decorative Dots/Lines */
#layout-menu .menu-item.active::before,
#layout-menu .menu-header::before {
    display: none !important;
}

/* Button Styling */
.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  box-shadow: 0 2px 4px 0 rgba(46, 125, 50, 0.3);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 0.375rem;
}

.btn-primary:hover {
  background-color: var(--agri-dark);
  border-color: var(--agri-dark);
  transform: translateY(-1px); /* Subtle hover */
  box-shadow: 0 4px 8px 0 rgba(46, 125, 50, 0.4);
}

.btn-outline-secondary {
  color: #566a7f;
  border-color: #d9dee3;
  background-color: transparent;
  border-radius: 0.375rem;
}
.btn-outline-secondary:hover {
  background-color: #f5f5f9;
  color: #333;
  border-color: #8592a3;
}

/* Card Styling */
.card {
  border: 0;
  box-shadow: 0 2px 12px 0 rgba(67, 89, 113, 0.06); /* Softer shadow */
  border-radius: 12px; /* Consistent rounding */
  margin-bottom: 1.5rem;
  background-color: #fff;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 16px 0 rgba(67, 89, 113, 0.1);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.5rem 1.5rem;
  background-color: transparent;
  border-bottom: 1px solid #f0f2f4;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.5rem 1.5rem;
}

/* Table Styling */
.table th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: #1b5e20; /* Dark Green Text */
  border-bottom: 2px solid #e8f5e9;
  background-color: #fafbfc;
  font-weight: 700;
  padding: 1rem;
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  color: #697a8d;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f1f8e9 !important;
}

/* Form Styling */
.form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: #566a7f;
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  border-radius: 0.5rem;
  border: 1px solid #d9dee3;
  padding: 0.6rem 1rem;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.15);
}

/* Search Bar Refinements (Modern, Minimal) */
.search-box-wrapper {
    background-color: #f0f2f5; /* Light grey pill */
    border-radius: 50px;
    padding: 0.2rem 0.8rem;
    transition: all 0.3s ease;
    width: 300px; /* Fixed width for better look */
    display: flex;
    align-items: center;
}
.search-box-wrapper:hover, .search-box-wrapper:focus-within {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15); /* Green glow */
}
.search-input {
    background: transparent !important;
    padding-left: 0.5rem;
    font-size: 0.95rem;
    color: #566a7f;
}
.search-input::placeholder {
    color: #a1acb8;
}
.navbar .bx-search {
    color: var(--bs-primary);
    font-size: 1.2rem;
}

/* Text Colors */
.text-primary { color: var(--bs-primary) !important; }
.text-success { color: var(--bs-primary) !important; }
.text-muted { color: #a1acb8 !important; }

/* Badges */
.bg-label-success {
  background-color: #e8f5e9 !important;
  color: #1b5e20 !important;
  font-weight: 700;
}
.bg-label-secondary {
  background-color: #f2f2f3 !important;
  color: #697a8d !important;
}
.bg-label-warning {
  background-color: #fff3e0 !important;
  color: #ff9800 !important;
}
.bg-label-info {
  background-color: #e3f2fd !important;
  color: #0288d1 !important;
}
.bg-label-primary {
  background-color: #e8f5e9 !important; /* Reusing light green for primary to match theme */
  color: #2e7d32 !important;
}
.bg-label-danger {
  background-color: #ffebee !important;
  color: #c62828 !important;
}

/* Django Form Rendering (form.as_p) */
form p {
  margin-bottom: 1.5rem;
}
form p label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: #566a7f;
}
form p input[type="text"],
form p input[type="password"],
form p input[type="email"],
form p input[type="number"],
form p input[type="url"],
form p input[type="file"],
form p textarea,
form p select {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: #566a7f;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d9dee3;
  appearance: none;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
form p input:focus,
form p textarea:focus,
form p select:focus {
  border-color: var(--bs-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.15);
}

/* Django admin login tweaks */
.login #header { display: none; }
.login #content { max-width: 420px; margin: 4rem auto; }
.login .submit-row input { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.login .submit-row input:hover { background-color: var(--agri-dark); border-color: var(--agri-dark); }
form p .helptext {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #8592a3;
  font-style: italic;
}
