/* =====================================================================
   ESAForum - Daily Login Streak page  v4
   Created by ESAGAMES HOSTING SHIELD SRL
   Mobile-first responsive pass
   ===================================================================== */

/* ---- Page header ---- */
.streak-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
}
.streak-header h1 { margin: 0; font-size: 26px; }
.streak-header .sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; line-height: 1.5; }

/* ---- Stats row ---- */
.streak-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.streak-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 22px;
    text-align: center;
    flex: 1 1 140px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    transition: border-color .18s, transform .18s;
}
/* Top accent line */
.streak-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--grad-primary);
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: .6;
}
.streak-stat:hover {
    border-color: rgba(var(--primary-rgb), .3);
    transform: translateY(-1px);
}
.streak-stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-2);
}
.streak-stat-value.gold { color: var(--amber); }
.streak-stat-label {
    font-size: 12px;
    color: var(--text-mute);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

/* ---- 7-day reward track ---- */
.streak-track {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 36px;
}

.streak-tile {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 8px 14px;
    text-align: center;
    position: relative;
    transition: transform .18s, border-color .18s, box-shadow .18s;
    cursor: default;
    /* Prevent grid-item overflow (canonical min-width:auto fix) */
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Claimed tiles */
.streak-tile.is-claimed {
    border-color: var(--green);
    background: linear-gradient(160deg, rgba(46,230,166,.10), rgba(46,230,166,.04));
}
.streak-tile.is-claimed .tile-icon { filter: none; opacity: 1; }

/* Today/claimable tile */
.streak-tile.is-today {
    border-color: var(--primary);
    background: linear-gradient(160deg, rgba(var(--primary-rgb),.14), rgba(var(--accent-rgb),.06));
    box-shadow: var(--shadow-glow);
    cursor: pointer;
}
.streak-tile.is-today:hover { transform: translateY(-4px); }

/* Locked future tiles */
.streak-tile.is-locked {
    opacity: .52;
}

/* Day-7 jackpot special treatment */
.streak-tile.is-jackpot {
    border-color: var(--amber) !important;
}
.streak-tile.is-jackpot.is-claimed {
    background: linear-gradient(160deg, rgba(245,179,1,.14), rgba(245,179,1,.04));
}
.streak-tile.is-jackpot.is-today {
    background: linear-gradient(160deg, rgba(245,179,1,.18), rgba(245,179,1,.06));
    box-shadow: 0 0 0 1px rgba(245,179,1,.4), 0 8px 28px rgba(245,179,1,.18);
    animation: pulse-gold 2s ease-in-out infinite;
}
@keyframes pulse-gold {
    0%,100% { box-shadow: 0 0 0 1px rgba(245,179,1,.4), 0 8px 28px rgba(245,179,1,.18); }
    50%      { box-shadow: 0 0 0 2px rgba(245,179,1,.6), 0 12px 36px rgba(245,179,1,.30); }
}

.tile-day {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-mute);
    margin-bottom: 6px;
    width: 100%;
}
.streak-tile.is-claimed .tile-day { color: var(--green); }
.streak-tile.is-today   .tile-day { color: var(--primary-2); }
.streak-tile.is-jackpot.is-today .tile-day,
.streak-tile.is-jackpot.is-claimed .tile-day { color: var(--amber); }

.tile-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
    transition: transform .2s ease;
}
.streak-tile.is-today:hover .tile-icon { transform: scale(1.12); }

.tile-reward {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.streak-tile.is-claimed .tile-reward { color: var(--green); }
.streak-tile.is-today   .tile-reward { color: var(--primary-2); }
.streak-tile.is-jackpot .tile-reward { color: var(--amber) !important; font-size: 15px; }

/* Checkmark badge for claimed */
.tile-check {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 13px;
    line-height: 1;
    display: none;
}
.streak-tile.is-claimed .tile-check { display: block; }

/* ---- Claim button inside tile ---- */
.tile-claim-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 12px;
    background: var(--grad-primary);
    color: var(--on-accent, #fff);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    width: 100%;
}
.tile-claim-btn:hover  { opacity: .88; transform: scale(1.03); }
.tile-claim-btn:active { transform: scale(.97); }
.tile-claim-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.streak-tile.is-jackpot .tile-claim-btn {
    background: linear-gradient(135deg, var(--amber) 0%, #e67e00 100%);
    color: #000;
}

/* ---- Claim result toast ---- */
.streak-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface-2);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 9999;
    /* Prevent overflow on small screens */
    max-width: calc(100vw - 32px);
    text-align: center;
    word-break: break-word;
}
.streak-toast.streak-toast-gold {
    border-color: var(--amber);
    color: var(--amber);
}
.streak-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- History table ---- */
.streak-history {
    margin-top: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.streak-history h2 {
    font-size: 16px;
    margin: 0;
    padding: 14px 18px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.history-table th {
    text-align: left;
    padding: 10px 18px;
    color: var(--text-mute);
    background: rgba(255,255,255,.02);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
}
.history-table td {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(255,255,255,.02); }
.hist-day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb),.18);
    color: var(--primary-2);
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(var(--primary-rgb),.2);
}
.hist-day-badge.gold {
    background: rgba(245,179,1,.18);
    color: var(--amber);
    border-color: rgba(245,179,1,.25);
}
.hist-pts {
    color: var(--green);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---- Already-claimed state ---- */
.streak-claimed-msg {
    margin-top: 10px;
    color: var(--text-mute);
    font-size: 12px;
    font-weight: 600;
}

/* ---- Guest callout ---- */
.streak-guest-callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    margin-bottom: 28px;
}
.streak-guest-callout h2 { margin: 0 0 8px; }
.streak-guest-callout p { color: var(--text-dim); margin-bottom: 16px; }

/* =====================================================================
   DESKTOP ENHANCEMENTS (≥1024px)
   ===================================================================== */

@media (min-width: 1024px) {
    /* Header: always side-by-side on desktop */
    .streak-header {
        flex-wrap: nowrap;
        align-items: center;
        margin-bottom: 36px;
    }
    .streak-header h1 { font-size: 30px; }
    .streak-header .sub { font-size: 15px; }

    /* Stats row: equal-width, taller cards */
    .streak-stats {
        gap: 20px;
        margin-bottom: 36px;
    }
    .streak-stat { padding: 20px 28px; }
    .streak-stat-value { font-size: 32px; }
    .streak-stat-label { font-size: 13px; }

    /* 7-tile track: all 7 in one row, auto height */
    .streak-track {
        grid-template-columns: repeat(7, 1fr);
        gap: 14px;
        margin-bottom: 44px;
    }
    .streak-tile {
        padding: 22px 10px 18px;
        border-radius: var(--radius-lg);
    }
    .tile-day { font-size: 11px; margin-bottom: 8px; }
    .tile-icon { font-size: 30px; margin-bottom: 10px; }
    .tile-reward { font-size: 14px; }
    .tile-claim-btn { font-size: 13px; padding: 9px 14px; }
    .tile-check { font-size: 15px; top: 8px; right: 10px; }

    /* History: better spacing */
    .streak-history h2 { font-size: 18px; padding: 18px 22px; }
    .history-table { font-size: 14px; }
    .history-table th { font-size: 12px; padding: 12px 22px; }
    .history-table td { padding: 12px 22px; }

    /* Guest callout: wider padding */
    .streak-guest-callout { padding: 48px 40px; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 900px) {
    .streak-track {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    /* Day-7 jackpot spans full row so it stands out */
    .streak-tile:last-child {
        grid-column: 1 / -1;
    }
    /* Jackpot tile in full-row layout: horizontal style */
    .streak-tile:last-child.is-jackpot {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 14px 20px;
        text-align: left;
    }
    .streak-tile:last-child.is-jackpot .tile-day { margin-bottom: 0; }
    .streak-tile:last-child.is-jackpot .tile-icon { margin-bottom: 0; font-size: 28px; }
}

@media (max-width: 640px) {
    /* Header: stack on small screens */
    .streak-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .streak-header h1 { font-size: 20px; }
    .streak-stat { flex: 1 1 110px; padding: 12px 14px; }
    .streak-stat-value { font-size: 22px; }
}

@media (max-width: 600px) {
    .streak-track {
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
    }
    .streak-tile:last-child { grid-column: 1 / -1; }
    .streak-tile:last-child.is-jackpot { flex-direction: row; }
    .streak-tile { padding: 12px 6px 10px; }
    .tile-icon { font-size: 20px; }
    .tile-day { font-size: 9px; }
    .tile-reward { font-size: 12px; }
    .tile-claim-btn { font-size: 11px; padding: 6px 8px; min-height: 32px; }
}

/* 480px — History table scrollable + stat sizing */
@media (max-width: 480px) {
    .streak-history { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .history-table { min-width: 280px; }
    /* Header on phones */
    .streak-header h1 { font-size: 18px; }
    .streak-header .sub { font-size: 13px; }
}

/* 414px — common iPhone/Android large */
@media (max-width: 414px) {
    .streak-stats { gap: 10px; }
    .streak-stat { flex: 1 1 100px; padding: 10px 12px; }
    .streak-stat-value { font-size: 20px; }
    .streak-stat-label { font-size: 11px; }
}

@media (max-width: 400px) {
    .streak-track {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .streak-tile:last-child { grid-column: 1 / -1; }
    .streak-tile { padding: 10px 5px 8px; }
    .tile-icon { font-size: 18px; }
    /* claim button: larger touch target */
    .tile-claim-btn { font-size: 11px; padding: 7px 6px; min-height: 36px; width: 100%; }
    .streak-stats { gap: 8px; }
    .streak-stat { flex: 1 1 90px; padding: 10px 10px; }
    .streak-stat-value { font-size: 18px; }
    .streak-toast { font-size: 14px; padding: 10px 16px; bottom: 16px; }
}

/* 390px */
@media (max-width: 390px) {
    .streak-header h1 { font-size: 17px; }
    .streak-tile { padding: 8px 4px 7px; }
    .tile-icon { font-size: 16px; }
    .tile-day { font-size: 8px; letter-spacing: .04em; }
    .tile-reward { font-size: 11px; }
    .tile-check { font-size: 11px; }
    /* Guest callout: tighter padding */
    .streak-guest-callout { padding: 20px 14px; }
}

/* 360px */
@media (max-width: 360px) {
    .streak-track { gap: 5px; }
    .streak-tile { padding: 7px 3px 6px; }
    .tile-icon { font-size: 14px; }
    .streak-stats { gap: 6px; }
    .streak-stat { padding: 8px 8px; }
    .streak-stat-value { font-size: 16px; }
    .history-table th,
    .history-table td { padding: 8px 12px; }
    .streak-toast { font-size: 13px; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .streak-tile.is-jackpot.is-today { animation: none; }
    .streak-toast { transition: opacity .15s; }
}
