/* TheLotteryBD - Modern One-Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;600;700&family=Inter:wght@400;600;700&display=swap');

:root {
    --bg: #0f0f14;
    --surface: #1a1a24;
    --surface2: #252532;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --font-bangla: 'Noto Sans Bengali', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background-image: radial-gradient(ellipse at top, #1e1e2e 0%, var(--bg) 60%);
    /* Leave space for mobile browser bars (e.g. Opera Mini update bar) */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bangla { font-family: var(--font-bangla); }

.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
main.container { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0)); }

/* Header */
.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.site-header img { height: 44px; width: auto; }
.site-header h1 { font-size: 1.25rem; font-weight: 700; }
.yt-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ff0000;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
}
.yt-header-btn:hover { background: #cc0000; color: #fff; transform: translateY(-1px); }

/* Poster banner (next to header) */
.poster-banner {
    background: var(--surface);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 1rem 0;
}
.poster-banner .container { max-width: 900px; }
.poster-banner .poster-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    object-fit: contain;
}

/* Prize Banner */
.prize-banner {
    background: linear-gradient(135deg, #f59e0b22 0%, #f59e0b08 100%);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.prize-banner h2 { font-size: 1.1rem; color: var(--accent); margin-bottom: 0.25rem; }
.prize-banner .prize-amount { font-size: 1.5rem; font-weight: 700; color: #fff; }
.prize-banner .draw-date { color: var(--text-muted); font-size: 0.9rem; }
.prize-banner .yt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ff0000;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.prize-banner .yt-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,0,0,0.4); }

/* Trust Stats */
.trust-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.trust-stat {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.trust-stat .number { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.trust-stat .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.recent-tickets {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border: 1px solid rgba(255,255,255,0.06);
}
.recent-tickets h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.recent-tickets .codes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.recent-tickets .code { font-family: monospace; font-size: 0.85rem; color: var(--accent); background: var(--surface2); padding: 0.25rem 0.5rem; border-radius: 6px; }

/* Sections */
.section { margin: 2rem 0; }
.section-title { font-size: 1.25rem; margin-bottom: 1rem; color: var(--text); }
.section-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* Campaign selection (each campaign = one ticket price + one prize) */
.campaign-selector { margin-bottom: 1.5rem; }
.campaign-label { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.95rem; }
/* Fallback for devices that don't support Grid (e.g. Opera Mini): block stack with clear separation */
.campaign-cards {
    display: block;
}
.campaign-card {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    text-align: center;
    padding: 1.25rem 1rem;
    border: 2px solid var(--surface2);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    box-sizing: border-box;
}
.campaign-card:last-child { margin-bottom: 0; }
/* Force each line to stack on weak browsers */
.campaign-card .campaign-ticket-price,
.campaign-card .campaign-prize,
.campaign-card .campaign-date {
    display: block;
}
.campaign-card .campaign-ticket-price { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 0.35rem; }
.campaign-card .campaign-prize { font-size: 0.95rem; color: var(--text); margin-bottom: 0.25rem; }
.campaign-card .campaign-date { font-size: 0.8rem; color: var(--text-muted); }
/* Modern browsers: use grid layout */
@supports (display: grid) {
    .campaign-cards {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    .campaign-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        margin-bottom: 0;
    }
    .campaign-card .campaign-ticket-price,
    .campaign-card .campaign-prize,
    .campaign-card .campaign-date {
        display: block;
    }
}
.campaign-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.campaign-card.active { border-color: var(--accent); background: rgba(245,158,11,0.12); }
.campaign-card .campaign-draw-video-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #ff0000;
    text-decoration: none;
    font-weight: 600;
}
.campaign-card .campaign-draw-video-link:hover { text-decoration: underline; color: #ff3333; }
.campaign-draw-video-wrap { margin-bottom: 0.75rem; }
.campaign-draw-video-wrap .yt-draw-link {
    display: inline-flex;
    align-items: center;
    background: #ff0000;
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.campaign-draw-video-wrap .yt-draw-link:hover { color: #fff; opacity: 0.9; }
.qty-section { margin-top: 1rem; }
.campaign-selected-label { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.9rem; }

/* Lottery Info (before purchase) */
.lottery-info {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.lottery-info p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.lottery-info a { color: var(--accent); }

/* Ticket Selection */
.ticket-selector {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.ticket-types { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.ticket-type-btn {
    padding: 0.6rem 1rem;
    border: 2px solid var(--surface2);
    background: var(--surface2);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s;
}
.ticket-type-btn:hover { border-color: var(--accent); }
.ticket-type-btn.active { border-color: var(--accent); background: rgba(245,158,11,0.15); color: var(--accent); }
.qty-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.qty-control label { color: var(--text-muted); }
.qty-control .controls {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface2);
    border-radius: 8px;
    overflow: hidden;
}
.qty-control button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--surface2);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}
.qty-control button:hover { background: var(--accent); color: var(--bg); }
.qty-control input {
    width: 52px;
    height: 44px;
    border: none;
    background: var(--surface2);
    color: var(--text);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.total-line { margin-top: 1rem; font-size: 1.1rem; font-weight: 600; color: var(--accent); }

/* Purchase Form */
.purchase-form {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.purchase-form label { display: block; margin-bottom: 0.35rem; color: var(--text-muted); font-size: 0.9rem; }
.purchase-form input, .purchase-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--surface2);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}
.purchase-form textarea { min-height: 80px; resize: vertical; }
.purchase-form input:focus, .purchase-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.purchase-form .btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.purchase-form .btn-submit:hover { background: var(--accent-hover); transform: translateY(-1px); }
.purchase-form .btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Success message */
.success-box {
    background: rgba(34,197,94,0.15);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0;
}
.success-box h3 { color: var(--success); margin-bottom: 0.5rem; }
.success-box .ticket-codes { margin-top: 0.75rem; font-family: monospace; word-break: break-all; }
.success-box .sms-note { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Notices */
.notices-section { margin: 2rem 0; }
.notice-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--accent);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 4px solid var(--accent);
}
.notice-card h4 { font-size: 1rem; margin-bottom: 0.35rem; }
.notice-card p { color: var(--text-muted); font-size: 0.9rem; }
.notice-card time { font-size: 0.8rem; color: var(--text-muted); }

/* Floating notice popup – attention */
.notice-popup {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    max-width: 360px;
    transform: translateX(120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s, visibility 0.3s;
}
.notice-popup.notice-popup-visible {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}
.notice-popup-inner {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow), 0 0 24px rgba(245, 158, 11, 0.25);
    position: relative;
    animation: notice-popup-pulse 2.5s ease-in-out infinite;
}
@keyframes notice-popup-pulse {
    0%, 100% { box-shadow: var(--shadow), 0 0 24px rgba(245, 158, 11, 0.25); }
    50% { box-shadow: var(--shadow), 0 0 32px rgba(245, 158, 11, 0.4); }
}
.notice-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.notice-popup-close:hover { background: var(--surface2); color: var(--text); }
.notice-popup-title {
    font-size: 1.05rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}
.notice-popup-body {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.notice-popup-body br { display: block; content: ''; margin-top: 0.25rem; }
.notice-popup-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.notice-popup-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notice-popup-nav button {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--surface2);
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s;
}
.notice-popup-nav button:hover { background: var(--accent); color: var(--bg); }
@media (max-width: 420px) {
    .notice-popup { right: 0.75rem; left: 0.75rem; bottom: 1rem; max-width: none; }
}

/* Contact / Footer */
.footer-contact {
    margin-top: 2.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}
.footer-contact .footer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
}
.footer-contact .yt-btn-footer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ff0000;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}
.footer-contact .yt-btn-footer:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,0,0,0.4); color: #fff; }
.footer-contact .whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25d366;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.footer-contact .whatsapp-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,211,102,0.4); }
.footer-contact p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Messages */
.message { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.message.error { background: rgba(239,68,68,0.15); color: #fca5a5; }
.message.success { background: rgba(34,197,94,0.15); color: #86efac; }

/* Responsive */
@media (max-width: 600px) {
    .site-header .container {
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
    .site-header img {
        height: 72px;
        width: auto;
    }
    .site-header h1 {
        font-size: 1.1rem;
    }
    .prize-banner { flex-direction: column; align-items: flex-start; }
    .ticket-types { flex-direction: column; }
    .ticket-type-btn { width: 100%; }
}
