/* ═══════════════════════════════════════════════════
   WP Testimonials Manager – Public CSS v1.2
   CDF Studio | cdf-studio.com
═══════════════════════════════════════════════════ */
:root {
  --wptm-primary:   #2C3E7A;
  --wptm-secondary: #5B8FD4;
  --wptm-accent:    #E8A020;
  --wptm-bg:        #ffffff;
  --wptm-text:      #1A1A2E;
  --wptm-radius:    12px;
  --wptm-gap:       24px;
  --wptm-card-bg:   var(--wptm-bg);
  --wptm-card-border: #e8edf3;
  --wptm-card-shadow: 0 4px 20px rgba(44,62,122,.10);
  --wptm-muted:     #7a8099;
  --wptm-tag-bg:    #eef3fb;
}

/* ── DARK THEME ── */
.wptm-theme-dark {
  --wptm-bg:           #1a1a2e;
  --wptm-card-bg:      #252542;
  --wptm-card-border:  #363660;
  --wptm-card-shadow:  0 4px 20px rgba(0,0,0,.30);
  --wptm-text:         #f0f4ff;
  --wptm-muted:        #9aa0c0;
  --wptm-tag-bg:       #1e2040;
}

/* ════════════════════ CARD STYLES ════════════════════ */
.wptm-card {
  background:    var(--wptm-card-bg);
  border:        1px solid var(--wptm-card-border);
  border-radius: var(--wptm-radius);
  padding:       1.4rem;
  box-shadow:    var(--wptm-card-shadow);
  display:       flex;
  flex-direction:column;
  gap:           .8rem;
  position:      relative;
  transition:    transform .2s, box-shadow .2s;
  color:         var(--wptm-text);
}
.wptm-no-shadow .wptm-card    { box-shadow: none !important; }
.wptm-card:hover              { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(44,62,122,.18); }
.wptm-no-shadow .wptm-card:hover { transform: translateY(-2px); }

/* Minimal */
.wptm-cards-minimal .wptm-card { border: none; box-shadow: none; background: transparent; padding: 1rem 0; border-bottom: 1px solid var(--wptm-card-border); border-radius: 0; }
.wptm-cards-minimal .wptm-card:hover { transform: none; }

/* Bordered */
.wptm-cards-bordered .wptm-card { box-shadow: none; border: 2px solid var(--wptm-card-border); }
.wptm-cards-bordered .wptm-card:hover { border-color: var(--wptm-secondary); }

/* Elevated */
.wptm-cards-elevated .wptm-card { box-shadow: 0 8px 40px rgba(44,62,122,.14); border: none; }
.wptm-cards-elevated .wptm-card:hover { box-shadow: 0 16px 60px rgba(44,62,122,.22); transform: translateY(-5px); }

/* Flat */
.wptm-cards-flat .wptm-card { box-shadow: none; border: none; background: #f6f8fc; border-radius: var(--wptm-radius); }
.wptm-theme-dark .wptm-cards-flat .wptm-card { background: #1e2040; }

/* Featured */
.wptm-card-featured { border-color: var(--wptm-accent) !important; }

/* ════════════════════ GRID ════════════════════ */
.wptm-display  { width: 100%; }
.wptm-grid     { display: grid; gap: var(--wptm-gap, 24px); }
.wptm-cols-1 .wptm-grid { grid-template-columns: 1fr; }
.wptm-cols-2 .wptm-grid { grid-template-columns: repeat(2, 1fr); }
.wptm-cols-3 .wptm-grid { grid-template-columns: repeat(3, 1fr); }
.wptm-cols-4 .wptm-grid { grid-template-columns: repeat(4, 1fr); }
.wptm-cols-5 .wptm-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) {
  .wptm-cols-4 .wptm-grid,
  .wptm-cols-5 .wptm-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .wptm-cols-3 .wptm-grid,
  .wptm-cols-4 .wptm-grid,
  .wptm-cols-5 .wptm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) { .wptm-grid { grid-template-columns: 1fr !important; } }

/* ── LIST layout ── */
.wptm-layout-list .wptm-grid { grid-template-columns: 1fr; }
.wptm-layout-list .wptm-card { flex-direction: row; align-items: flex-start; gap: 1.2rem; }
.wptm-layout-list .wptm-card-author { flex-shrink: 0; flex-direction: column; align-items: center; text-align: center; width: 90px; border-top: none; padding-top: 0; }
.wptm-layout-list .wptm-card-body { flex: 1; min-width: 0; }
@media (max-width: 520px) { .wptm-layout-list .wptm-card { flex-direction: column; } }

/* ── SLIDER layout ── */
.wptm-layout-slider .wptm-grid  { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.wptm-layout-slider .wptm-grid::-webkit-scrollbar { height: 4px; }
.wptm-layout-slider .wptm-grid::-webkit-scrollbar-track { background: var(--wptm-card-border); border-radius: 2px; }
.wptm-layout-slider .wptm-grid::-webkit-scrollbar-thumb { background: var(--wptm-secondary); border-radius: 2px; }
.wptm-layout-slider .wptm-card { min-width: min(340px, 82vw); scroll-snap-align: start; flex-shrink: 0; }

/* ── MASONRY layout ── */
.wptm-layout-masonry .wptm-grid { columns: var(--wptm-cols, 3); column-gap: var(--wptm-gap, 24px); display: block; }
.wptm-layout-masonry .wptm-card { break-inside: avoid; margin-bottom: var(--wptm-gap, 24px); }
@media (max-width: 768px) { .wptm-layout-masonry .wptm-grid { columns: 2; } }
@media (max-width: 520px) { .wptm-layout-masonry .wptm-grid { columns: 1; } }

/* ── WALL layout ── */
.wptm-layout-wall .wptm-grid  { display: flex; gap: var(--wptm-gap, 24px); overflow: hidden; max-height: 520px; }
.wptm-wall-col                { flex: 1; display: flex; flex-direction: column; gap: var(--wptm-gap,24px); animation: wptm-scroll linear infinite; }
@keyframes wptm-scroll { 0%{transform:translateY(0)} 100%{transform:translateY(-50%)} }
.wptm-layout-wall:hover .wptm-wall-col { animation-play-state: paused; }
.wptm-layout-wall .wptm-card  { min-width: 0; }

/* ════════════════════ CARD CONTENT ════════════════════ */
.wptm-card-body { flex: 1; display: flex; flex-direction: column; gap: .6rem; }

.wptm-card-date { font-size: .75rem; color: var(--wptm-muted); }

.wptm-card-stars .wptm-star       { font-size: 1rem; color: var(--wptm-card-border); }
.wptm-card-stars .wptm-star.active{ color: var(--wptm-accent); }

/* Quote styles */
.wptm-card-quote { flex: 1; margin: 0; }
.wptm-card-quote p { font-size: .96rem; line-height: 1.75; color: var(--wptm-text); margin: 0; }
.wptm-quote-italic p { font-style: italic; }
.wptm-quote-normal p { font-style: normal; }
.wptm-quote-large  p { font-size: 1.08rem; line-height: 1.8; }
.wptm-quote-italic p::before { content: '\201C'; font-size: 1.8rem; color: var(--wptm-secondary); line-height: 0; vertical-align: -.5rem; margin-right: 2px; font-style: normal; }

/* Font sizes */
.wptm-font-sm .wptm-card-quote p { font-size: .86rem; }
.wptm-font-lg .wptm-card-quote p { font-size: 1.05rem; }

/* Questions */
.wptm-card-questions { display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; border-top: 1px solid var(--wptm-card-border); padding-top: .6rem; }
.wptm-question-answer { display: flex; flex-direction: column; gap: 2px; }
.wptm-q-label  { color: var(--wptm-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.wptm-q-answer { color: var(--wptm-text); }

/* Tags */
.wptm-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.wptm-tag { background: var(--wptm-tag-bg); color: var(--wptm-primary); font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; }

/* ════════════════════ AUTHOR ════════════════════ */
.wptm-card-author { display: flex; align-items: center; gap: .8rem; padding-top: .8rem; border-top: 1px solid var(--wptm-card-border); }
.wptm-author-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--wptm-card-border); }
.wptm-company-logo { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.wptm-company-logo-sm { width: 32px; height: 32px; border-radius: 4px; object-fit: contain; flex-shrink: 0; margin-left: auto; }
.wptm-author-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--wptm-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.wptm-author-info { flex: 1; min-width: 0; overflow: hidden; }
.wptm-author-name { display: block; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wptm-author-meta,
.wptm-author-sector { display: block; font-size: .78rem; color: var(--wptm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Featured badge */
.wptm-featured-badge { position: absolute; top: 10px; right: 10px; background: var(--wptm-accent); color: #fff; font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; letter-spacing: .03em; }

/* ════════════════════ HELPFUL ════════════════════ */
.wptm-helpful { display: flex; justify-content: flex-end; margin-top: auto; padding-top: .4rem; }
.wptm-helpful-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--wptm-card-border); border-radius: 20px; padding: 4px 12px; font-size: .8rem; color: var(--wptm-muted); cursor: pointer; transition: all .2s; }
.wptm-helpful-btn:hover, .wptm-helpful-btn.voted { background: var(--wptm-tag-bg); border-color: var(--wptm-secondary); color: var(--wptm-primary); }
.wptm-helpful-count { font-weight: 700; }

/* ════════════════════ FILTERS ════════════════════ */
.wptm-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.wptm-filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wptm-filter-label { font-size: .8rem; font-weight: 700; color: var(--wptm-muted); min-width: 60px; }
.wptm-filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wptm-filter-pill { background: var(--wptm-tag-bg); border: 1.5px solid transparent; border-radius: 20px; padding: 4px 12px; cursor: pointer; font-size: .8rem; color: var(--wptm-primary); font-weight: 600; transition: all .2s; white-space: nowrap; }
.wptm-filter-pill:hover  { border-color: var(--wptm-secondary); }
.wptm-filter-pill.active { background: var(--wptm-primary); color: #fff; }
.wptm-pill-count { opacity: .7; font-weight: normal; font-size: .75em; }
.wptm-filter-pill[data-type="rating"] .wptm-pill-count,
.wptm-filter-pill[data-type="rating"] { letter-spacing: -.02em; }

/* ════════════════════ PAGINATION ════════════════════ */
.wptm-pagination { display: flex; justify-content: center; gap: 4px; margin-top: 2rem; flex-wrap: wrap; }
.wptm-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--wptm-card-border); color: var(--wptm-primary); text-decoration: none; font-size: .9rem; transition: all .2s; }
.wptm-pagination .page-numbers:hover { background: var(--wptm-tag-bg); border-color: var(--wptm-secondary); }
.wptm-pagination .page-numbers.current { background: var(--wptm-primary); color: #fff; border-color: var(--wptm-primary); }
.wptm-pagination .page-numbers.dots { border: none; background: none; }

/* ════════════════════ LOAD MORE ════════════════════ */
.wptm-load-more-wrap { text-align: center; margin-top: 2rem; }
.wptm-btn-load-more { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 2rem; background: var(--wptm-primary); color: #fff; border: none; border-radius: 8px; font-size: .95rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.wptm-btn-load-more:hover { background: var(--wptm-secondary); transform: translateY(-1px); }
.wptm-btn-load-more:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.wptm-load-more-count { font-size: .82em; opacity: .8; }

/* ════════════════════ STATS ════════════════════ */
.wptm-stats { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.wptm-stats-stars .wptm-star       { font-size: 1.3rem; color: var(--wptm-card-border); }
.wptm-stats-stars .wptm-star.active{ color: var(--wptm-accent); }
.wptm-stats-avg  { font-size: 1.1rem; font-weight: 700; color: var(--wptm-primary); }
.wptm-stats-count{ font-size: .9rem; color: var(--wptm-muted); }

/* ════════════════════ NO RESULTS ════════════════════ */
.wptm-no-results { text-align: center; color: var(--wptm-muted); padding: 3rem 1rem; font-size: 1rem; grid-column: 1 / -1; }

/* ════════════════════ AUDIO ════════════════════ */
.wptm-audio-player { display: flex; align-items: center; gap: 8px; background: var(--wptm-tag-bg); border-radius: 20px; padding: 6px 12px; }
.wptm-audio-btn { background: var(--wptm-primary); border: none; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; flex-shrink: 0; }
.wptm-audio-progress { flex: 1; height: 4px; background: var(--wptm-card-border); border-radius: 2px; cursor: pointer; overflow: hidden; }
.wptm-audio-bar { height: 100%; background: var(--wptm-primary); width: 0; transition: width .1s linear; }
.wptm-audio-time { font-size: .72rem; color: var(--wptm-muted); min-width: 36px; }

/* ════════════════════ FORM ════════════════════ */
.wptm-form-wrap { max-width: 680px; margin: 0 auto; }
.wptm-form-title { font-size: 1.6rem; color: var(--wptm-primary); margin-bottom: 1.5rem; }
.wptm-field { margin-bottom: 1.2rem; }
.wptm-field label { display: block; font-weight: 600; margin-bottom: .4rem; color: var(--wptm-text); }
.wptm-field input:not([type=radio]):not([type=checkbox]),
.wptm-field select,
.wptm-field textarea { width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--wptm-card-border); border-radius: 8px; font-size: 1rem; font-family: inherit; background: var(--wptm-bg); color: var(--wptm-text); transition: border-color .2s; }
.wptm-field input:focus, .wptm-field select:focus, .wptm-field textarea:focus { outline: none; border-color: var(--wptm-secondary); box-shadow: 0 0 0 3px rgba(91,143,212,.12); }
.wptm-field-hint { font-size: .8rem; color: var(--wptm-muted); margin-top: .3rem; }
.wptm-field.wptm-required label::after { content: ' *'; color: #dc3232; }

/* Star rating form */
.wptm-star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.wptm-star-rating input { display: none; }
.wptm-star-rating label { font-size: 2rem; color: var(--wptm-card-border); cursor: pointer; transition: color .15s; line-height: 1; }
.wptm-star-rating input:checked ~ label,
.wptm-star-rating label:hover,
.wptm-star-rating label:hover ~ label { color: var(--wptm-accent); }

/* Range */
.wptm-range-wrap { display: flex; align-items: center; gap: 12px; }
.wptm-range-input { flex: 1; accent-color: var(--wptm-primary); }
.wptm-range-value { font-weight: 700; color: var(--wptm-primary); min-width: 24px; }

/* Upload preview */
.wptm-upload-preview img { max-width: 80px; max-height: 80px; border-radius: 50%; object-fit: cover; margin-top: 8px; }

/* Consent */
.wptm-consent-box { background: var(--wptm-tag-bg); border: 1.5px solid var(--wptm-secondary); border-radius: var(--wptm-radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.wptm-consent-label { display: flex; gap: .8rem; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.wptm-consent-label input { margin-top: 3px; flex-shrink: 0; accent-color: var(--wptm-primary); }
.wptm-option-label { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; cursor: pointer; font-weight: normal; }

/* Buttons form */
.wptm-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.8rem; border-radius: 8px; border: none; cursor: pointer; font-size: 1rem; font-weight: 600; transition: all .2s; }
.wptm-btn-submit { background: var(--wptm-primary); color: #fff; }
.wptm-btn-submit:hover { background: var(--wptm-secondary); transform: translateY(-1px); }
.wptm-btn-prev-nav { background: transparent; color: var(--wptm-primary); border: 1.5px solid var(--wptm-primary); }
.wptm-form-actions { display: flex; gap: 12px; margin-top: 1rem; }
.wptm-form-messages { margin-top: 1rem; padding: .8rem 1.2rem; border-radius: 8px; font-weight: 500; display: none; }
.wptm-form-messages.success { background: #e8f5ee; color: #1a7a4a; border: 1px solid #a3d9b8; display: block; }
.wptm-form-messages.error   { background: #fde8e8; color: #721c24; border: 1px solid #f5c6cb; display: block; }

/* Wizard */
.wptm-wizard-progress { margin-bottom: 1.5rem; }
.wptm-wizard-bar { height: 6px; background: var(--wptm-card-border); border-radius: 3px; }
.wptm-wizard-bar-fill { height: 100%; background: var(--wptm-primary); border-radius: 3px; transition: width .4s; }
.wptm-wizard-label { font-size: .82rem; color: var(--wptm-muted); margin-top: .4rem; display: block; }
.wptm-step { display: none; }
.wptm-step.active { display: block; animation: wptm-fadein .3s ease; }
.wptm-wizard-nav { display: flex; gap: 12px; margin-top: 1rem; }
@keyframes wptm-fadein { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* Recorder */
.wptm-recorder { background: var(--wptm-tag-bg); border: 1.5px solid var(--wptm-card-border); border-radius: 10px; padding: 1rem; }
.wptm-recorder-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.wptm-rec-btn { display: inline-flex; align-items: center; gap: 6px; padding: .5rem 1rem; border: 1.5px solid var(--wptm-primary); border-radius: 8px; background: var(--wptm-bg); color: var(--wptm-primary); cursor: pointer; font-size: .86rem; font-weight: 600; transition: all .2s; }
.wptm-rec-start { background: var(--wptm-primary); color: #fff; }
.wptm-rec-start.recording { background: #dc3232; border-color: #dc3232; animation: wptm-pulse 1s infinite; }
@keyframes wptm-pulse { 0%,100%{opacity:1} 50%{opacity:.7} }
.wptm-recorder-timer { font-size: .8rem; color: var(--wptm-muted); margin-top: 6px; }
.wptm-rec-preview-audio { width: 100%; height: 36px; margin-top: 8px; }

/* Iframe */
.wptm-iframe-code { background: var(--wptm-tag-bg); border: 1px solid var(--wptm-card-border); padding: 1rem; border-radius: 8px; }
.wptm-iframe-textarea { width: 100%; font-family: monospace; font-size: .8rem; padding: .5rem; border: 1px solid var(--wptm-card-border); border-radius: 6px; background: var(--wptm-bg); height: 72px; resize: vertical; color: var(--wptm-text); }
