/**
 * Nedava Donor Ticker — Frontend Styles
 * Version: 1.4
 * Desktop: horizontal | Mobile: vertical
 * Inherits dir from page
 */

/* ============================================
   WRAPPER
   ============================================ */

.nedava-ticker-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 12px 0;
}

/* ============================================
   HORIZONTAL (Desktop) — fade edges blakc_900
   ============================================ */

.nedava-ticker-horizontal {
    overflow: hidden;
    position: relative;
}

.nedava-ticker-horizontal::before,
.nedava-ticker-horizontal::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.nedava-ticker-horizontal::before {
    right: 0;
    background: linear-gradient(to left, var(--blakc_900, #1a1a1a), transparent);
}

.nedava-ticker-horizontal::after {
    left: 0;
    background: linear-gradient(to right, var(--blakc_900, #1a1a1a), transparent);
}

.nedava-ticker-track {
    display: flex;
    gap: 12px;
    width: max-content;
    animation: nedava-scroll-rtl var(--nedava-speed, 20s) linear infinite;
}

[dir="ltr"] .nedava-ticker-track {
    animation-name: nedava-scroll-ltr;
}

@keyframes nedava-scroll-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

@keyframes nedava-scroll-ltr {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   CHIP — shared style (horizontal)
   ============================================ */

.nedava-ticker-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 100px;
    padding: 6px 18px 6px 8px;
    background: var(--blakc_850, #222);
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: default;
    transition: border-color 0.3s ease;
}

.nedava-ticker-chip:hover {
    border-color: var(--green, #4CAF50);
}

/* ============================================
   VERTICAL (Mobile) — hidden on desktop
   ============================================ */

.nedava-ticker-vertical {
    display: none;
    overflow: hidden;
    position: relative;
    height: 52px;
}

.nedava-ticker-vertical::before,
.nedava-ticker-vertical::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 14px;
    z-index: 2;
    pointer-events: none;
}

.nedava-ticker-vertical::before {
    top: 0;
    background: linear-gradient(to bottom, var(--blakc_900, #1a1a1a), transparent);
}

.nedava-ticker-vertical::after {
    bottom: 0;
    background: linear-gradient(to top, var(--blakc_900, #1a1a1a), transparent);
}

.nedava-ticker-vtrack {
    display: flex;
    flex-direction: column;
    animation: nedava-vscroll var(--nedava-vspeed, 20s) linear infinite;
}

@keyframes nedava-vscroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.nedava-ticker-vitem {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 6px 16px;
    margin-bottom: 8px;
    background: var(--blakc_850, #222);
    border-radius: 100px;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.nedava-ticker-vitem:hover {
    border-color: var(--green, #4CAF50);
}

/* ============================================
   AMOUNT — green text, no background
   ============================================ */

.nedava-ticker-amount {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    color: var(--green, #4CAF50);
    line-height: 1;
}

.nedava-ticker-amount-num {
    font-size: 14px;
    font-weight: 700;
}

.nedava-ticker-amount-cur {
    font-size: 11px;
    font-weight: 400;
}

/* ============================================
   CONTENT — name + separator + blessing
   ============================================ */

.nedava-ticker-content {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
}

.nedava-ticker-name {
    color: var(--blakc_50, #fff);
}

.nedava-ticker-sep {
    display: inline-block;
    width: 12px;
    height: 1px;
    background: var(--blakc_600, rgba(255,255,255,0.25));
    flex-shrink: 0;
    vertical-align: middle;
}

.nedava-ticker-blessing {
    color: var(--blakc_50, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.nedava-progress-wrapper {
    width: 100%;
    direction: rtl;
}

/* Top row — percentage, aligned right */
.nedava-progress-top {
    text-align: right;
    margin-bottom: 6px;
}

.nedava-progress-pct {
    color: var(--green, #4CAF50);
}

/* Bar */
.nedava-progress-bar {
    width: 100%;
    background: var(--blakc_800, #2a2a2a);
    border-radius: 100px;
    overflow: hidden;
}

.nedava-progress-fill {
    height: 100%;
    background: var(--green, #4CAF50);
    border-radius: 100px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Bottom row — raised + goal */
.nedava-progress-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
}

.nedava-progress-raised {
    color: var(--blakc_50, #fff);
}

.nedava-progress-goal {
    color: var(--blakc_400, rgba(255,255,255,0.6));
}

/* ============================================
   CIRCLE PROGRESS — SVG in aspect-ratio div
   ============================================ */

.nedava-progress-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.nedava-ring {
    position: relative;
    width: 4em;
    aspect-ratio: 1 / 1;
}

.nedava-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    display: block;
}

.nedava-ring-bg {
    fill: none;
    stroke: var(--blakc_800, #2a2a2a);
}

.nedava-ring-fill {
    fill: none;
    stroke: var(--green, #4CAF50);
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nedava-ring-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--green, #4CAF50);
    line-height: 1;
    white-space: nowrap;
}

/* ============================================
   HIDDEN / UTILITY
   ============================================ */

.nedava-ticker-empty { display: none; }
.nedava-ticker-pause { display: none; }
.nedava-donor-count,
.nedava-donor-total { /* Styled by user in Elementor */ }

/* ============================================
   RESPONSIVE — switch to vertical on mobile
   ============================================ */

@media (max-width: 768px) {
    .nedava-ticker-horizontal {
        display: none;
    }

    .nedava-ticker-vertical {
        display: block;
    }

    .nedava-ticker-blessing {
        max-width: 160px;
    }

    .nedava-ticker-amount-num { font-size: 12px; }
    .nedava-ticker-amount-cur { font-size: 9px; }
}

/* ============================================
   DONATION LIST — [donation_list]
   ============================================ */

.nedava-list-wrapper {
    width: 100%;
}

/* Controls row */
.nedava-list-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--gap-main, 18px);
    flex-wrap: wrap;
    direction: rtl;
}

/* Search */
.nedava-list-search-wrap {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.nedava-list-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blakc_400, rgba(245,245,240,0.5));
    pointer-events: none;
    display: flex;
    align-items: center;
    width: 14px;
    height: 14px;
}

/* specificity גבוה מספיק לנצח את reset.css input[type=text] */
.nedava-list-wrapper input[type="text"].nedava-list-search {
    background: transparent !important;
    border: 1px solid var(--blakc_600, rgba(245,245,240,0.12)) !important;
    border-radius: var(--radus-small, 100px) !important;
    padding: 8px 16px 8px 40px !important;
    color: var(--blakc_400, rgba(245,245,240,0.5)) !important;
    outline: none !important;
    box-shadow: none !important;
    direction: rtl !important;
    text-align: right !important;
    height: auto !important;
    margin: 0 !important;
    transition: border-color 0.2s, color 0.2s;
}

.nedava-list-wrapper input[type="text"].nedava-list-search::placeholder {
    color: var(--blakc_400, rgba(245,245,240,0.5));
    opacity: 0.65;
}

.nedava-list-wrapper input[type="text"].nedava-list-search:focus {
    border-color: rgba(245,245,240,0.28) !important;
    color: var(--blakc_50, #f5f5f0) !important;
}

/* Sort dropdown */
.nedava-list-sort-wrap {
    position: relative;
}

.nedava-list-sort-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent !important;
    border: 1px solid var(--blakc_600, rgba(245,245,240,0.12)) !important;
    border-radius: var(--radus-small, 100px);
    padding: 8px 13px;
    color: var(--blakc_400, rgba(245,245,240,0.5)) !important;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.nedava-list-sort-btn:hover,
.nedava-list-sort-btn:focus,
.nedava-list-sort-btn:active {
    background: transparent !important;
    border-color: var(--green, #4CAF50) !important;
    color: var(--green, #4CAF50) !important;
    box-shadow: none !important;
    outline: none;
}

.nedava-list-sort-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--blakc_850, #1e1e1a);
    border: 1px solid var(--blakc_600, rgba(245,245,240,0.12));
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    min-width: 140px;
}

.nedava-list-sort-dropdown.nedava-open {
    display: block;
}

.nedava-list-sort-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    color: var(--blakc_400, rgba(245,245,240,0.5));
}

.nedava-list-sort-option:hover {
    background: var(--blakc_800, #2a2a26);
    color: var(--blakc_50, #f5f5f0);
}

.nedava-list-sort-option.active {
    color: var(--green, #4CAF50);
}

/* Count */
.nedava-list-count {
    color: var(--blakc_400, rgba(245,245,240,0.5));
    opacity: 0.65;
    white-space: nowrap;
}

.nedava-list-count-num {
    color: var(--blakc_50, #f5f5f0);
    opacity: 1;
}

/* Grid */
.nedava-list-grid {
    display: grid;
    gap: var(--gap-main, 10px);
    margin-bottom: 14px;
}

.nedava-list-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.nedava-list-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.nedava-list-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.nedava-list-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.nedava-list-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.nedava-list-cols-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }

/* Card */
.nedava-list-card {
    background: var(--blakc_850, #1e1e1a);
    border-radius: var(--radus-main, 14px);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: outline 0.2s;
    cursor: default;
    outline: 1px solid transparent;
}

.nedava-list-card:hover {
    outline: 1px solid var(--green, #4CAF50);
}

.nedava-list-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.nedava-list-card-name {
    line-height: 1.3;
    word-break: break-word;
    color: var(--blakc_50, #f5f5f0);
}

.nedava-list-card-amount {
    color: var(--green, #4CAF50);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.nedava-list-card-amount em {
    font-size: 0.65em;
    font-style: normal;
    margin-right: 1px;
}

.nedava-list-card-blessing {
    color: var(--blakc_400, rgba(245,245,240,0.5));
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nedava-list-card-date {
    color: var(--blakc_400, rgba(245,245,240,0.5));
    opacity: 0.55;
    margin-top: 2px;
}

/* Empty state */
.nedava-list-empty {
    text-align: center;
    color: var(--blakc_400, rgba(245,245,240,0.5));
    padding: 40px 0;
}

/* Footer / load more */
.nedava-list-footer {
    text-align: center;
    padding-top: 4px;
}

.nedava-list-load-more {
    background: transparent !important;
    border: 1px solid var(--blakc_600, rgba(245,245,240,0.12)) !important;
    border-radius: 100px;
    padding: 10px 28px;
    color: var(--blakc_400, rgba(245,245,240,0.5)) !important;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.nedava-list-load-more:hover,
.nedava-list-load-more:focus {
    background: transparent !important;
    border-color: var(--green, #4CAF50) !important;
    color: var(--green, #4CAF50) !important;
    box-shadow: none !important;
    outline: none;
}

.nedava-list-load-more:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Search highlighting */
.nedava-list-highlight {
    background: rgba(122,191,78,0.45);
    color: #fff;
    border-radius: 2px;
    padding: 0 1px;
}

/* Responsive */
@media (max-width: 900px) {
    .nedava-list-cols-4,
    .nedava-list-cols-5,
    .nedava-list-cols-6 {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 600px) {
    .nedava-list-grid {
        grid-template-columns: repeat(1, minmax(0,1fr)) !important;
    }
    .nedava-list-card {
        padding: 20px;
    }
    .nedava-list-controls {
        flex-wrap: wrap;
    }
    .nedava-list-search-wrap {
        min-width: 100%;
        order: -1;
    }
}
