/* public/fleet/fleet-tenders.css */

.ftd-container {
  padding: 1rem 0;
}

.ftd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.ftd-header h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.4rem;
}
.ftd-btn-dashboard {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
}
.ftd-btn-dashboard:hover {
  background: #475569;
}

/* ── Broadcast form ──────────────────── */
.ftd-form-container {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 4px solid #f39c12;
}
.ftd-form-container h3 {
  margin: 0 0 1rem;
  color: #f39c12;
}
.ftd-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.ftd-field {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  flex: 1 1 200px;
}
.ftd-field label {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.3rem;
}
.ftd-field select,
.ftd-field textarea,
.ftd-field input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: inherit;
}
.ftd-field textarea {
  resize: vertical;
}
.ftd-field select:focus,
.ftd-field textarea:focus,
.ftd-field input:focus {
  outline: none;
  border-color: #f39c12;
}
.ftd-form-actions {
  display: flex;
  align-items: flex-end;
}
.ftd-btn-save {
  background: #f39c12;
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.6rem;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
}
.ftd-btn-save:hover {
  background: #e67e22;
}

/* ── Tenders list ────────────────────── */

.ftd-tender-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;   /* 12px – adjust to your preference */
}

.ftd-card {
  background: #1e293b;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  border-left: 4px solid #f39c12;
  /* ── Fallback spacing (in case gap doesn't apply) ── */
  margin-bottom: 0.75rem;
}

/* ── Remove the last card's margin to avoid extra space at the bottom ── */
.ftd-card:last-child {
  margin-bottom: 0;
}

.ftd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.ftd-tender-id {
  color: #94a3b8;
  font-family: monospace;
  margin-right: 1rem;
}
.ftd-vehicle {
  font-weight: 600;
  color: #e2e8f0;
  margin-right: 0.8rem;
}
.ftd-status {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ftd-status-open {
  background: #166534;
  color: #86efac;
}
.ftd-status-awarded {
  background: #1e3a8a;
  color: #93c5fd;
}
.ftd-status-closed {
  background: #7f1d1d;
  color: #fca5a5;
}
.ftd-date {
  color: #64748b;
  font-size: 0.8rem;
}
.ftd-description {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin: 0.5rem 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ftd-photos img {
  max-width: 150px;
  max-height: 100px;
  border-radius: 6px;
  margin: 0.3rem;
  border: 1px solid #475569;
}
.ftd-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.5rem;
}
.ftd-btn-award,
.ftd-btn-close {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.3rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}
.ftd-btn-award:hover { background: #1e3a8a; }
.ftd-btn-close:hover { background: #7f1d1d; color: #fca5a5; }

.ftd-empty {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

/* ── Toast messages ──────────────────── */
.ftd-toast {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: ftd-slide-in 0.2s ease;
}
.ftd-toast-success {
  background: #14532d;
  color: #86efac;
  border: 1px solid #22c55e;
}
.ftd-toast-error {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #ef4444;
}
@keyframes ftd-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Date input – gold calendar icon */
.ftd-date-input {
  color-scheme: dark; /* forces dark theme picker in supported browsers */
}
.ftd-date-input::-webkit-calendar-picker-indicator {
  filter: invert(67%) sepia(80%) saturate(800%) hue-rotate(5deg);
  cursor: pointer;
}
/* Fallback for non‑webkit: use a custom background (no standard selector, so the above suffices) */

/* Photo previews */
.ftd-photo-previews {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.ftd-photo-preview {
  position: relative;
  display: inline-block;
}
.ftd-photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #475569;
}
.ftd-btn-remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
  text-align: center;
  padding: 0;
}

.ftd-chat-section {
  margin-top: 2rem;
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
}
.ftd-chat-section h3 {
  color: #f39c12;
  margin-bottom: 0.8rem;
}

/* Garage dropdown inside tender form */
#ft-garage {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border, #334155);
  background: var(--bg-primary, #0f172a);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.95rem;
}
#ft-garage:focus {
  outline: none;
  border-color: var(--accent, #f39c12);
}

.hde-btn-delete-deal {
  background: #7f1d1d;
  color: #fca5a5;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.hde-btn-delete-deal:hover {
  background: #991b1b;
}

.ftd-modal-overlay .ftd-modal {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ── Modal Overlay ── */
.ftd-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);  /* dark, semi-transparent */
  backdrop-filter: blur(4px);            /* subtle blur effect */
  display: none;                         /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: ftd-fade-in 0.25s ease-out;
}

/* ── Modal Box ── */
.ftd-modal {
  background: #1e293b;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  padding: 0;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(243, 156, 18, 0.15);
  overflow: hidden;
  animation: ftd-slide-up 0.3s ease-out;
}

/* ── Modal Header ── */
.ftd-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid #334155;
}
.ftd-modal-header h3 {
  margin: 0;
  color: #f39c12;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.ftd-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2rem;
  transition: color 0.2s;
}
.ftd-modal-close:hover {
  color: #fca5a5;
}

/* ── Modal Body ── */
.ftd-modal-body {
  padding: 1.5rem;
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.6;
}
.ftd-modal-body p {
  margin: 0;
}

/* ── Modal Actions ── */
.ftd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid #334155;
}

/* ── Buttons ── */
.ftd-btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.ftd-btn-secondary:hover {
  background: #475569;
}
.ftd-btn-secondary:active {
  transform: scale(0.97);
}

.ftd-btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.ftd-btn-danger:hover {
  background: #b91c1c;
}
.ftd-btn-danger:active {
  transform: scale(0.97);
}

/* ── Animations ── */
@keyframes ftd-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ftd-slide-up {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Delete button on tender cards ── */
.ftd-btn-delete {
  background: #7f1d1d;
  color: #fca5a5;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  letter-spacing: 0.3px;
}

.ftd-btn-delete:hover {
  background: #991b1b;
  color: #fecaca;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

.ftd-btn-delete:active {
  transform: scale(0.96);
}

.ftd-btn-delete:focus-visible {
  outline: 2px solid #f39c12;
  outline-offset: 2px;
}

/* ── My Tenders Toggle Button ── */
.ftd-tenders-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #334155;
  padding: 0.6rem 0 0.6rem 0;
  margin: 1rem 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f39c12;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: left;
}
.ftd-tenders-toggle:hover {
  border-bottom-color: #f39c12;
}
.ftd-tenders-toggle span:first-child {
  flex: 1;
}
.ftd-tenders-toggle #ftd-tenders-arrow {
  font-size: 0.9rem;
  color: #94a3b8;
  transition: transform 0.2s;
}

/* ── Chat Toggle Button ── */
.ftd-chat-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #334155;
  padding: 0.6rem 0 0.6rem 0;
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f39c12;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: left;
}
.ftd-chat-toggle:hover {
  border-bottom-color: #f39c12;
}
.ftd-chat-toggle span:first-child {
  flex: 1;
}
.ftd-chat-toggle #ftd-chat-arrow {
  font-size: 0.9rem;
  color: #94a3b8;
  transition: transform 0.2s;
}

/* ── Chat widget container ── */
.ftd-chat-widget-container {
  padding-top: 0.5rem;
}

