/* =============================================

   Delivery App – Shared Styles

   White Theme | Bulgarian UI

   ============================================= */



@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');



/* ── Variables ── */

:root {

  /* Surfaces */

  --bg:       #f2f8fb;

  --surface:  #ffffff;

  --surface2: #e8f4fa;

  --surface3: #d6ebf5;



  /* Accents */

  --accent:   #3399cc;

  --accent2:  #66b3d9;



  /* Text */

  --text:       #123040;

  --text-muted: #5f7d8c;



  /* Urgency */

  --low:      #22c55e;

  --normal:   #3399cc;

  --high:     #f59e0b;

  --critical: #ef4444;



  /* UI */

  --border:  rgba(51, 153, 204, 0.15);

  --shadow:  0 2px 12px rgba(51, 153, 204, 0.12);

  --radius:  14px;

}



@media screen and (-webkit-min-device-pixel-ratio:0) { 

  select,

  textarea,

  input {

    font-size: 16px;

  }

}





/* ── Reset ── */

*, *::before, *::after { box-sizing: border-box; }



body {

  background: var(--bg);

  color: var(--text);

  font-family: 'DM Sans', sans-serif;

  min-height: 100vh;

  min-height: 100dvh;

  margin: 0;

  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));

}



/* =============================================

   HEADER

   ============================================= */

.app-header {

  background: var(--surface);

  border-bottom: 1px solid var(--border);

  padding: 18px 20px 14px;

  position: sticky;

  top: 0;

  z-index: 100;

  box-shadow: 0 1px 6px rgba(0,0,0,0.06);

}



.app-title {

  font-family: 'Syne', sans-serif;

  font-weight: 800;

  font-size: 1.4rem;

  margin: 0;

  letter-spacing: -0.5px;

  color: var(--text);

}



.app-title .accent { color: var(--accent); }



/* ── Nav Pills (Request page) ── */

.nav-pills-custom {

  display: flex;

  gap: 8px;

  margin-top: 12px;

}



.nav-pill {

  flex: 1;

  padding: 10px 12px;

  border-radius: 10px;

  border: 1.5px solid var(--border);

  background: transparent;

  color: var(--text-muted);

  font-family: 'DM Sans', sans-serif;

  font-size: 0.85rem;

  font-weight: 500;

  text-decoration: none;

  text-align: center;

  transition: all 0.2s;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

}



.nav-pill.active {

  background: var(--accent);

  border-color: var(--accent);

  color: #fff;

  font-weight: 600;

}



.nav-pill:hover:not(.active) {

  border-color: var(--accent);

  color: var(--text);

  background: rgba(232,73,30,0.04);

}



/* ── Tab Bar (Delivery page) ── */

.tab-bar {

  display: flex;

  gap: 0;

}



.tab-item {

  flex: 1;

  padding: 12px 8px;

  border: none;

  background: transparent;

  color: var(--text-muted);

  font-family: 'DM Sans', sans-serif;

  font-size: 0.85rem;

  font-weight: 500;

  cursor: pointer;

  border-bottom: 2px solid transparent;

  transition: all 0.2s;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

  text-decoration: none;

}



.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-item:hover:not(.active) { color: var(--text); }



.tab-badge {

  background: var(--critical);

  color: #fff;

  font-size: 0.65rem;

  font-weight: 700;

  padding: 2px 6px;

  border-radius: 10px;

  line-height: 1.2;

}



.tab-badge.green { background: var(--low); }



/* ── Header top row ── */

.header-top {

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 14px;

}



.refresh-btn {

  width: 38px;

  height: 38px;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: var(--surface2);

  color: var(--text-muted);

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  transition: all 0.2s;

}



.refresh-btn:hover { background: var(--surface3); color: var(--text); }

.refresh-btn.spinning i { animation: spin 0.7s linear infinite; }



/* =============================================

   STATS BAR

   ============================================= */

.stats-bar {

  display: grid;

  grid-template-columns: 1fr 1fr 1fr 1fr;

  gap: 8px;

  padding: 12px 16px;

  background: var(--surface);

  border-bottom: 1px solid var(--border);

}



.stat-item {

  background: var(--surface2);

  border-radius: 10px;

  padding: 10px 8px;

  text-align: center;

}



.stat-num {

  font-family: 'Syne', sans-serif;

  font-weight: 800;

  font-size: 1.3rem;

  line-height: 1;

}



.stat-num.critical { color: var(--critical); }

.stat-num.high     { color: var(--high); }

.stat-num.normal   { color: var(--normal); }

.stat-num.done     { color: var(--low); }



.stat-label {

  font-size: 0.65rem;

  color: var(--text-muted);

  margin-top: 3px;

  font-weight: 500;

}



/* =============================================

   MAIN CONTENT

   ============================================= */

.main-content {

  padding: 20px 16px;

  max-width: 520px;

  margin: 0 auto;

}



.section-label {

  font-family: 'Syne', sans-serif;

  font-weight: 700;

  font-size: 0.68rem;

  letter-spacing: 2px;

  text-transform: uppercase;

  color: var(--text-muted);

  margin-bottom: 14px;

}



/* =============================================

   FORM (Request page)

   ============================================= */

.form-card {

  background: var(--surface);

  border-radius: var(--radius);

  border: 1px solid var(--border);

  padding: 24px 20px;

  margin-bottom: 16px;

  box-shadow: var(--shadow);

}



.field-group { margin-bottom: 20px; }

.field-group:last-child { margin-bottom: 0; }



.form-label-custom {

  font-family: 'DM Sans', sans-serif;

  font-size: 0.82rem;

  font-weight: 600;

  color: var(--text-muted);

  margin-bottom: 8px;

  display: block;

  letter-spacing: 0.3px;

}



.form-control-custom {

  background: var(--surface2);

  border: 1.5px solid var(--border);

  border-radius: 10px;

  color: var(--text);

  padding: 13px 15px;

  font-family: 'DM Sans', sans-serif;

  font-size: 0.95rem;

  width: 100%;

  transition: border-color 0.2s, box-shadow 0.2s;

  outline: none;

  -webkit-appearance: none;

}



.form-control-custom:focus {

  border-color: var(--accent);

  box-shadow: 0 0 0 3px rgba(30, 194, 232, 0.1);

  background: var(--surface);

}



.form-control-custom::placeholder { color: rgba(107,114,128,0.5); }

.form-control-custom.is-invalid { border-color: var(--critical) !important; }



textarea.form-control-custom {

  resize: none;

  min-height: 80px;

}



input[type="file"].form-control-custom {

  padding: 10px 12px;

}



input[type="file"].form-control-custom::file-selector-button {

  border: none;

  border-radius: 8px;

  padding: 8px 12px;

  margin-right: 10px;

  background: var(--accent);

  color: #fff;

  font-weight: 600;

  cursor: pointer;

}



.link-hint {

  font-size: 0.78rem;

  color: var(--text-muted);

  margin-top: 6px;

  display: flex;

  align-items: center;

  gap: 5px;

}



.detected-link {

  background: rgba(37,99,235,0.05) !important;

  border-color: rgba(37,99,235,0.3) !important;

}



/* ── Urgency Grid ── */

.urgency-grid {

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;

}



.urgency-btn {

  padding: 14px 10px;

  border-radius: 12px;

  border: 2px solid var(--border);

  background: var(--surface2);

  cursor: pointer;

  transition: all 0.2s;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 4px;

}



.urgency-btn .urgency-icon  { font-size: 1.4rem; }

.urgency-btn .urgency-label { font-family: 'DM Sans',sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.urgency-btn .urgency-desc  { font-size: 0.7rem; color: rgba(107,114,128,0.6); }



.urgency-btn:hover:not(.selected) { border-color: rgba(0,0,0,0.2); transform: translateY(-1px); }



.urgency-btn[data-value="low"].selected      { border-color: var(--low);      background: rgba(22,163,74,0.08); }

.urgency-btn[data-value="low"].selected .urgency-label { color: var(--low); }

.urgency-btn[data-value="normal"].selected   { border-color: var(--normal);   background: rgba(37,99,235,0.07); }

.urgency-btn[data-value="normal"].selected .urgency-label { color: var(--normal); }

.urgency-btn[data-value="high"].selected     { border-color: var(--high);     background: rgba(217,119,6,0.08); }

.urgency-btn[data-value="high"].selected .urgency-label { color: var(--high); }

.urgency-btn[data-value="critical"].selected { border-color: var(--critical); background: rgba(220,38,38,0.08); }

.urgency-btn[data-value="critical"].selected .urgency-label { color: var(--critical); }



/* ── Submit Button ── */

.btn-submit {

  width: 100%;

  padding: 16px;

  border-radius: 12px;

  background: var(--accent);

  border: none;

  color: #fff;

  font-family: 'Syne', sans-serif;

  font-weight: 700;

  font-size: 1rem;

  letter-spacing: 0.3px;

  cursor: pointer;

  transition: all 0.2s;

  box-shadow: 0 4px 14px rgba(30, 194, 232, 0.1)

}



.btn-submit:hover { background: #cf3e16; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,73,30,0.3); }

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }



.btn-submit .spinner {

  display: none;

  width: 20px;

  height: 20px;

  border: 2px solid rgba(255,255,255,0.3);

  border-top-color: #fff;

  border-radius: 50%;

  animation: spin 0.7s linear infinite;

  margin: 0 auto;

}



/* =============================================

   RECENT ORDERS (Request page)

   ============================================= */

.recent-order {

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 12px;

  padding: 14px 16px;

  margin-bottom: 10px;

  display: flex;

  align-items: flex-start;

  gap: 12px;

  box-shadow: var(--shadow);

  animation: slideIn 0.3s ease;

}



.urgency-dot {

  width: 10px;

  height: 10px;

  border-radius: 50%;

  flex-shrink: 0;

  margin-top: 5px;

}



.urgency-dot.low      { background: var(--low); }

.urgency-dot.normal   { background: var(--normal); }

.urgency-dot.high     { background: var(--high); }

.urgency-dot.critical { background: var(--critical); box-shadow: 0 0 8px rgba(220,38,38,0.4); }



.order-product {

  font-weight: 600;

  font-size: 0.92rem;

  margin-bottom: 3px;

  word-break: break-word;

  color: var(--text);

}



.order-meta { font-size: 0.78rem; color: var(--text-muted); }



.badge-urgency {

  font-size: 0.68rem;

  padding: 3px 8px;

  border-radius: 20px;

  font-weight: 600;

  display: inline-flex;

  align-items: center;

  gap: 3px;

}



.badge-low      { background: rgba(22,163,74,0.12);  color: var(--low); }

.badge-normal   { background: rgba(37,99,235,0.12);  color: var(--normal); }

.badge-high     { background: rgba(217,119,6,0.12);  color: var(--high); }

.badge-critical { background: rgba(220,38,38,0.12);  color: var(--critical); }



/* =============================================

   ORDER CARDS (Delivery page)

   ============================================= */

.order-card {

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  margin-bottom: 10px;

  overflow: hidden;

  transition: all 0.25s;

  box-shadow: var(--shadow);

  animation: cardIn 0.3s ease;

}



.order-card.critical { border-left: 3px solid var(--critical); animation: cardIn 0.3s ease, pulse 2s infinite 1s; }

.order-card.high     { border-left: 3px solid var(--high); }

.order-card.normal   { border-left: 3px solid var(--normal); }

.order-card.low      { border-left: 3px solid var(--low); }

.order-card.completed-card { border-left: 3px solid var(--surface3); opacity: 0.75; }



.order-card-body { padding: 14px 16px; }



.order-top {

  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 10px;

  margin-bottom: 8px;

}



.order-card .order-product {

  font-weight: 600;

  font-size: 0.95rem;

  line-height: 1.4;

  flex: 1;

  word-break: break-word;

  color: var(--text);

}



.order-card .order-product a { color: var(--normal); text-decoration: underline; text-underline-offset: 3px; }



.order-image-link {

  display: block;

  margin-bottom: 10px;

}



.order-image-thumb {

  width: 100%;

  max-height: 320px;

  object-fit: cover;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: var(--surface2);

}



.urgency-pill {

  font-size: 0.72rem;

  font-weight: 700;

  padding: 4px 10px;

  border-radius: 20px;

  white-space: nowrap;

  flex-shrink: 0;

}



.pill-critical { background: rgba(220,38,38,0.12);  color: var(--critical); }

.pill-high     { background: rgba(217,119,6,0.12);  color: var(--high); }

.pill-normal   { background: rgba(37,99,235,0.12);  color: var(--normal); }

.pill-low      { background: rgba(22,163,74,0.12);  color: var(--low); }



.order-meta-row {

  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 12px;

  margin-bottom: 12px;

}



.meta-chip {

  display: flex;

  align-items: center;

  gap: 5px;

  font-size: 0.8rem;

  color: var(--text-muted);

}



.meta-chip strong { color: var(--text); }



/* ── Action Buttons ── */

.order-actions { display: flex; gap: 8px; }



.btn-complete {

  flex: 1;

  padding: 6px;

  border-radius: 10px;

  border: none;

  background: var(--low);

  color: #fff;

  font-family: 'DM Sans', sans-serif;

  font-weight: 600;

  font-size: 0.88rem;

  cursor: pointer;

  transition: all 0.2s;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

  box-shadow: 0 3px 10px rgba(22,163,74,0.2);

}



.btn-complete:hover { background: #15803d; }

.btn-complete:active { transform: scale(0.98); }



.btn-icon {

  width: 42px;

  height: 42px;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: var(--surface2);

  color: var(--text-muted);

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  transition: all 0.2s;

  font-size: 1rem;

}



.btn-icon:hover { background: var(--surface3); color: var(--text); }

.btn-icon.danger:hover { background: rgba(220,38,38,0.08); color: var(--critical); border-color: rgba(220,38,38,0.3); }



.btn-reopen {

  flex: 1;

  padding: 10px;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: transparent;

  color: var(--text-muted);

  font-family: 'DM Sans', sans-serif;

  font-weight: 500;

  font-size: 0.82rem;

  cursor: pointer;

  transition: all 0.2s;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

}



.btn-reopen:hover { background: var(--surface2); color: var(--text); }



/* ── Completed notes snippet ── */

.order-notes-snippet {

  font-size: 0.8rem;

  color: var(--text-muted);

  background: var(--surface2);

  padding: 8px 12px;

  border-radius: 8px;

  margin-bottom: 10px;

}



/* =============================================

   SECTION DIVIDER

   ============================================= */

.section-divider {

  display: flex;

  align-items: center;

  gap: 12px;

  margin: 16px 0 12px;

}



.section-divider-line { flex: 1; height: 1px; background: var(--border); }



.section-divider-label {

  font-size: 0.72rem;

  font-weight: 700;

  letter-spacing: 1.5px;

  text-transform: uppercase;

  color: var(--text-muted);

  white-space: nowrap;

}



.completed-badge {

  background: rgba(22,163,74,0.1);

  color: var(--low);

  font-size: 0.72rem;

  padding: 3px 10px;

  border-radius: 20px;

  font-weight: 600;

  display: inline-flex;

  align-items: center;

  gap: 4px;

}



/* =============================================

   EMPTY STATES

   ============================================= */

.empty-state {

  text-align: center;

  padding: 50px 20px;

  color: var(--text-muted);

}



.empty-icon  { font-size: 3rem; margin-bottom: 12px; opacity: 0.45; }

.empty-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 6px; color: var(--text); }

.empty-sub   { font-size: 0.85rem; }



/* =============================================

   BOTTOM NAV (Delivery page)

   ============================================= */

.bottom-nav {

  position: fixed;

  bottom: 0;

  left: 0;

  right: 0;

  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));

  background: var(--surface);

  border-top: 1px solid var(--border);

  z-index: 100;

  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);

}



body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }



.btn-go-request {

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  padding: 14px;

  background: var(--surface2);

  border: 1px solid var(--border);

  border-radius: 12px;

  color: var(--text-muted);

  text-decoration: none;

  font-size: 0.88rem;

  font-weight: 500;

  transition: all 0.2s;

}



.btn-go-request:hover { background: var(--surface3); color: var(--text); }



/* =============================================

   TOAST

   ============================================= */

.toast-container-custom {

  position: fixed;

  bottom: calc(20px + env(safe-area-inset-bottom, 0px));

  left: 50%;

  transform: translateX(-50%);

  z-index: 9999;

  width: calc(100% - 32px);

  max-width: 400px;

}



.toast-custom {

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: 14px;

  padding: 15px 20px;

  display: flex;

  align-items: center;

  gap: 12px;

  box-shadow: 0 12px 40px rgba(0,0,0,0.12);

  transform: translateY(80px);

  opacity: 0;

  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

}



.toast-custom.show { transform: translateY(0); opacity: 1; }

.toast-icon    { font-size: 1.4rem; flex-shrink: 0; }

.toast-message { font-size: 0.9rem; font-weight: 500; color: var(--text); }



/* =============================================

   MODALS

   ============================================= */

.modal-content {

  background: var(--surface) !important;

  border: 1px solid var(--border) !important;

  border-radius: 18px !important;

  color: var(--text) !important;

  box-shadow: 0 20px 60px rgba(0,0,0,0.12) !important;

}



.modal-header { border-bottom: 1px solid var(--border) !important; }

.modal-footer { border-top: 1px solid var(--border) !important; }

.modal-title  { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--text) !important; }



.form-control-dark {

  background: var(--surface2) !important;

  border: 1.5px solid var(--border) !important;

  border-radius: 10px !important;

  color: var(--text) !important;

  padding: 12px 14px !important;

  font-family: 'DM Sans', sans-serif !important;

}



.form-control-dark:focus {

  border-color: var(--low) !important;

  box-shadow: 0 0 0 3px rgba(22,163,74,0.12) !important;

  outline: none;

}



.form-control-dark::placeholder { color: rgba(107,114,128,0.5) !important; }



.btn-confirm-complete {

  background: var(--low);

  border: none;

  color: #fff;

  font-family: 'DM Sans', sans-serif;

  font-weight: 600;

  padding: 12px 20px;

  border-radius: 10px;

  cursor: pointer;

  transition: all 0.2s;

}



.btn-confirm-complete:hover { background: #15803d; }



.btn-cancel-modal {

  background: transparent;

  border: 1px solid var(--border);

  color: var(--text-muted);

  font-family: 'DM Sans', sans-serif;

  padding: 12px 20px;

  border-radius: 10px;

  cursor: pointer;

  transition: all 0.2s;

}



.btn-cancel-modal:hover { background: var(--surface2); color: var(--text); }



.btn-delete-confirm {

  background: var(--critical);

  border: none;

  color: #fff;

  font-family: 'DM Sans', sans-serif;

  font-weight: 600;

  padding: 12px 20px;

  border-radius: 10px;

  cursor: pointer;

  transition: all 0.2s;

}



.btn-delete-confirm:hover { background: #b91c1c; }



/* Bootstrap close btn override */

.btn-close { filter: invert(0.5) !important; }



/* =============================================

   ANIMATIONS

   ============================================= */

@keyframes spin    { to { transform: rotate(360deg); } }

@keyframes slideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

@keyframes cardIn  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

@keyframes shake   {

  0%,100% { transform:translateX(0); }

  20%     { transform:translateX(-6px); }

  40%     { transform:translateX(6px); }

  60%     { transform:translateX(-4px); }

  80%     { transform:translateX(4px); }

}

@keyframes pulse {

  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }

  50%     { box-shadow: 0 0 0 4px rgba(220,38,38,0.12); }

}