*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    /* Green */
    --hover-color: #45a049;
    /* Darker Green */
    --secondary-color: #333;
    --bg-color: #ffffff;
    /* Pure White */
    --accent-color: #4CAF50;
    --input-border: #ccc;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main Container */
.container {
    background: var(--bg-color);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* Slightly softer shadow */
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

/* Header Section */
header {
    position: relative;
    margin-bottom: 2rem;
}

/* Hero Image */
.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 2rem;
    /* Spacing top */
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    /* Subtle image shadow */
}

/* Header Text */
header h1 {
    font-size: 2.2rem;
    /* Adjusted for better proportion */
    font-weight: 900;
    color: #000;
    /* Black */
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 5;
}

/* Input Section */
.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

button {
    flex: 0 0 auto;
    width: auto;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
}

button:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.how-to-button {
    margin-top: 1.5rem;
}

.how-to-button button {
    width: 100%;
    background-color: var(--secondary-color);
    box-shadow: 0 4px 6px rgba(51, 51, 51, 0.3);
}

.how-to-button button:hover {
    background-color: #444;
    box-shadow: 0 6px 12px rgba(51, 51, 51, 0.4);
}

.confirmed-id {
    font-size: 1.6rem;
    font-weight: 900;
    color: #000;
    width: 100%;
    text-align: center;
    padding: 15px;
    background: transparent;
    border: none;
    animation: fadeIn 0.5s ease;
}

/* Horizontal Slider */
.slider-wrapper {
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
    white-space: nowrap;
    background: #fff;
    /* Mask fade effect on edges for professional look */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.slider-track {
    display: inline-block;
    animation: scrollRightToLeft 25s linear infinite;
    /* Smooth slow scroll */
    padding: 10px 0;
    /* Vertical padding */
}

.slider-track img {
    height: auto;
    width: 28%;
    /* Approx 1/3 minus margins */
    max-width: 90px;
    margin: 0 2%;
    border-radius: 8px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.slider-track img:hover {
    transform: scale(1.1);
}

@keyframes scrollRightToLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Offers Section */
.user-info {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    /* Green */
    margin-bottom: 1rem;
    display: none;
    /* Hidden by default */
}

.instruction p {
    font-size: 1.2rem;
    font-weight: 900;
    /* Extra Bold */
    margin-bottom: 1.5rem;
    color: #000;
    /* Black */
    line-height: 1.6;
}

#offerContainer div {
    margin-bottom: 12px;
}

#offerContainer .offer-link {
    display: block;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#offerContainer .offer-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(76, 175, 80, 0.3);
}

.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.offer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.offer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.offer-image {
    width: 55px;
    height: 55px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.offer-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.coin-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    margin-top: 2px;
    backdrop-filter: blur(4px);
}

.coin-badge img {
    width: 18px;
    height: 18px;
    margin-left: 5px;
    vertical-align: middle;
}

.offer-desc {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    display: block;
    text-align: right;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Loading */
#loading {
    margin-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Gold Button */
.gold-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-size: 1.3rem;
    padding: 18px 40px;
    margin-top: 20px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    border: 2px solid #FFD700;
}

.gold-btn:hover {
    background: linear-gradient(135deg, #FFA500, #FFD700);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

/* Info Section */
.info-section {
    margin-top: 30px;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: right;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.info-card h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.info-card p {
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--hover-color);
}

.disclaimer {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    text-align: center;
}

/* ID Form */
.id-form {
    max-width: 400px;
    margin: 0 auto;
}

.id-form h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Progress Bar */
.progress-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--hover-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

#progress-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Back Button */
.back-btn {
    background: #6c757d;
    margin-top: 20px;
    padding: 12px 30px;
}

.back-btn:hover {
    background: #5a6268;
}

/* Offers Page */
.offers-message {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.offers-message h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.offers-message p {
    color: #333;
    line-height: 1.8;
}

.offers-list {
    margin-bottom: 20px;
}

.no-offers {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Legal Pages */
.legal-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: right;
}

.legal-page h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.legal-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.legal-content h3 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-content p {
    color: #333;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1.8rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .hero-image {
        max-width: 100%;
        margin-top: 1.5rem;
    }

    .gold-btn {
        font-size: 1.1rem;
        padding: 15px 30px;
    }

    .info-card {
        padding: 15px;
    }

    .info-card h2 {
        font-size: 1.1rem;
    }

    .info-card p {
        font-size: 0.95rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links a {
        font-size: 0.9rem;
    }

    .offers-message {
        padding: 15px;
    }

    .offers-message h2 {
        font-size: 1.2rem;
    }

    .offers-message p {
        font-size: 0.95rem;
    }

    .legal-page {
        max-width: 100%;
    }

    .legal-content {
        padding: 15px;
    }

    .legal-content h3 {
        font-size: 1rem;
    }

    .legal-content p {
        font-size: 0.9rem;
    }

    .progress-bar {
        height: 25px;
    }

    #progress-text {
        font-size: 1.3rem;
    }

    .slider-track img {
        width: 35%;
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1.2rem;
        border-radius: 15px;
        box-sizing: border-box;
    }

    header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }

    .gold-btn {
        font-size: 1rem;
        padding: 14px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .info-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .info-card h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .info-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .input-wrapper input[type="text"] {
        width: 100%;
        font-size: 1rem;
        padding: 14px;
        box-sizing: border-box;
    }

    button {
        font-size: 1rem;
        padding: 14px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .back-btn {
        width: 100%;
        padding: 12px 20px;
        box-sizing: border-box;
    }

    .offers-message h2 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .offers-message p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .legal-page h2 {
        font-size: 1.2rem;
    }

    .legal-content h3 {
        font-size: 0.95rem;
    }

    .legal-content p {
        font-size: 0.85rem;
    }

    /* Responsive Offers */
    #offerContainer .offer-link {
        padding: 12px;
        border-radius: 10px;
    }

    .offer-header {
        gap: 8px;
    }

    .offer-image {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }

    .offer-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .coin-badge {
        font-size: 0.8rem;
        padding: 3px 8px;
        margin-top: 4px;
    }

    .coin-badge img {
        width: 16px;
        height: 16px;
    }

    .offer-desc {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-top: 6px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .offer-image {
        width: 45px;
        height: 45px;
    }

    .offer-title {
        font-size: 0.9rem;
    }

    .coin-badge {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .coin-badge img {
        width: 14px;
        height: 14px;
    }

    .offer-desc {
        font-size: 0.75rem;
        margin-top: 4px;
    }

    .slider-track img {
        width: 40%;
        max-width: 70px;
    }
}

/* --- Smart System Additions --- */
.smart-progress {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.15);
    border: 2px solid var(--primary-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.smart-progress h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 900;
}

.smart-bar-container {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 12.5px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.smart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.smart-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.smart-progress-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.offer-link.pending-verification {
    background: linear-gradient(135deg, #9E9E9E, #757575) !important;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

.offer-link.pending-verification .offer-title::before {
    content: "⏳ جارٍ التحقق... ";
    color: #FFEB3B;
}

.locked-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.locked-screen h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}