/* ====== MODAL STYLES ====== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Welcome Bonus Modal */
.welcome-bonus-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.bonus-mascot {
    font-size: 80px;
    margin-bottom: 16px;
    animation: mascotBounce 1s ease-in-out infinite;
}

.bonus-amount {
    font-size: 40px;
    font-weight: 900;
    color: var(--coin-gold);
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bonus-amount i {
    animation: coinSpin 2s linear infinite;
}

.bonus-tip {
    background: var(--pastel-yellow-light);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    margin: 20px 0;
}

/* Daily Reward Modal */
.daily-reward-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.reward-header {
    text-align: center;
    margin-bottom: 24px;
}

.streak-fire {
    font-size: 60px;
    animation: mascotBounce 1.5s ease-in-out infinite;
}

.reward-items {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 14px;
}

.reward-item i {
    font-size: 32px;
}

.streak-days {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin: 20px 0;
}

.streak-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.day-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: var(--text-light);
    transition: var(--transition-normal);
}

.streak-day.active .day-circle {
    background: var(--bg-gradient);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.streak-day span {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Buy Coins Modal */
.buy-coins-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.coin-packages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.coin-package {
    padding: 20px 16px;
    background: linear-gradient(135deg, #FFF7E6, #FFE4B5);
    border: 2px solid #FFD700;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.coin-package:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.coin-package.popular {
    background: linear-gradient(135deg, #FF6B9D, #A855F7);
    color: white;
    border-color: white;
    transform: scale(1.05);
}

.popular-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--primary);
    padding: 2px 12px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.package-coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 8px;
}

.package-bonus {
    font-size: 11px;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 700;
}

.package-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.coin-package.popular .package-price {
    color: white;
}

.package-label {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Free Coins Section */
.free-coins-section {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.free-coins-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.free-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.free-option {
    padding: 12px 8px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: inherit;
}

.free-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.free-option i {
    font-size: 24px;
    color: var(--primary);
}

.free-option span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.free-option small {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Global Loader */
.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 245, 247, 0.9);
    backdrop-filter: blur(8px);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loader.hidden {
    display: none;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--pastel-pink-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loader-content p {
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .coin-packages {
        grid-template-columns: repeat(2, 1fr);
    }
    .free-options {
        grid-template-columns: repeat(3, 1fr);
    }
}