﻿/**
 * CSS del modal de recompensas diarias (check-in).
 * Calendario grid premium con glow, animaciones y soporte dark/light.
 */

/* -- Overlay -------------------------------------------------- */

.daily-rewards-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.daily-rewards-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* -- Modal ---------------------------------------------------- */

.daily-rewards-modal {
    background: var(--surface, #14161c);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    padding: 28px 24px;
    position: relative;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(39, 243, 225, 0.06);
}

.daily-rewards-overlay.visible .daily-rewards-modal {
    transform: translateY(0) scale(1);
}

.daily-rewards-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.daily-rewards-close:hover {
    color: var(--foreground);
}

/* -- Header --------------------------------------------------- */

.daily-rewards-header {
    text-align: center;
    margin-bottom: 20px;
}

.daily-rewards-coin-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(39, 243, 225, 0.3);
    animation: dr-glow 2s ease-in-out infinite alternate;
}

@keyframes dr-glow {
    from {
        box-shadow: 0 0 20px rgba(39, 243, 225, 0.2);
    }

    to {
        box-shadow: 0 0 30px rgba(39, 243, 225, 0.5);
    }
}

.daily-rewards-coin-fallback {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-default, #27f3e1), var(--accent-purple, #a855f7));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    animation: dr-glow 2s ease-in-out infinite alternate;
}

.daily-rewards-coin-fallback svg {
    width: 28px;
    height: 28px;
    color: #0a0b0f;
}

.daily-rewards-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.daily-rewards-header p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* -- Grid de dias --------------------------------------------- */

.daily-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.daily-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--surface, #1a1d24);
    transition: all 0.25s;
    position: relative;
}

.daily-day-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.daily-day-coins {
    font-size: 16px;
    font-weight: 700;
    color: var(--foreground);
}

.daily-day-coins small {
    font-size: 10px;
    font-weight: 400;
    color: var(--muted);
}

/* Claimed state */
.daily-day.claimed {
    background: rgba(39, 243, 225, 0.08);
    border-color: rgba(39, 243, 225, 0.25);
}

.daily-day.claimed .daily-day-coins {
    color: var(--primary-default);
}

.daily-day.claimed::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: var(--primary-default);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%230a0b0f' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Current (claimable) */
.daily-day.current {
    border-color: var(--primary-default);
    box-shadow: 0 0 16px rgba(39, 243, 225, 0.2);
    animation: dr-pulse 1.5s ease-in-out infinite;
}

@keyframes dr-pulse {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(39, 243, 225, 0.15);
    }

    50% {
        box-shadow: 0 0 24px rgba(39, 243, 225, 0.35);
    }
}

/* Locked */
.daily-day.locked {
    opacity: 0.4;
}

/* -- Boton reclamar ------------------------------------------- */

.daily-rewards-claim-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-default, #27f3e1), var(--accent-purple, #a855f7));
    color: #0a0b0f;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.daily-rewards-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 243, 225, 0.3);
}

.daily-rewards-claim-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* -- Animacion de coins ganados ------------------------------- */

.daily-rewards-earned {
    text-align: center;
    padding: 16px;
    animation: dr-pop 0.4s ease-out;
}

.daily-rewards-earned .earned-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-default);
}

.daily-rewards-earned .earned-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

@keyframes dr-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* -- Light theme ---------------------------------------------- */

[data-theme="light"] .daily-rewards-modal {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .daily-day {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .daily-day.claimed {
    background: rgba(39, 243, 225, 0.06);
}

/* -- Responsive ----------------------------------------------- */

@media (max-width: 400px) {
    .daily-rewards-modal {
        padding: 20px 16px;
    }

    .daily-rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }

    .daily-day-coins {
        font-size: 14px;
    }
}
