/* v3.0 ENGAGEMENT - contests, newsletter, gamification styles.
   Loaded on public pages only; admin uses its own styles. Theme: #1283E6. */

/* ---------- Contests page ---------- */
.ct-wrap{max-width:1100px;margin:0 auto;padding:26px 16px 60px}
.ct-hero{background:linear-gradient(135deg,#1283E6,#0B63B8);color:#fff;border-radius:20px;padding:34px 28px;margin-bottom:26px;position:relative;overflow:hidden}
.ct-hero::after{content:'🏆';position:absolute;right:22px;top:14px;font-size:84px;opacity:.16}
.ct-hero h1{font-size:26px;letter-spacing:-.02em;margin:0 0 6px}
.ct-hero .ct-theme{font-size:15px;opacity:.92;margin:0 0 12px}
.ct-countdown{display:inline-flex;gap:8px;flex-wrap:wrap;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);border-radius:12px;padding:8px 14px;font-weight:700;font-size:14px}
.ct-badge{display:inline-block;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:#fff;color:#0B63B8;border-radius:99px;padding:5px 14px;margin-bottom:10px}
.ct-badge.past{background:#EAF4FE;color:#0B63B8}
.ct-section-title{font-size:19px;font-weight:800;letter-spacing:-.01em;margin:30px 0 14px;display:flex;align-items:center;gap:10px}
.ct-section-title .n{background:#EAF4FE;color:#0B63B8;border-radius:99px;font-size:13px;padding:3px 12px}
.ct-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px}
.ct-card{background:#fff;border-radius:16px;box-shadow:0 4px 18px rgba(11,99,184,.08);overflow:hidden;border:1px solid #EDF2F7}
.ct-video{position:relative;background:#0B1F33;aspect-ratio:16/9;overflow:hidden}
.ct-video iframe,.ct-video video{width:100%;height:100%;border:0;display:block}
.ct-body{padding:16px 18px 18px}
.ct-cap{font-size:14.5px;color:#3D5469;margin:0 0 10px;line-height:1.55}
.ct-meta{display:flex;align-items:center;gap:10px;margin-bottom:12px;font-size:13px;color:#8AA0B4}
.ct-meta .u-av{width:30px;height:30px;border-radius:99px;background:linear-gradient(135deg,#2FA0F0,#0B63B8);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:13px}
.ct-actions{display:flex;align-items:center;gap:10px}
.ct-vote{flex:1}
.ct-votes{font-size:13.5px;font-weight:700;color:#0B63B8}
.ct-entry-form{background:#fff;border-radius:16px;box-shadow:0 4px 18px rgba(11,99,184,.08);border:1px solid #EDF2F7;padding:22px;margin:26px 0}
.ct-entry-form h2{font-size:18px;margin:0 0 4px}
.ct-entry-form .sub{color:#8AA0B4;font-size:13.5px;margin:0 0 16px}
.ct-lock{background:#FFF7E6;border:1px solid #F5D98B;color:#8a5a00;border-radius:14px;padding:16px 18px;margin:26px 0;font-size:14.5px}
.ct-lock a{color:#0B63B8;font-weight:700}
.ct-winner-card{border:2px solid #1283E6;background:linear-gradient(180deg,#F3FAFF,#fff)}
.ct-winner-flag{display:inline-flex;align-items:center;gap:6px;background:linear-gradient(135deg,#FFC531,#F59E0B);color:#5b3b00;font-weight:800;font-size:12.5px;border-radius:99px;padding:5px 14px;margin-bottom:10px}
.ct-past{margin-top:34px}
.ct-past-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.ct-past-card{background:#fff;border:1px solid #EDF2F7;border-radius:14px;padding:16px 18px}
.ct-past-card h3{margin:0 0 4px;font-size:15.5px}
.ct-past-card p{margin:0 0 8px;font-size:13px;color:#8AA0B4}
.ct-past-card .win{font-size:13.5px;color:#0B63B8;font-weight:700}
.ct-empty{text-align:center;color:#8AA0B4;padding:40px 16px;background:#fff;border-radius:16px;border:1px dashed #D5E4F3}

/* ---------- Newsletter footer form ---------- */
.nl-foot{margin:22px auto 6px;max-width:520px;text-align:center}
.nl-foot .nl-title{font-weight:800;font-size:15.5px;margin-bottom:4px}
.nl-foot .nl-sub{font-size:13px;color:var(--muted);margin-bottom:12px}
.nl-foot form{display:flex;gap:8px;justify-content:center}
.nl-foot input[type=email]{flex:1;max-width:320px;border-radius:99px;border:1px solid #D5E4F3;padding:11px 18px;font-size:14px;background:#fff;color:#0B1F33}
.nl-foot input[type=email]:focus{outline:2px solid #1283E6;border-color:#1283E6}
.nl-foot button{border-radius:99px;border:0;background:linear-gradient(135deg,#2FA0F0,#0B63B8);color:#fff;font-weight:800;font-size:14px;padding:11px 24px;cursor:pointer;white-space:nowrap}
.nl-foot button:hover{filter:brightness(1.06)}

/* ---------- Gamification tab ---------- */
.gm-tab{background:#fff;border-radius:18px;box-shadow:0 4px 18px rgba(11,99,184,.08);border:1px solid #EDF2F7;padding:24px;margin-bottom:24px}
.gm-tab h2{margin:0 0 16px;font-size:19px;letter-spacing:-.01em}
.gm-level{display:flex;align-items:center;gap:16px;margin-bottom:18px}
.gm-level-num{width:64px;height:64px;border-radius:20px;background:linear-gradient(135deg,#1283E6,#0B63B8);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;box-shadow:0 6px 18px rgba(18,131,230,.35)}
.gm-level-num .lv{font-size:9px;font-weight:800;letter-spacing:.12em;opacity:.85}
.gm-level-num .n{font-size:26px;font-weight:800;line-height:1}
.gm-level-info{flex:1}
.gm-level-info .xp{font-size:14.5px;font-weight:700;color:#0B1F33}
.gm-level-info .next{font-size:12.5px;color:#8AA0B4;margin-top:2px}
.gm-bar{height:12px;background:#EDF2F7;border-radius:99px;overflow:hidden;margin-top:8px}
.gm-bar > span{display:block;height:100%;background:linear-gradient(90deg,#2FA0F0,#0B63B8);border-radius:99px;transition:width .4s}
.gm-badge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:6px}
.gm-badge{background:#F8FBFE;border:1px solid #EDF2F7;border-radius:14px;padding:16px 12px;text-align:center;transition:transform .15s}
.gm-badge.earned{background:#fff;border-color:#1283E6;box-shadow:0 4px 14px rgba(18,131,230,.14)}
.gm-badge.earned:hover{transform:translateY(-3px)}
.gm-badge .ic{font-size:34px;margin-bottom:8px}
.gm-badge .nm{font-weight:800;font-size:13.5px;color:#0B1F33}
.gm-badge .ds{font-size:12px;color:#8AA0B4;margin-top:4px;line-height:1.45}
.gm-badge.locked{opacity:.45;filter:grayscale(.9)}
.gm-badge.locked .nm::after{content:' 🔒';font-size:11px}

/* ---------- Admin contests ---------- */
.ct-admin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px;margin-top:20px}
.ct-admin-card{background:#fff;border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:20px;position:relative;overflow:hidden}
.ct-admin-card::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,#1283E6,#7C3AED)}
.ct-admin-card h3{margin:0 0 6px;font-size:16px}
.ct-admin-card .theme{color:var(--muted);font-size:13px;margin-bottom:10px}
.ct-admin-pills{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 14px}
.ct-admin-actions{display:flex;gap:8px;flex-wrap:wrap}
.ct-status-upcoming{background:#EAF4FE;color:#0B63B8}
.ct-status-active{background:#E6F9EE;color:#15803D}
.ct-status-completed{background:#F1F5F9;color:#64748B}
.ct-entry-table td .thumb-link{max-width:220px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}

@media (max-width:640px){
  .ct-hero{padding:24px 20px}
  .ct-hero h1{font-size:22px}
  .nl-foot form{flex-direction:column}
  .nl-foot input[type=email]{max-width:none}
  .nl-foot button{width:100%}
  .gm-badge-grid{grid-template-columns:repeat(2,1fr)}
}
