/* ============================================================
   MdeVins — Modern UI Stylesheet v3
   Premium, Mobile-First App Design
   ============================================================ */
:root {
  /* Brand Colors */
  --brand-primary: #2563eb;       /* Modern Blue */
  --brand-primary-hover: #1d4ed8;
  --brand-secondary: #0ea5e9;     /* Vibrant Cyan-Blue */
  --brand-accent: #38bdf8;
  
  /* Semantic Colors */
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  
  /* Neutral Colors */
  --bg-app: #f8fafc;              /* Soft off-white for app background */
  --bg-card: #ffffff;
  --text-main: #0f172a;           /* Deep slate */
  --text-muted: #64748b;          /* Soft slate for labels */
  --border-color: #e2e8f0;
  --border-color-focus: #93c5fd;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* UI Elements */
  --radius-card: 16px;
  --radius-input: 12px;
  --radius-button: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-btn: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

/* ---- Global Typography & Background ---- */
body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout & Container ---- */
section {
  padding-top: 5.5rem !important; /* Navbar offset */
}
@media (max-width: 768px) {
  section { padding-top: 4.5rem !important; }
}

/* Remove side margins on mobile */
@media (max-width: 768px) {
  .col-12 { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* ---- Navbar Modernization ---- */
#mainNav {
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1rem !important;
}
#mainNav .navbar-brand h1 {
  font-family: var(--font-family) !important;
  font-weight: 700;
  font-size: 1.5rem !important;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.navbar-toggler {
  border: none !important;
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 0.5rem 0.75rem !important;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card) !important;
  border: none !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-md) !important;
  margin-bottom: 1.5rem !important;
  overflow: hidden;
}
.card-body {
  padding: 1.5rem !important;
}
@media (max-width: 768px) {
  .card-body { padding: 1.25rem 1rem !important; }
}
.card-title {
  font-weight: 700 !important;
  color: var(--text-main) !important;
  font-size: 1.2rem;
}

/* ---- Typography Helpers ---- */
hr {
  border-top-color: var(--border-color) !important;
  margin: 1.25rem 0;
}
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted-custom { color: var(--text-muted) !important; }

/* ---- Form Labels ---- */
.form-group label {
  display: block;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem !important;
  width: 100% !important;
}

/* ---- Inputs & Textareas ---- */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100% !important;
  background-color: #eff6ff !important; /* Soft light blue tint */
  border: 1.5px solid #bfdbfe !important; /* Soft blue border to match */
  border-radius: var(--radius-input) !important;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  color: var(--text-main) !important;
  transition: all 0.2s ease-in-out;
  height: auto !important;
}
.form-control:focus, textarea:focus {
  background-color: #ffffff !important;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
  outline: none;
}
textarea { min-height: 100px !important; resize: vertical; }

/* ---- Card Title ---- */
.wl-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
}
.wl-user {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-primary);
}

/* ---- Bootstrap Select Overrides — Subtle Blue Tint button ---- */
.bootstrap-select > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle.btn-light,
.bootstrap-select > .dropdown-toggle.btn-info,
.bootstrap-select > .dropdown-toggle.btn-primary {
  background: #eff6ff !important; /* Soft light blue tint */
  border: 1.5px solid #bfdbfe !important; /* Soft blue border to match */
  border-radius: var(--radius-input) !important;
  color: var(--text-main) !important;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  height: auto !important;
  min-height: 48px;
  display: flex !important;
  align-items: center;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select > .dropdown-toggle:active {
  background: #ffffff !important;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}
/* Caret icon color */
.bootstrap-select > .dropdown-toggle::after {
  color: var(--brand-primary) !important;
}
/* Dropdown selected text — force dark color */
.bootstrap-select .filter-option {
  color: var(--text-main) !important;
  font-weight: 500;
}
/* Live-search dropdown highlight — override Bootstrap green */
.bootstrap-select .dropdown-menu li.active > a,
.bootstrap-select .dropdown-menu li > a:hover,
.bootstrap-select .dropdown-menu li > a:focus {
  background-color: rgba(37, 99, 235, 0.08) !important;
  color: var(--brand-primary) !important;
}
.bootstrap-select .dropdown-menu li.selected > a {
  background-color: rgba(37, 99, 235, 0.12) !important;
  color: var(--brand-primary) !important;
  font-weight: 600;
}

/* ---- Inline Info Row (Chemist + Geo Location side-by-side) ---- */
.info-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.info-cell {
  flex: 1;
  min-width: 120px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}
.info-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.info-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.info-geo {
  font-size: 0.82rem !important;
  color: var(--brand-primary) !important;
  word-break: break-all;
}
#docLocationMapLink i {
  color: var(--danger-color);
  font-size: 14px;
}

/* ---- Geo location tagged confirmation span (below Tag Location button) ---- */
#geoLocSpan {
  font-size: 0.82rem;
  color: var(--brand-primary) !important;
  font-weight: 500;
  display: block;
  margin-top: 0.4rem;
  word-break: break-all;
}
.segmented-control {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-input);
  padding: 4px;
  width: 100%;
}
.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.5rem !important;
  margin: 0 !important;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  color: var(--text-muted) !important;
  text-transform: none !important;
  transition: all 0.2s ease;
}
.segmented-control input[type="radio"] {
  display: none;
}
.segmented-control input[type="radio"]:checked + label {
  background: var(--brand-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* ---- Primary Action Buttons ---- */
#submitWorkLog,
.btn-info,
.btn-primary,
.btn-primary.btn-block {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary)) !important;
  border: none !important;
  border-radius: var(--radius-button) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  padding: 0.85rem 1.5rem !important;
  width: 100% !important;
  box-shadow: var(--shadow-btn) !important;
  transition: all 0.2s ease;
  height: auto !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#submitWorkLog:active, .btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

/* ---- Secondary Buttons (Add / Delete / Tag Location) ---- */
.btn-action {
  border-radius: var(--radius-button) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  border: none !important;
  transition: all 0.2s;
  height: auto !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-add { background: #dcfce7 !important; color: #166534 !important; }
.btn-add:active { background: #bbf7d0 !important; }

.btn-delete { background: #fee2e2 !important; color: #991b1b !important; }
.btn-delete:active { background: #fecaca !important; }

.btn-location { 
  background: var(--brand-primary) !important; 
  color: #ffffff !important; 
  border: none !important;
  width: 100% !important;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
}
.btn-location:active { background: var(--brand-primary-hover) !important; }

/* ---- Override custom.css harsh black table borders ---- */
#productOrderTable,
#productOrderTable td,
#productOrderTable th,
#productOrderTable tr {
  border: none !important;
}
#productOrderTable th {
  background: #f8fafc !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.65rem 0.5rem !important;
  border-bottom: 1.5px solid var(--border-color) !important;
}
#productOrderTable td {
  padding: 0.65rem 0.5rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.88rem;
  vertical-align: middle;
  color: var(--text-main);
}
#productOrderTable tr:last-child td {
  border-bottom: none !important;
}

/* ---- Success text — override Bootstrap green ---- */
.text-success,
#workLogFormMsgSuccess {
  color: var(--success-color) !important;
}

/* ---- Segmented pill toggle ---- */

/* ---- Input Group Layouts ---- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .input-group {
    flex-direction: row;
  }
  .input-group > * {
    flex: 1;
  }
}

/* ---- Helper spacing ---- */
.mb-2 { margin-bottom: 0.75rem !important; }
.mt-3 { margin-top: 1.25rem !important; }
.mt-4 { margin-top: 2rem !important; }

/* ---- Form Error / Success Messages ---- */
#workLogFormMsgSuccess { color: var(--success-color) !important; font-weight: 600; }
#workLogFormMsgFailure { color: var(--danger-color) !important; font-weight: 600; }

/* ---- Dynamic Info Spans (Geo Location, Chemist, Grand Total) ---- */
#chemistSpan, #docLocation, #grandTotal {
  font-size: 1rem !important;
  color: var(--text-main) !important;
  font-weight: 500;
  display: inline-block;
  padding-top: 0.2rem;
}
#docLocation {
  color: var(--brand-primary) !important;
}
#grandTotal {
  font-size: 1.2rem !important;
  font-weight: 700;
  color: var(--brand-primary) !important;
}
