/* ─── Sponsored Sports Day ──────────────────────────────────────────────────── */
/* School Theme: Dark teal/navy gradient, white text, child-friendly rounded UI */

/* Reset within plugin */
.ssd-page { max-width: 640px; margin: 0 auto; padding: 20px 16px; font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif; color: #0f172a; }
.ssd-page *, .ssd-page *::before, .ssd-page *::after { box-sizing: border-box; }

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.ssd-hero {
    background: linear-gradient(135deg, #1a4a5e 0%, #0d3344 100%);
    border-radius: 20px;
    padding: 36px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(13, 51, 68, 0.4);
    position: relative;
    overflow: hidden;
}
.ssd-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.ssd-hero::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -15%;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    border-radius: 50%;
}
.ssd-hero-icon { font-size: 56px; margin-bottom: 8px; position: relative; z-index: 1; }
.ssd-hero-title { font-size: 28px; font-weight: 900; margin: 0 0 6px; letter-spacing: -0.02em; position: relative; z-index: 1; }
.ssd-hero-sub { font-size: 14px; color: rgba(255,255,255,0.75); margin: 0 0 4px; position: relative; z-index: 1; line-height: 1.5; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.ssd-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.ssd-card-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; color: #0f172a; }
.ssd-card-desc { font-size: 14px; color: #64748b; margin: 0 0 20px; line-height: 1.6; }

/* ─── Stats ────────────────────────────────────────────────────────────────── */
.ssd-stats-row { display: flex; gap: 12px; margin-bottom: 20px; }
.ssd-stats-3 .ssd-stat-card { flex: 1; }
.ssd-stat-card {
    flex: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.ssd-stat-highlight {
    background: linear-gradient(135deg, #1a4a5e, #0d3344);
    border-color: transparent;
    color: #fff;
}
.ssd-stat-val { font-size: 26px; font-weight: 900; line-height: 1; }
.ssd-stat-highlight .ssd-stat-val { color: #5eead4; }
.ssd-stat-label { font-size: 12px; font-weight: 600; color: #64748b; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.ssd-stat-highlight .ssd-stat-label { color: rgba(255,255,255,0.7); }

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.ssd-form-group { margin-bottom: 14px; }
.ssd-label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 5px; }
.ssd-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.ssd-input:focus { border-color: #1a4a5e; box-shadow: 0 0 0 3px rgba(26,74,94,0.12); }
.ssd-select { appearance: auto; cursor: pointer; }
.ssd-textarea { resize: vertical; min-height: 60px; }

.ssd-input-prefix-wrap { position: relative; display: flex; align-items: center; }
.ssd-input-prefix { position: absolute; left: 14px; font-size: 16px; font-weight: 700; color: #64748b; pointer-events: none; }
.ssd-input-prefixed { padding-left: 32px; }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.ssd-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.ssd-btn:hover { transform: scale(1.03); }
.ssd-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ssd-btn-primary {
    background: linear-gradient(135deg, #1a4a5e, #0d3344);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(13,51,68,0.3);
}
.ssd-btn-primary:hover { box-shadow: 0 6px 24px rgba(13,51,68,0.4); }

.ssd-btn-secondary {
    background: #e2e8f0;
    color: #334155 !important;
}

.ssd-btn-large { width: 100%; padding: 16px; font-size: 17px; margin-top: 8px; }

/* ─── Amount Grid ──────────────────────────────────────────────────────────── */
.ssd-amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ssd-amount-btn {
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 18px;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.ssd-amount-btn:hover { border-color: #1a4a5e; background: #f0f7fa; }
.ssd-amount-btn.ssd-amount-selected {
    border-color: #1a4a5e;
    background: linear-gradient(135deg, #1a4a5e, #0d3344);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13,51,68,0.25);
}

/* ─── Donors List ──────────────────────────────────────────────────────────── */
.ssd-donors-list { display: flex; flex-direction: column; gap: 0; }
.ssd-donor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.ssd-donor-item:last-child { border-bottom: none; }
.ssd-donor-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a4a5e, #2d6a7e);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
    flex-shrink: 0;
}
.ssd-donor-info { flex: 1; min-width: 0; }
.ssd-donor-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.ssd-donor-msg { font-size: 12px; color: #64748b; margin-top: 2px; font-style: italic; }
.ssd-donor-amount { font-size: 16px; font-weight: 800; color: #15803d; flex-shrink: 0; }

/* ─── Year Group Grid (overview page — GDPR safe) ────────────────────────── */
.ssd-yg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }

.ssd-yg-card {
    margin-bottom: 0;
    border-left: 4px solid #1a4a5e;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ssd-yg-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.1); }
.ssd-yg-card .ssd-card-title { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.ssd-yg-dist {
    font-size: 12px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #1a4a5e, #2d6a7e);
    padding: 3px 10px; border-radius: 999px;
}

.ssd-yg-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ssd-yg-icon {
    font-size: 32px; flex-shrink: 0;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f0f7fa, #e0f2fe);
    border-radius: 14px;
}
.ssd-yg-info { flex: 1; }

.ssd-yg-stats-row { display: flex; gap: 10px; }
.ssd-yg-stat {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}
.ssd-yg-stat-val { font-size: 20px; font-weight: 900; color: #0f172a; line-height: 1; }
.ssd-yg-stat-raised { color: #15803d !important; }
.ssd-yg-stat-label { font-size: 10px; font-weight: 700; color: #94a3b8; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

.ssd-yg-progress-wrap {
    margin-top: 14px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.ssd-yg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a4a5e, #2d8a7e);
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* ─── GDPR Checkbox ───────────────────────────────────────────────────────── */
.ssd-gdpr-group { margin-top: 8px; }
.ssd-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    cursor: pointer;
}
.ssd-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #1a4a5e;
}

/* ─── Share Buttons ───────────────────────────────────────────────────────── */
.ssd-share-buttons { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ssd-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    transition: all 0.15s;
    font-family: inherit;
}
.ssd-share-btn:hover { transform: scale(1.03); }
.ssd-share-whatsapp { border-color: #25d366; color: #128c7e; background: #f0fdf4; }
.ssd-share-whatsapp:hover { background: #dcfce7; color: #128c7e; }
.ssd-share-facebook { border-color: #1877f2; color: #1877f2; background: #eff6ff; }
.ssd-share-facebook:hover { background: #dbeafe; color: #1877f2; }
.ssd-share-copy { border-color: #e2e8f0; }
.ssd-share-copy:hover { background: #f1f5f9; }

/* ─── QR Code ─────────────────────────────────────────────────────────────── */
.ssd-qr-wrap { text-align: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.ssd-qr-img { border-radius: 12px; border: 2px solid #e2e8f0; }
.ssd-qr-label { font-size: 11px; color: #94a3b8; margin-top: 6px; }

/* ─── Leaderboard ─────────────────────────────────────────────────────────── */
.ssd-leaderboard-card { padding: 24px 20px; }
.ssd-leaderboard { display: flex; flex-direction: column; gap: 8px; }
.ssd-lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ssd-lb-row:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.ssd-lb-first {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-color: #fde68a;
    box-shadow: 0 4px 16px rgba(253,224,71,0.25);
}
.ssd-lb-first:hover { box-shadow: 0 6px 20px rgba(253,224,71,0.35); }
.ssd-lb-rank {
    font-size: 26px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.ssd-lb-first .ssd-lb-rank { background: rgba(255,255,255,0.8); box-shadow: 0 2px 8px rgba(253,224,71,0.3); }
.ssd-lb-info { flex: 1; min-width: 0; }
.ssd-lb-name { font-size: 16px; font-weight: 800; color: #0f172a; }
.ssd-lb-meta { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.ssd-lb-amount {
    font-size: 18px; font-weight: 900; color: #15803d; flex-shrink: 0;
    background: #f0fdf4; padding: 6px 12px; border-radius: 8px;
    border: 1px solid #bbf7d0;
}

/* ─── Sponsor Wall / Ticker ───────────────────────────────────────────────── */
.ssd-wall-card { overflow: hidden; }
.ssd-wall-ticker { overflow: hidden; position: relative; }
.ssd-wall-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 280px;
    overflow-y: auto;
}
.ssd-wall-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    flex-wrap: wrap;
}
.ssd-wall-item:last-child { border-bottom: none; }
.ssd-wall-name { font-weight: 700; color: #0f172a; }
.ssd-wall-amount { font-weight: 800; color: #15803d; }
.ssd-wall-msg { color: #64748b; font-style: italic; font-size: 12px; }

/* ─── Success / Share ──────────────────────────────────────────────────────── */
.ssd-success-icon { font-size: 56px; margin-bottom: 8px; text-align: center; }
.ssd-success-card { text-align: center; }
.ssd-share-box { margin: 20px 0; }
.ssd-share-label { font-size: 13px; font-weight: 600; color: #64748b; margin: 0 0 8px; }
.ssd-share-url-box { display: flex; gap: 8px; }
.ssd-share-input { flex: 1; font-size: 13px; background: #f8fafc; }

/* ─── Status / Notes ───────────────────────────────────────────────────────── */
.ssd-status { font-size: 13px; margin: 10px 0 0; text-align: center; }
.ssd-secure-note { font-size: 12px; color: #94a3b8; text-align: center; margin: 8px 0 0; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ssd-page { padding: 12px 10px; }
    .ssd-hero { padding: 28px 16px; }
    .ssd-hero-title { font-size: 22px; }
    .ssd-stats-row { gap: 8px; }
    .ssd-stat-val { font-size: 20px; }
    .ssd-amount-grid { grid-template-columns: repeat(2, 1fr); }
    .ssd-yg-grid { grid-template-columns: 1fr; }
    .ssd-yg-stats-row { gap: 6px; }
    .ssd-yg-stat-val { font-size: 17px; }
    .ssd-share-url-box { flex-direction: column; }
}

/* ─── Sports Day Dates Slide-out Panel ─────────────────────────────────────── */
.ssd-dates-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: linear-gradient(180deg, #1a4a5e, #0d3344);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 16px 10px;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    box-shadow: 2px 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    border: none;
}
.ssd-dates-tab:hover { transform: translateY(-50%) scale(1.05); box-shadow: 2px 6px 20px rgba(0,0,0,0.3); }
.ssd-dates-tab.ssd-dates-open { opacity: 0; pointer-events: none; }

.ssd-dates-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.ssd-dates-overlay.ssd-dates-visible { opacity: 1; pointer-events: auto; }

.ssd-dates-panel {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 340px;
    max-width: 85vw;
    background: #fff;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.ssd-dates-panel.ssd-dates-visible { transform: translateX(0); }

.ssd-dates-header {
    background: linear-gradient(135deg, #1a4a5e, #0d3344);
    color: #fff;
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ssd-dates-header h2 { margin: 0; font-size: 18px; font-weight: 800; }
.ssd-dates-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.ssd-dates-close:hover { background: rgba(255,255,255,0.25); }

.ssd-dates-body { padding: 20px; flex: 1; }

.ssd-dates-term {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a4a5e;
    background: #e0f2fe;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 0 12px;
}

.ssd-dates-group {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #1a4a5e;
    border-radius: 10px;
}
.ssd-dates-group-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}
.ssd-dates-event {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin: 0;
}
.ssd-dates-event strong { color: #0f172a; }
.ssd-dates-reserve {
    font-size: 12px;
    color: #94a3b8;
    margin: 4px 0 0;
    font-style: italic;
}

/* ─── Social Proof Ticker ──────────────────────────────────────────────────── */
.ssd-ticker-bar {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
    height: 44px;
}
.ssd-ticker-bar::before, .ssd-ticker-bar::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}
.ssd-ticker-bar::before { left: 0; background: linear-gradient(90deg, #ecfdf5, transparent); }
.ssd-ticker-bar::after  { right: 0; background: linear-gradient(270deg, #ecfdf5, transparent); }

.ssd-ticker-track {
    display: flex;
    gap: 48px;
    animation: ssdTickerScroll 30s linear infinite;
    white-space: nowrap;
    align-items: center;
    height: 44px;
}
.ssd-ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 4px;
}
.ssd-ticker-emoji { font-size: 18px; }
.ssd-ticker-text { font-size: 13px; color: #166534; font-weight: 500; }
.ssd-ticker-text strong { font-weight: 800; color: #15803d; }
.ssd-ticker-ago { font-size: 11px; color: #86efac; font-weight: 600; background: #166534; padding: 2px 8px; border-radius: 20px; }

@keyframes ssdTickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ─── Thank You Page — Personalised ───────────────────────────────────────── */
.ssd-thankyou-page { position: relative; overflow: hidden; }

.ssd-ty-amount-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    padding: 8px 24px;
    border-radius: 16px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.ssd-ty-fun-msg {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.5;
    margin: 0 0 12px;
}

/* Confetti */
.ssd-confetti-container {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 1s ease;
}
.ssd-confetti-piece {
    position: absolute;
    top: -20px;
    opacity: 0;
    animation: ssdConfettiFall ease-in forwards;
}
@keyframes ssdConfettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ─── Animations ───────────────────────────────────────────────────────────── */
@keyframes ssdFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.ssd-card { animation: ssdFadeIn 0.4s ease; }
.ssd-hero { animation: ssdFadeIn 0.5s ease; }
