/* =============== Uni Donation (Frontend) =============== */

/* -----------------------------------------
   1) Swiper Core Fixes
----------------------------------------- */
.ud-slider.swiper {
  width: 100%;
  overflow: hidden; /* Necessary for Swiper to mask overflow */
  position: relative;
}

.ud-slider .swiper-wrapper {
  display: flex;
  transition-property: transform;
  box-sizing: content-box;
}

/* ✅ FIX: Removed "width: auto !important" so Columns logic works */
.ud-slider .swiper-slide {
  flex-shrink: 0;
  height: auto; /* Ensures cards are equal height */
  display: flex; /* Stretches the card inside */
}

/* -----------------------------------------
   2) CSS Variables
----------------------------------------- */
.ud-wrap {
  color: var(--ud-text);
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

/* -----------------------------------------
   3) Tabs + Navigation
----------------------------------------- */
.ud-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.ud-tab {
  border: 1px solid #cfe38d;
  background: #f3f7e8;
  color: #0f2d1f;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ud-tab:hover,
.ud-tab.is-active {
  background: #9acb2f;
  border-color: #9acb2f;
  color: #0b2418;
}

.ud-slider-nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.ud-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #cfe38d;
  background: #f3f7e8;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0; /* Reset padding for icons */
}

.ud-nav-btn:hover {
  background: #9acb2f;
  border-color: #9acb2f;
  color: #fff;
}

/* Mobile: Center tabs */
@media (max-width: 767px) {
  .ud-tabs { 
    justify-content: flex-start; /* Or center if preferred */
    overflow-x: auto; /* Scrollable tabs on mobile */
    white-space: nowrap;
    padding-bottom: 5px;
  }
  .ud-slider-nav { margin-left: 0; margin-top: 10px; display: none; /* Often hidden on mobile */ }
}

/* -----------------------------------------
   4) Card (The Campaign)
----------------------------------------- */
.ud-card {
  background: var(--ud-card-bg, #ffffff);
  border: 1px solid var(--ud-border, #e7f0c9);
  border-radius: 24px;
  padding: 0; /* Content padding handled by inner wrapper */
  overflow: hidden; /* For image radius */
  
  /* ✅ FIX: Width is 100% of the slide, not fixed pixels */
  width: 100%; 
  min-height: 230px;
  
  display: flex;
  flex-direction: column;
  position: relative;
}

.ud-card1 {
  background: var(--ud-card-bg, #ffffff);
  border: 1px solid var(--ud-border, #e7f0c9);
  border-radius: 24px;
  padding: 30px 28px; /* Content padding handled by inner wrapper */
  overflow: hidden; /* For image radius */
  
  /* ✅ FIX: Width is 100% of the slide, not fixed pixels */
  width: 100%; 
  min-height: 230px;
  
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Image Wrapper */
.ud-card-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
}

.ud-card-img img {
  width: 100%;
  height: 200px; /* Default fallback height */
  object-fit: cover;
  display: block;
}

/* Top Icon (Fallback) */
.ud-card-top {
  padding: 0px 0px 61px 0px ;
}
.ud-card-top img {
  width: 40px;
  height: auto;
}

/* Badge */
.ud-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #9acb2f;
  color: #0b2418;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  z-index: 2;
  text-transform: uppercase;
}

/* Content Wrapper */
.ud-card-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Meta (Days Left) */
.ud-meta {
  font-size: 12px;
  font-weight: 600;
  color: #9acb2f;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Title */
.ud-card-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.ud-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.ud-card-title a:hover {
  color: #9acb2f;
}

/* Description */
.ud-card-desc {
  margin: 0 0 15px;
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  flex-grow: 1; /* Pushes footer down */
}

/* Progress Bar */
.ud-progress {
  margin-top: auto; /* Pushes to bottom before button */
  margin-bottom: 15px;
}

.ud-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #0f2d1f;
}

.ud-bar {
  width: 100%;
  height: 10px;
  background: #eef4d8;
  border-radius: 99px;
  overflow: hidden;
}

.ud-bar-fill {
  display: block;
  height: 100%;
  background: #9acb2f;
  width: 0%; /* JS or Inline sets this */
  transition: width 0.5s ease;
  border-radius: 99px;
}

.ud-progress-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 5px;
  color: #666;
}

/* Actions / Button */
.ud-card-actions {
  margin-top: 10px;
}

.ud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  background: #9acb2f;
  color: #0b2418;
  font-weight: 700;
  font-size: 14px;
  border-radius: 99px;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  text-align: center;
}

.ud-btn:hover {
  background: #88b525;
  color: #fff;
}

/* -----------------------------------------
   5) Grid Layout
----------------------------------------- */
.ud-grid {
  display: grid;
  /* Columns handled by inline style --ud-grid-cols... */
  grid-template-columns: repeat(var(--ud-grid-cols-desktop, 3), 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .ud-grid {
    grid-template-columns: repeat(var(--ud-grid-cols-tablet, 2), 1fr) !important;
  }
}

@media (max-width: 767px) {
  .ud-grid {
    grid-template-columns: repeat(var(--ud-grid-cols-mobile, 1), 1fr) !important;
  }
}

/* -----------------------------------------
   6) Utilities
----------------------------------------- */
.ud-hidden {
  display: none !important;
}

.ud-empty {
  width: 100%;
  padding: 40px;
  text-align: center;
  background: #f9f9f9;
  border-radius: 8px;
  color: #777;
}

/* -----------------------------------------
   4) Single Campaign (Donate Form)
----------------------------------------- */
/* =========================
   Uni Donation – Single Page Skin (matches screenshot)
   ========================= */

/* page background + spacing */
.ud-single,
.ud-donate-page{
  background: #F4F7EC;
}

.ud-single{
  padding: 48px 16px;
}

.ud-donate-page{
  max-width: 920px;
  margin: 0 auto;
}

/* title */
.ud-donate-page-title{
  margin: 0 0 22px;
  text-align: center;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  color: #0E3B2C;
}

/* campaign intro box */
.ud-donate-head{
  background: #F4F7EC;
  border: 1.5px solid #B9D85A;
  border-radius: 18px;
  padding: 18px 22px;
  margin: 0 0 22px;
}

.ud-donate-campaign-title{
  margin: 0 0 6px;
  color: #0E3B2C;
  font-size: 26px;
  font-weight: 800;
}

.ud-donate-campaign-desc{
  margin: 0;
  color: rgba(14,59,44,.85);
  font-size: 14px;
  line-height: 1.6;
}

/* main card */
.ud-donate-card{
  background: #F4F7EC;
  border: 1.5px solid #B9D85A;
  border-radius: 18px;
  padding: 22px 22px 18px;
}

.ud-donate-section-title{
  margin: 0 0 16px;
  color: #0E3B2C;
  font-size: 15px;
  font-weight: 800;
}

/* amount bar */
.ud-amount-bar{
  background: #0E3B2C;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(185,216,90,.65);
}

.ud-amount-input{
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  text-align: right;
  height: 44px !important;
  padding: 0 !important;
}

/* remove number spinners */
.ud-amount-input::-webkit-outer-spin-button,
.ud-amount-input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.ud-amount-input{ -moz-appearance: textfield; }

/* suggested chips */
.ud-amount-suggest{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ud-amount-chip{
  border: 1px solid rgba(185,216,90,.9);
  background: rgba(185,216,90,.40);
  color: #0E3B2C;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ud-amount-chip:hover{
  background: rgba(185,216,90,.55);
}

/* fields layout */
.ud-fields{
  display: grid;
  gap: 14px;
}

/* labels */
.ud-field span{
  font-size: 13px;
  font-weight: 700;
  color: rgba(14,59,44,.9);
}

/* inputs/selects – pill style like screenshot */
.ud-field input,
.ud-field select,
.ud-input,
.ud-select{
  height: 46px !important;
  border-radius: 999px !important;
  border: 1.5px solid #B9D85A !important;
  background: #F8FAF2 !important;
  padding: 10px 16px !important;
  box-shadow: none !important;
  outline: none !important;
  color: #0E3B2C;
}

.ud-field input::placeholder{
  color: rgba(14,59,44,.45);
}

/* focus state */
.ud-field input:focus,
.ud-field select:focus,
.ud-input:focus,
.ud-select:focus{
  border-color: #9EC93E !important;
}

/* checkbox row (save card) */
.ud-save-card{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: rgba(14,59,44,.9);
  font-size: 13px;
  font-weight: 700;
}
.ud-save-card input[type="checkbox"]{
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* button */
.ud-actions{
  margin-top: 16px;
}

.ud-btn{
  width: 100%;
  height: 52px;
  border-radius: 999px;
  border: 0;
  background: #9AC400;
  color: #0E3B2C;
  font-weight: 800;
  cursor: pointer;
}
.ud-btn:hover{ filter: brightness(.97); }

/* responsive */
@media (max-width: 640px){
  .ud-donate-page-title{ font-size: 34px; }
  .ud-donate-campaign-title{ font-size: 20px; }
  .ud-amount-input{ font-size: 26px !important; }
}
/* =========================
   FIX: make all fields full width (match image 1)
   ========================= */

/* force the form to be 1 column always */
.ud-fields{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

/* make each field stack: label on top, input full width */
.ud-field{
  display: block !important;
  width: 100% !important;
}

/* sometimes markup is label + .ud-control in a row */
.ud-field > label,
.ud-field > span,
.ud-field .ud-label,
.ud-field .ud-field-label{
  display: block !important;
  width: 100% !important;
  margin: 0 0 8px !important;
}

/* kill any inline/half width rules */
.ud-field,
.ud-field *{
  max-width: none !important;
}

/* make ALL inputs/selects full width */
.ud-field input,
.ud-field select,
.ud-field textarea,
.ud-input,
.ud-select{
  display: block !important;
  width: 100% !important;
}

/* if there are "half" classes used by the plugin/theme */
.ud-field--half,
.ud-col-6,
.ud-half{
  grid-column: 1 / -1 !important;
  width: 100% !important;
}
