/* Program Form Styles - Create & Edit */

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Stepper Component */
.stepper {
  display: flex;
  align-items: center;
  margin: 20px 10px;
  width: 100%;
  max-width: 98%;
  box-sizing: border-box;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.10));
}

/* Base step (neutral, suits form) */
.step {
  flex-grow: 1;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #0f172a;
  padding: 8px 6px 8px 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-right: -15px;

  /* your arrow/ribbon shape */
  clip-path: polygon(0% 0%, 94% 0%, 100% 50%, 94% 100%, 0% 100%, 6% 50%);

  display: flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  min-width: 0;
  position: relative;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* First and last shape */
.step:first-child {
  clip-path: polygon(0% 0%, 94% 0%, 100% 50%, 94% 100%, 0% 100%);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  margin-left: 0;
}

.step:last-child {
  clip-path: polygon(0% 0%, 94% 0%, 100% 50%, 94% 100%, 0% 100%, 6% 50%);
  margin-right: 0;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Active = deep blue (match your primary UI) */
.step.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  transform: scale(1.02);
  z-index: 2;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Completed = green (success) */
.step.completed {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Upcoming (optional "next step" highlight) */
.step.upcoming {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #083154;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.10),
              inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* Disabled */
.step.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  transform: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

/* Clickable / hover */
.step.clickable {
  cursor: pointer;
  transition: all 0.25s ease;
}

.step.clickable:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 3;
}

/* Hover variants (NO red/orange) */
.step.clickable:hover.active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
}

.step.clickable:hover.completed {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.step.clickable:hover.upcoming {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  color: #062843;
}

.step.clickable:hover:not(.active):not(.completed):not(.upcoming) {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  color: #0f172a;
}

/* Label / icons */
.step .label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  text-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step.active .label,
.step.completed .label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Icon base blocks */
.step .label .check-icon,
.step .label .edit-icon {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Check icon badge */
.step .label .check-icon {
  font-size: 13px;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  padding: 0;
}

/* Edit icon badge */
.step .label .edit-icon {
  font-size: 13px;
  border-radius: 6px;
  padding: 3px 6px;
  animation: editPulse 2.5s ease-in-out infinite;
}

/* Clickable hint icon */
.step .label .clickable-icon {
  font-weight: 700;
  font-size: 12px;
  transition: all 0.2s ease;
  opacity: 0.85;
}

.step.clickable:hover .clickable-icon {
  opacity: 1;
  transform: translateX(2px);
}

/* Icon colors on colored steps */
.step.active .check-icon,
.step.completed .check-icon,
.step.active .edit-icon,
.step.completed .edit-icon,
.step.active .clickable-icon,
.step.completed .clickable-icon {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.14);
}

/* Icon colors on neutral/upcoming steps */
.step:not(.active):not(.completed) .check-icon,
.step:not(.active):not(.completed) .edit-icon,
.step:not(.active):not(.completed) .clickable-icon {
  color: rgba(37, 99, 235, 0.90);
  background: rgba(37, 99, 235, 0.10);
}

/* Pulse */
@keyframes editPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.04); }
}

/* Hide utility */
.step.hidden { display: none; }

/* Optional: nicer on small screens */
@media (max-width: 576px) {
  .stepper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    filter: none;
    padding-bottom: 6px;
  }
  .step {
    flex: 0 0 auto;
    min-width: 160px;
    margin-right: 0;
    clip-path: none;
    border-radius: 12px;
    padding: 10px 12px;
  }
  .step:first-child,
  .step:last-child {
    clip-path: none;
    border-radius: 12px;
  }
}

/* Form Validation */
span.text-danger {
    font-size: 11px;
    font-weight: bold;
}

/* TomSelect Custom Styling - Override Bootstrap */
.ts-wrapper,
.ts-wrapper.form-select,
.ts-wrapper.form-control {
    width: 100% !important;
    border: 1px solid #d2d6da !important;
    border-radius: 0.5rem !important;
    padding: 0 !important;
    height: auto !important;
}

.ts-wrapper .ts-control,
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    min-height: 42px !important;
    padding: 6px 12px !important;
    border: 0 !important;
    border-radius: 0.5rem !important;
    background: #fff !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.ts-wrapper .ts-control:focus-within,
.ts-wrapper.focus .ts-control {
    border: 0 !important;
    box-shadow: none !important;
}

.ts-wrapper:focus-within,
.ts-wrapper.focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

.ts-wrapper.multi .ts-control > div {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    margin: 2px 4px 2px 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.ts-wrapper.multi .ts-control > div .remove {
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding-left: 8px !important;
    margin-left: 6px !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.ts-wrapper.multi .ts-control > div .remove:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.ts-dropdown {
    border: 1px solid #d2d6da !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    margin-top: 4px !important;
}

.ts-dropdown .option {
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-bottom: 1px solid #f1f3f5 !important;
}

.ts-dropdown .option:last-child {
    border-bottom: none !important;
}

.ts-dropdown .option.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #fff !important;
}

.ts-dropdown .option:hover:not(.active) {
    background: #f8f9fa !important;
}

.ts-dropdown .optgroup-header {
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #6c757d !important;
    padding: 8px 12px !important;
    background: #f8f9fa !important;
}

.ts-wrapper.form-control {
    padding: 0 !important;
    height: auto !important;
    border: 1px solid #d2d6da !important;
}

.ts-wrapper .ts-control input {
    font-size: 14px !important;
    border: 0 !important;
}

/* Upload Loading Overlay */
.upload-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.upload-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #ef6925;
    border-radius: 50%;
    animation: uploadSpin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes uploadSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.upload-status {
    font-weight: 500;
    margin-bottom: 3px;
    font-size: 13px;
}

.upload-status.uploading {
    color: #6c757d;
}

.upload-zone.uploading {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.upload-zone.success {
    border-color: #28a745;
    background-color: #f8fff8;
}

.upload-zone.error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Input Group Styles */
.input-group-text {
    background-color: #e9ecef;
}

.input-group.form-control {
    padding-left: 1rem;
}

.form-control-label {
    font-size: 14px;
}

/* Tooltip Styles */
.tooltip {
    z-index: 10060 !important;
}

.tooltip .tooltip-inner {
    max-width: 300px !important;
    padding: 10px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: left !important;
    background-color: #333 !important;
    border-radius: 6px !important;
}

.tooltip .tooltip-arrow {
    border-top-color: #333 !important;
}

#participation-tooltip {
    color: #6c757d;
    font-size: 14px;
}

#participation-tooltip:hover {
    color: #495057;
}

#category-tooltip,
#form-tooltip,
#executor-tooltip,
#strategic-partner-tooltip,
#program-ikonik-tooltip {
    color: #6c757d;
    font-size: 14px;
}

#category-tooltip:hover,
#form-tooltip:hover,
#executor-tooltip:hover,
#strategic-partner-tooltip:hover,
#program-ikonik-tooltip:hover {
    color: #495057;
}

/* Image Preview Modal */
#imagePreviewModal {
    z-index: 2147483647 !important;
    position: fixed !important;
}

#imagePreviewModal .modal-dialog {
    z-index: 2147483647 !important;
    position: relative !important;
}

#imagePreviewModal .modal-content {
    z-index: 2147483647 !important;
    position: relative !important;
    background-color: white !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

#image-modal-backdrop {
    z-index: 2147483646 !important;
    position: fixed !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

#imagePreviewModal.show {
    display: block !important;
    z-index: 2147483647 !important;
}

.modal-backdrop {
    z-index: 2147483646 !important;
}

.modal.show {
    z-index: 2147483647 !important;
}

/* Checkbox Extended Container */
.checkbox-extended-container {
    margin-right: -80px;
    overflow-x: visible;
    width: calc(100% + 80px);
}

.checkbox-item-extended {
    margin-bottom: 2rem;
    padding-right: 30px;
    padding-left: 10px;
}

/* Finance one-off fields should always stay within card boundaries */
.finance-fields-row {
  margin-right: 0 !important;
  margin-left: 0 !important;
  width: 100% !important;
}

.finance-fields-row .input-group {
  width: 100%;
  flex-wrap: nowrap;
}

.finance-fields-row .form-control {
  min-width: 0;
}

/* Sticky Button Section */
.btn-section {
    position: sticky;
    top: 5px;
    background: white;
    border-radius: 8px;
    z-index: 150;
    margin-bottom: 20px;
}

.btn-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 8px 8px 0 0;
    padding: 15px 0 15px 0;
}

/* Date Card */
.date-card {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 70%);
  border-radius: 14px;
}

.date-sep {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-weight: 700;
}

.days-box {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.days-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.days-value {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

/* Schedule List */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.schedule-left .schedule-title {
  font-weight: 700;
  color: #334155;
  font-size: 13px;
}

.schedule-left .schedule-date {
  font-size: 11px;
  color: #64748b;
}

.schedule-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Segmented Control */
.segmented {
  display: flex;
  /* width: 50%; */
  max-width: 520px;
  border: 1px solid #d0d7e2;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

.segmented__input {
  display: none;
}

.segmented__btn {
  flex: 1;
  text-align: center;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
  transition: all .18s ease;
  margin: 0;
  border: 0;
}

.segmented__btn + .segmented__btn {
  border-left: 1px solid #e5e7eb;
}

.segmented__input:checked + .segmented__btn {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}

.segmented__btn:hover {
  background: #f8fafc;
}

.segmented__input:checked + .segmented__btn:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.8);
}

.scroll-to-top.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.scroll-to-top:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: scale(1.1) translateY(-2px);
}

.scroll-to-top:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}
