/* =============================================
   SALMART ADS — ELITE PREMIUM REDESIGN
   Brand Colors: #28a745 (green) + #fff (white)
   ============================================= */

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

/* ── DESIGN TOKENS ───────────────────────────── */
:root {
  --green:          #28a745;
  --green-dark:     #1e8c3a;
  --green-light:    #34c759;
  --green-xlight:   #e8f5ec;
  --green-dim:      rgba(40, 167, 69, 0.06);
  --green-glow:     rgba(40, 167, 69, 0.15);
  --green-border:   rgba(40, 167, 69, 0.25);

  --white:          #ffffff;
  --bg:             #f8faf8;
  --surface:        #ffffff;
  --surface-2:      #fdfdfd;
  --surface-3:      #f5f8f6;

  --border:         #eaf0eb;
  --border-hover:   #cbdccf;

  --text-primary:   #121c14;
  --text-secondary: #4f6453;
  --text-muted:     #8ca391;
  --text-placeholder: #b6c7ba;

  --red:            #e53e3e;
  
  /* Elite dropdown and layout styling shadows */
  --shadow-card:    0 10px 40px rgba(40, 167, 69, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-dropdown: 0 12px 32px rgba(12, 36, 18, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-input:   0 1px 2px rgba(0,0,0,0.02);
  --shadow-focus:   0 0 0 3px rgba(40, 167, 69, 0.12);
  --shadow-btn:     0 8px 24px rgba(40, 167, 69, 0.2);
  --shadow-btn-hover: 0 12px 32px rgba(40, 167, 69, 0.35);

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-full:    999px;

  --font-display:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --transition:     all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── RESET ───────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

/* ── BASE ────────────────────────────────────── */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  background-image: radial-gradient(circle at top center, rgba(40,167,69,0.04) 0%, transparent 60%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── CONTAINER & CARD LAYOUT ─────────────────── */
.ads-container.unified-creation-flow {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  position: relative;
}

/* ── COMPACT HEADER ROW ──────────────────────── */
.ads-header-compact {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.ads-header-compact h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.ads-header-compact .sub-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.user-avatar-round {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--surface-3);
}

/* ── CHIP-STYLE TAB HEADER ───────────────────── */
.ads-tab-header.chip-style {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: var(--radius-full);
}

.ads-tab-header.chip-style .ads-tab-button {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.ads-tab-header.chip-style .ads-tab-button:hover:not(.ads-active) {
  color: var(--text-primary);
}

.ads-tab-header.chip-style .ads-tab-button.ads-active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ── WHATSAPP MEDIA DECK ──────────────────────── */
.whatsapp-media-deck {
  width: 100%;
  background: var(--surface-3);
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-md);
  padding: 26px 16px;
  text-align: center;
  margin-bottom: 24px;
  transition: var(--transition);
}

.whatsapp-media-deck:hover {
  background: var(--green-xlight);
  border-color: var(--green-light);
}

.media-trigger-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.media-trigger-zone i {
  font-size: 22px;
  color: var(--green);
  margin-bottom: 2px;
}

.media-trigger-zone span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.media-trigger-zone small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── UNIFIED FIELDS & CAPTIONS ────────────────── */
.inline-caption-input {
  margin-bottom: 20px;
  width: 100%;
}

.text-field-flat {
  width: 100%;
  padding: 10px 0;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  box-shadow: none !important;
  outline: none;
  transition: var(--transition);
}

.text-field-flat:focus {
  border-bottom-color: var(--green) !important;
}

.text-field-flat::placeholder {
  color: var(--text-placeholder);
}

.description-box {
  min-height: 40px;
  resize: none;
  line-height: 1.5;
}

/* ── INLINE FIELD GRID ────────────────────────── */
.compact-grid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.ads-input-form {
  margin-bottom: 0;
  position: relative;
}

/* Clean Custom Form Select Dropdowns */
.clean-dropdown {
  width: 100%;
  padding: 10px 24px 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238ca391'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
  transition: var(--transition);
}

.clean-dropdown:focus {
  border-bottom-color: var(--green);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
}

/* Styled drop container rules for native option structures */
.clean-dropdown option {
  background-color: var(--surface);
  color: var(--text-primary);
  padding: 12px;
}

/* Currency Wrap Design Input */
.currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-indicator {
  position: absolute;
  left: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.currency-input {
  padding-left: 16px !important;
}

/* ── HORIZONTAL STOCK QUANTITY BAR ───────────── */
.horizontal-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  margin-bottom: 20px;
}

.counter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ads-quantity-container {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.ads-quantity-btn {
  background: var(--surface-3);
  color: var(--text-primary);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ads-quantity-btn:hover {
  background: var(--green-xlight);
  color: var(--green-dark);
}

.ads-quantity-input {
  width: 36px;
  text-align: center;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
}

/* ── DIGITAL ATTACHMENT BOX ───────────────────── */
.digital-file-attachment-box {
  width: 100%;
  background: var(--surface-3);
  border: 1px dashed var(--green-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.file-attach-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
}

/* ── LOCATION DROP STYLES OVERLAY ───────────── */
.autocomplete-wrapper-clean {
  position: relative;
}

.ads-location-clear-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  display: none;
}

/* Luxury floating select dropdown dropdown setup */
.ads-location-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: -10px;
  right: -10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  max-height: 230px;
  overflow-y: auto;
  z-index: 999;
  display: none;
  padding: 6px;
}

.ads-location-dropdown.ads-open { 
  display: block; 
  animation: dropSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.ads-location-dropdown-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.ads-location-dropdown-item:hover {
  background: var(--surface-3);
  color: var(--green-dark);
}

/* ── EARNING TOAST PILLS ──────────────────────── */
.earning-toast-pill {
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 500;
  display: block;
  padding: 6px 12px;
  background: var(--green-xlight);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  margin-bottom: 14px;
}

/* ── ACTION FOOTER DECK ───────────────────────── */
.action-footer-deck {
  text-align: center;
  margin-top: 32px;
}

.ads-publish-button.send-btn-style {
  background: var(--green);
  color: var(--white);
  width: 100%;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.ads-publish-button.send-btn-style:hover {
  background: var(--green-dark);
  box-shadow: var(--shadow-btn-hover);
}

.legal-notice {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 14px;
}

/* ── PREVIEWS ────────────────────────────────── */
.ads-preview-container {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.ads-preview-container img {
  max-width: 64px;
  max-height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ── BASE ERROR STRIPS ───────────────────────── */
.ads-error {
  color: var(--red);
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
  text-align: left;
}

/* ── FEEDBACK & DIALOG TOASTS ────────────────── */
.ads-toast-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  display: none;
  z-index: 9999;
  font-size: 13px;
  box-shadow: var(--shadow-dropdown);
}

/* ── LOADING MODAL ───────────────────────────── */
.ads-loading-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(245,248,246,0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.ads-loading-content {
  text-align: center;
}

.ads-spinner {
  border: 2px solid var(--border);
  border-top: 2px solid var(--green);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: adsSpin 0.7s linear infinite;
  margin: 0 auto 12px;
}

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

/* ── RESPONSIVE SCREEN RULES ─────────────────── */
@media (max-width: 580px) {
  body { padding: 0; background: var(--surface); }
  
  .ads-container.unified-creation-flow {
    padding: 24px 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    min-height: 100vh;
  }
  
  .compact-grid-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── NATIVE SYSTEM DARK MODE ─────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #090f0b;
    --surface:      #101712;
    --surface-2:    #141d16;
    --surface-3:    #17221a;
    --border:       rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text-primary:   #eff3f0;
    --text-secondary: #97ae9b;
    --text-muted:     #556d5b;
    --text-placeholder: #3a4f40;
    --green-xlight:   rgba(40,167,69,0.12);
    --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.4);
  }
}
/* ── LOCATION AUTOCOMPLETE WRAPPER & DROPDOWN ── */
.ads-location-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.ads-location-clear-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  display: none;
  z-index: 10;
  padding: 4px;
}

/* Floating lookup card matched with your .ads-open class trigger */
.ads-location-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  max-height: 240px;
  overflow-y: auto;
  z-index: 999;
  display: none;
  padding: 6px;
}

.ads-location-dropdown.ads-open { 
  display: block !important; 
  animation: dropSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Base list items rendered by your JavaScript loop */
.ads-location-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: left;
}

.ads-location-dropdown-item i {
  color: var(--text-muted);
  font-size: 13px;
  width: 14px;
  text-align: center;
}

/* Hover state & Keyboard arrow selection support */
.ads-location-dropdown-item:hover,
.ads-location-dropdown-item.ads-active {
  background: var(--surface-3);
  color: var(--green-dark);
}

.ads-location-dropdown-item:hover i,
.ads-location-dropdown-item.ads-active i {
  color: var(--green);
}

/* Custom indicator style rule for the Nationwide item option */
.ads-location-dropdown-item.ads-nationwide-item {
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  border-radius: 0;
  padding-bottom: 12px;
}

/* Matches text highlighted during typing matches */
.ads-location-dropdown-item mark {
  background: var(--green-glow);
  color: var(--green-dark);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}
