/* 
 * TikTok Coins Landing Page - Main Stylesheet
 * Mobile-first, RTL design for Arabic language
 */

/* ======= Base Styles ======= */
:root {
    --primary-color: #fe2c55;
    --secondary-color: #25f4ee;
    --dark-color: #161823;
    --light-color: #ffffff;
    --gray-color: #f1f1f2;
    --light-gray: #d6d6d6;
    --text-color: #161823;
    --comment-bg: #e6e6e6; /* Darker background for comments */
    --comment-text: #333333; /* Darker text for better contrast */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --glow: 0 0 10px var(--secondary-color), 0 0 20px var(--primary-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%; /* 10px = 1rem */
}

body {
    font-family: 'Cairo', sans-serif;
    font-size: 1.6rem;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    overflow-x: hidden;
    direction: rtl;
    position: relative;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    contain: content;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: 'Cairo', sans-serif;
}

input {
    font-family: 'Cairo', sans-serif;
}

/* ======= Layout & Container ======= */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background-color: var(--light-color);
    box-shadow: var(--shadow);
}

header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo {
    width: 7rem;
    height: auto;
    animation: pulse 2s infinite;
}

h1 {
    font-size: 3.6rem;
    font-weight: 900;
    color: var(--dark-color);
}

h2 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    text-align: center;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 3px rgba(254, 44, 85, 0.3);
}

.subheading {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    font-size: 1.4rem;
    color: #999;
}

.disclaimer {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* ======= Active Users Indicator ======= */
.urgency-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    font-size: 1.3rem;
}

.urgency-container > div {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.urgency-container i {
    color: var(--primary-color);
}

.live-counter {
    display: flex;
    align-items: center;
}

#active-users {
    font-weight: 700;
    color: var(--secondary-color);
}

/* ======= Multi-Step Process ======= */
.steps-container {
    position: relative;
    margin: 3rem 0;
}

.progress-container {
    margin-bottom: 3rem;
}

.progress-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 80%;
    height: 4px;
    background-color: var(--light-gray);
    border-radius: 2px;
    z-index: 1;
}

.progress {
    position: absolute;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.step-indicator {
    position: relative;
    width: 3rem;
    height: 3rem;
    background-color: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    font-weight: 700;
    margin-top: -1.5rem;
    z-index: 2;
    transition: var(--transition);
}

.step-indicator.active {
    background-color: var(--primary-color);
    color: var(--light-color);
    box-shadow: 0 0 0 5px rgba(254, 44, 85, 0.2);
    transform: scale(1.2);
}

.step-indicator.completed {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

.step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    padding: 1rem;
    border-radius: 1.5rem;
    background-color: var(--light-color);
    box-shadow: var(--shadow);
    /* Adding min-height to prevent layout shifts */
    min-height: 300px;
    width: 100%;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease-in-out;
}

/* Features Section */
.features {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    padding: 1rem;
}

.feature i {
    font-size: 2.4rem;
    color: var(--primary-color);
}

.feature span {
    font-weight: 600;
}

/* Coins Image */
.coins-image {
    text-align: center;
    margin: 2rem 0;
    contain: content; /* Help browser optimize rendering */
}

.coins {
    max-width: 70%;
    animation: float 3s ease-in-out infinite;
}

/* CTA Buttons */
.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(45deg, var(--primary-color), #ff5676);
    color: var(--light-color);
    padding: 1.5rem;
    border-radius: 5rem;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 2rem 0;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.25);
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 25px rgba(254, 44, 85, 0.35);
}

.cta-button:active {
    transform: translateY(-1px);
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
}

.cta-button:hover::after {
    animation: btn-shine 1.5s;
}

/* ======= Step 2: Username Input ======= */
.input-container {
    position: relative;
    margin: 2rem 0;
}

.input-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 2rem;
}

#username-input {
    width: 100%;
    padding: 1.5rem 4.5rem 1.5rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 5rem;
    font-size: 1.8rem;
    transition: var(--transition);
}

#username-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.2);
    outline: none;
}

.verification-animation {
    display: none;
    text-align: center;
    margin: 2rem 0;
}

.spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid rgba(254, 44, 85, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

/* ======= Step 3: Choose Coin Amount ======= */
.coins-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Always make sure there are 2 options per row on all screen sizes */
@media (max-width: 767px) {
    .coins-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.coin-option {
    position: relative;
    background-color: var(--gray-color);
    border-radius: 1.5rem;
    padding: 2rem 1rem;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

.coin-option:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.coin-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(254, 44, 85, 0.05);
    box-shadow: 0 0 15px rgba(254, 44, 85, 0.2);
}

.coin-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.coin-image {
    margin: 1rem 0;
    height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: content; /* Help browser optimize rendering */
}

.coin-image img {
    max-height: 100%;
    animation: bounce 2s ease infinite;
}

.coin-label {
    font-weight: 600;
    color: var(--dark-color);
}

.coin-popular {
    position: absolute;
    top: -1rem;
    right: 0;
    left: 0;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 5rem;
    width: fit-content;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(37, 244, 238, 0.3);
}

/* ======= Step 4: Final Confirmation ======= */
.final-summary {
    background-color: var(--gray-color);
    border-radius: 1.5rem;
    padding: 2rem;
    margin: 2rem 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.summary-item:last-child {
    margin-bottom: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.summary-label {
    font-weight: 600;
    color: #777;
}

.summary-value {
    font-weight: 700;
    color: var(--dark-color);
}

#summary-coins {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 800;
}

.processing-animation {
    display: none;
    text-align: center;
    margin: 2rem 0;
}

.processing-status {
    margin-top: 2rem;
    text-align: right;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-item i {
    color: #4CAF50;
}

.status-item.pending i {
    color: var(--primary-color);
}

.verification-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(254, 44, 85, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.verification-message i {
    font-size: 2.4rem;
    color: var(--primary-color);
}

/* Remove notification styling */

/* ======= Comments (Testimonials) ======= */
.testimonials {
    margin: 3rem 0;
    padding: 0 1rem;
    /* Setting fixed container size to prevent layout shifts */
    min-height: 400px; /* Minimum height to prevent content shifts */
    width: 100%;
    position: relative;
}

.testimonials h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var (--dark-color);
    text-align: center;
}

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    background-color: var(--comment-bg); /* Using darker background for better contrast */
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    /* Setting a consistent height helps reduce layout shifts */
    min-height: 120px;
    contain: content;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    /* Prevent layout shift while loading */
    background-color: var(--light-gray);
    contain: strict;
}

.comment-info {
    flex: 1;
}

.comment-name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.6rem;
}

.comment-time {
    font-size: 1.2rem;
    color: #555; /* Darker color for better contrast */
    margin-top: 0.2rem;
}

.comment-content {
    line-height: 1.6;
    color: var(--comment-text); /* Using darker text color for better contrast */
    margin-bottom: 1.5rem;
}

/* Comment content bottom margin */
.comment-content {
    margin-bottom: 0;
    padding-bottom: 1rem;
}

/* ======= Animations ======= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes btn-shine {
    0% {
        transform: translateX(-100%);
    }
    20%, 100% {
        transform: translateX(100%);
    }
}

/* ======= Responsive Design ======= */
@media (min-width: 768px) {
    .feature i {
        font-size: 3rem;
    }
    
    .urgency-container {
        font-size: 1.4rem;
    }
    
    #notifications-container {
        width: 35rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 55%;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    .features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .feature {
        flex-direction: row;
        justify-content: center;
    }
    
    .comment {
        padding: 1.2rem;
    }
}
