@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #5665f7;
    --primary-light: #7d88ff;
    --primary-dark: #3d4de6;
    --secondary-color: #22c55e;
    --accent-color: #ff5722;
    --text-dark: #e2e8f0;
    --text-light: #f8fafc;
    --background-dark: #0f172a;
    --background-light: #1e293b;
    --card-bg: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--background-dark);
    color: var(--text-dark);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

h1 {
    font-weight: 600;
    color: var(--text-light);
}

.user-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.points-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    padding: 8px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.points-display i {
    color: var(--accent-color);
}

.share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--background-light);
    border-radius: var(--radius);
    padding: 10px 15px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.referral-section {
    margin-bottom: 40px;
}

.referral-container {
    background: var(--background-light);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.referral-container p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.share-link-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

#referral-url {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 15px;
    border-radius: var(--radius);
    font-size: 1rem;
    width: 70%;
    cursor: pointer;
    color: var(--text-light);
}

#copy-button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

#copy-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
    color: var(--text-light);
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.step {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.step-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 4px 15px rgba(86, 101, 247, 0.3);
}

.step-icon i {
    font-size: 1.6rem;
    color: var(--text-light);
}

.step h3 {
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 1.1rem;
}

.step p {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex-grow: 1;
}

.action-button {
    margin-top: 15px;
    background: var(--secondary-color);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #15803d;
    transform: scale(1.05);
}

.rewards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.reward-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reward-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-light);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
}

.card-front {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.card-image {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-image i {
    font-size: 3rem;
    color: var(--accent-color);
}

.card-front h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.points-required {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: auto;
}

.lock-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-icon i {
    color: var(--text-light);
    font-size: 1rem;
}

.locked {
    filter: brightness(0.7);
}

.locked:hover {
    filter: brightness(0.85);
}

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

#modal-overlay.show .modal {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

#modal-message {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

#modal-button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.redeem-button {
    background: var(--secondary-color);
    color: var(--text-light);
}

.cancel-button {
	display:none;
    background: #475569;
    color: var(--text-light);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .user-stats {
        display: none;
    }
    
    .share-link-box {
        flex-direction: column;
        width: 100%;
        position: relative;
        padding-top: 40px;
    }
    
    .mobile-points-display {
        position: absolute;
        top: -15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.1rem;
        font-weight: 600;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: var(--text-light);
        padding: 6px 18px;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        z-index: 2;
    }
    
    .mobile-points-display i {
        color: var(--accent-color);
    }
    
    #referral-url {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #copy-button {
        width: 100%;
        justify-content: center;
    }
    
    .live-redemption-container {
        width: 250px;
    }
}

.mobile-points-display {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    padding: 6px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 2;
}

.footer {
    margin-top: 30px;
    padding: 30px 0;
    background: var(--background-light);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-light);
}

#toast {
    background-color: var(--accent-color) !important;
}

.free-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 2;
}

.price-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.2);
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: line-through;
    z-index: 2;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.btn-disabled {
    opacity: 0.7;
    cursor: not-allowed;
}