/* ══════════════════════════════════════════
   Ka'umsa Haaraa — Frontend Styles
   Black & Gold Lottery Ticket Theme
   ══════════════════════════════════════════ */

:root {
    --kh-gold:        #D4AF37;
    --kh-gold-dark:   #AA7C11;
    --kh-gold-light:  #f0d060;
    --kh-bg:          #111111;
    --kh-card:        #1a1a1a;
    --kh-card2:       #222222;
    --kh-border:      rgba(212,175,55,0.25);
    --kh-text:        #ffffff;
    --kh-muted:       #aaaaaa;
    --kh-red:         #a83232;
    --kh-green:       #2a7a2a;
    --kh-radius:      12px;
    --kh-transition:  0.22s ease;
}

/* ── Force dark background on ALL ancestor containers ── */
html, body {
    background: #111111 !important;
    background-color: #111111 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.site, .site-content, #content, #page,
.entry-content, .post-content, .page-content,
article.page, article.post, article, main,
#main, .main, .hentry, .content-area,
.wp-block-group, .wp-block-post-content,
.elementor-section-wrap, .elementor-widget-container,
.ast-container, .ast-page-builder-template,
.container, .site-inner, .content-sidebar-wrap {
    background: #111111 !important;
    background-color: #111111 !important;
}
/* Remove theme padding/margin that offsets the wrapper */
.entry-content, .post-content, .page-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Reset wrapper ─────────────────────── */
#kh-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #111111;
    color: #ffffff;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}
#kh-wrapper *, #kh-wrapper *::before, #kh-wrapper *::after {
    box-sizing: border-box;
}

/* ── Hero ──────────────────────────────── */
.kh-hero {
    text-align: center;
    padding: 50px 16px 40px;
    background: radial-gradient(ellipse at top, #1d1a00 0%, #111111 70%);
    border-bottom: 1px solid var(--kh-border);
}
.kh-hero-badge {
    display: inline-block;
    background: rgba(212,175,55,0.12);
    border: 1px solid var(--kh-border);
    color: var(--kh-gold);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.kh-hero-title {
    font-size: clamp(26px, 7vw, 56px);
    font-weight: 900;
    color: var(--kh-gold);
    letter-spacing: 2px;
    margin: 0 0 12px;
    text-shadow: 0 0 40px rgba(212,175,55,0.4);
    word-break: break-word;
}
.kh-hero-subtitle {
    font-size: clamp(14px, 3.5vw, 18px);
    color: var(--kh-muted);
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.7;
    padding: 0 8px;
}
.kh-draw-date {
    display: inline-block;
    background: rgba(212,175,55,0.08);
    border: 1px solid var(--kh-border);
    color: var(--kh-gold-light);
    padding: 7px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}
.kh-price-badge {
    font-size: 15px;
    color: var(--kh-muted);
    margin-bottom: 24px;
}
.kh-price-badge strong { color: var(--kh-gold); }

/* ── Buttons ───────────────────────────── */
.kh-btn-main {
    display: inline-block;
    background: linear-gradient(135deg, var(--kh-gold-dark), var(--kh-gold));
    color: #111;
    padding: 14px 32px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(212,175,55,0.35);
    transition: var(--kh-transition);
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.kh-btn-main:hover, .kh-btn-main:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(212,175,55,0.55);
    color: #000;
}
.kh-btn-main.kh-btn-full {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 16px;
    font-size: 17px;
    margin-top: 10px;
    text-align: center;
}
.kh-btn-outline {
    background: transparent;
    border: 1px solid var(--kh-gold);
    color: var(--kh-gold);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--kh-transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.kh-btn-outline:hover, .kh-btn-outline:active {
    background: rgba(212,175,55,0.1);
}

/* ── Stats bar ─────────────────────────── */
.kh-stats-bar {
    display: flex;
    justify-content: center;
    background: var(--kh-card);
    border-bottom: 1px solid var(--kh-border);
    flex-wrap: wrap;
}
.kh-stat {
    flex: 1 1 30%;
    text-align: center;
    padding: 16px 8px;
    border-right: 1px solid var(--kh-border);
    min-width: 80px;
}
.kh-stat:last-child { border-right: none; }
.kh-stat-num {
    display: block;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    color: var(--kh-gold);
    line-height: 1.2;
}
.kh-stat-label {
    display: block;
    font-size: 10px;
    color: var(--kh-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── Section ───────────────────────────── */
.kh-section {
    padding: 36px 12px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.kh-section-title {
    text-align: center;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    color: var(--kh-gold);
    margin: 0 0 10px;
}
.kh-section-desc {
    text-align: center;
    color: var(--kh-muted);
    margin: 0 0 28px;
    font-size: 14px;
    padding: 0 8px;
}

/* ── Card ──────────────────────────────── */
.kh-card {
    background: var(--kh-card);
    border: 1px solid var(--kh-border);
    border-radius: 14px;
    padding: 20px 14px;
}

/* ── Alert ─────────────────────────────── */
.kh-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
}
.kh-alert-success {
    background: rgba(42,122,42,0.15);
    border: 1px solid #2a7a2a;
    color: #4caf50;
}
.kh-alert-error {
    background: rgba(168,50,50,0.15);
    border: 1px solid var(--kh-red);
    color: #ff6b6b;
}

/* ── Loading ───────────────────────────── */
.kh-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--kh-muted);
    padding: 20px 0;
    font-size: 15px;
}
.kh-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(212,175,55,0.2);
    border-top-color: var(--kh-gold);
    border-radius: 50%;
    animation: kh-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes kh-spin { to { transform: rotate(360deg); } }

/* ── Step header ───────────────────────── */
.kh-step { margin-bottom: 10px; }
.kh-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.kh-step-num {
    width: 30px;
    height: 30px;
    background: var(--kh-gold);
    color: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.kh-step-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--kh-gold);
}

/* ── Legend ────────────────────────────── */
.kh-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--kh-muted);
}
.kh-legend-item { display: flex; align-items: center; gap: 5px; }
.kh-dot {
    width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}
.kh-dot-avail    { background: var(--kh-card2); border: 1px solid var(--kh-gold); }
.kh-dot-booked   { background: var(--kh-red); }
.kh-dot-selected { background: var(--kh-gold); }

/* ── Search ────────────────────────────── */
.kh-search-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.kh-search-wrap .kh-input { flex: 1; min-width: 0; }
.kh-search-wrap .kh-btn-outline { flex-shrink: 0; }

/* ── Ticket grid ───────────────────────── */
.kh-ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    background: #0d0d0d;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    scrollbar-width: thin;
    scrollbar-color: var(--kh-gold) #1a1a1a;
    -webkit-overflow-scrolling: touch;
}
.kh-ticket-grid::-webkit-scrollbar { width: 5px; }
.kh-ticket-grid::-webkit-scrollbar-track { background: #1a1a1a; }
.kh-ticket-grid::-webkit-scrollbar-thumb { background: var(--kh-gold); border-radius: 3px; }

.kh-ticket-label {
    cursor: pointer;
    position: relative;
    display: block;
    -webkit-tap-highlight-color: transparent;
}
.kh-ticket-label input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.kh-ticket-box {
    padding: 8px 2px;
    text-align: center;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    transition: var(--kh-transition);
    user-select: none;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kh-ticket-box.available {
    background: var(--kh-card2);
    border: 1px solid var(--kh-gold);
    color: white;
}
.kh-ticket-box.available:hover,
.kh-ticket-box.available:active {
    background: rgba(212,175,55,0.15);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(212,175,55,0.3);
}
.kh-ticket-box.booked {
    background: var(--kh-red);
    border: 1px solid var(--kh-red);
    color: #ccc;
    text-decoration: line-through;
    cursor: not-allowed;
    opacity: 0.7;
}
.kh-ticket-box.selected {
    background: var(--kh-gold) !important;
    color: #111 !important;
    box-shadow: 0 0 12px rgba(212,175,55,0.6);
    transform: scale(1.08);
}
.kh-ticket-box.highlight {
    box-shadow: 0 0 0 3px var(--kh-gold-light), 0 0 12px rgba(212,175,55,0.5);
    animation: kh-pulse 1s ease 2;
}
@keyframes kh-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* ── Selected message ──────────────────── */
.kh-selected-msg {
    margin-top: 12px;
    font-weight: 700;
    font-size: 15px;
    color: var(--kh-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.kh-ticket-id-badge {
    font-size: 20px;
    background: var(--kh-card2);
    border: 1px solid var(--kh-gold);
    padding: 2px 12px;
    border-radius: 6px;
}

/* ── Divider ───────────────────────────── */
.kh-divider {
    border: 0;
    border-top: 1px solid var(--kh-border);
    margin: 22px 0;
}

/* ── Form fields ───────────────────────── */
.kh-field { margin-bottom: 16px; }
.kh-label {
    display: block;
    color: var(--kh-gold);
    font-weight: 700;
    margin-bottom: 7px;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.kh-input {
    width: 100%;
    padding: 13px 14px;
    background: var(--kh-card2);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    font-size: 16px; /* 16px prevents iOS zoom on focus */
    transition: var(--kh-transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.kh-input:focus {
    border-color: var(--kh-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.kh-input::placeholder { color: #555; }

/* ── Security notice ───────────────────── */
.kh-security-notice {
    background: rgba(168,50,50,0.12);
    border: 1px solid var(--kh-red);
    color: #ffb3b3;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ── Payment cards ─────────────────────── */
.kh-payment-methods { display: flex; flex-direction: column; gap: 10px; }
.kh-payment-card {
    display: block;
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: var(--kh-transition);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.kh-payment-card input[type=radio] { display: none; }
.kh-payment-card:has(input:checked) {
    border-color: var(--kh-gold);
    box-shadow: 0 0 12px rgba(212,175,55,0.2);
}
.kh-pay-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #0d0d0d;
    padding: 12px 14px;
}
.kh-pay-telebirr .kh-pay-inner { border-left: 4px solid #00adef; }
.kh-pay-cbe      .kh-pay-inner { border-left: 4px solid #800080; }
.kh-pay-awash    .kh-pay-inner { border-left: 4px solid #008000; }
.kh-pay-logo { font-size: 26px; flex-shrink: 0; }
.kh-pay-info { min-width: 0; flex: 1; }
.kh-pay-name { display: block; font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.kh-pay-detail { font-size: 12px; color: var(--kh-muted); word-break: break-all; }
.kh-pay-number { font-size: 15px; font-weight: 700; color: #fff; margin-top: 3px; letter-spacing: 0.5px; word-break: break-all; }

/* ── Upload area ───────────────────────── */
.kh-upload-area {
    background: var(--kh-card2);
    border: 2px dashed var(--kh-gold);
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--kh-transition);
}
.kh-upload-area:hover, .kh-upload-area:active {
    background: rgba(212,175,55,0.04);
    border-color: var(--kh-gold-light);
}
.kh-upload-area p { color: var(--kh-muted); margin: 8px 0 14px; font-size: 13px; }
/* Receipt preview image responsive */
#kh-receipt-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    /* Fix mixed-content/broken image display */
    object-fit: contain;
}

/* ── How it works ──────────────────────── */
.kh-how { border-top: 1px solid var(--kh-border); }
.kh-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 24px;
}
.kh-how-step {
    background: var(--kh-card);
    border: 1px solid var(--kh-border);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
}
.kh-how-icon { font-size: 32px; margin-bottom: 10px; }
.kh-how-step h3 { color: var(--kh-gold); font-size: 14px; margin: 0 0 6px; font-weight: 700; }
.kh-how-step p  { color: var(--kh-muted); font-size: 12px; margin: 0; }

/* ── Footer ────────────────────────────── */
.kh-footer {
    background: #050505;
    border-top: 1px solid var(--kh-border);
    text-align: center;
    padding: 20px 16px;
    color: var(--kh-muted);
    font-size: 13px;
}

/* ════════════════════════════════════════
   LANGUAGE SWITCHER BAR
   ════════════════════════════════════════ */
.kh-lang-bar {
    background: #0d0d0d;
    border-bottom: 1px solid rgba(212,175,55,0.15);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 9999;
}
.kh-lang-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 14px;
}
.kh-lang-label {
    font-size: 14px;
    margin-right: 4px;
    opacity: 0.7;
}
.kh-lang-sep {
    color: rgba(212,175,55,0.3);
    font-size: 13px;
    padding: 0 2px;
}
.kh-lang-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 36px; /* comfortable tap target */
}
.kh-lang-btn:hover, .kh-lang-btn:active {
    color: #D4AF37;
    background: rgba(212,175,55,0.08);
}
.kh-lang-btn.active {
    color: #0a0a0a;
    background: linear-gradient(135deg, #AA7C11, #D4AF37);
    box-shadow: 0 2px 10px rgba(212,175,55,0.3);
}

/* ── Mobile-specific overrides ─────────── */
@media (max-width: 480px) {
    .kh-hero { padding: 36px 12px 28px; }
    .kh-section { padding: 24px 10px; }
    .kh-card { padding: 16px 12px; border-radius: 10px; }
    .kh-stats-bar { flex-wrap: wrap; }
    .kh-stat { flex: 1 1 33%; }
    .kh-ticket-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; padding: 8px; }
    .kh-search-wrap { flex-direction: column; }
    .kh-search-wrap .kh-btn-outline { width: 100%; }
    .kh-pay-inner { flex-direction: row; }
    .kh-steps-grid { grid-template-columns: 1fr 1fr; }
    .kh-how-step { padding: 16px 10px; }
    .kh-btn-main { padding: 13px 24px; font-size: 15px; }
    .kh-divider { margin: 16px 0; }
}
