/* =========================================================
   LIFFY — TASKS & EARNINGS
   Private page for users and admin
========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7ff;
    color: #222;
}

/* =========================================================
   PAGE
========================================================= */

.tasks-page {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.tasks-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* =========================================================
   TOP BAR
========================================================= */

.tasks-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 20px;
}

.tasks-back-btn {
    border: none;
    background: #ffffff;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    cursor: pointer;

    box-shadow: 0 5px 20px rgba(0,0,0,.08);

    transition: .2s;
}

.tasks-back-btn:hover {
    transform: scale(1.05);
}

.tasks-page-title {
    flex: 1;
}

.tasks-page-title h1 {
    margin: 0;

    font-size: 25px;
    font-weight: 800;

    background: linear-gradient(
        90deg,
        #6d3cff,
        #ff2d75
    );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tasks-page-title p {
    margin: 4px 0 0;

    font-size: 13px;
    color: #777;
}

/* =========================================================
   USER CARD
========================================================= */

.tasks-user-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    display: flex;
    align-items: center;

    gap: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.08);
}

.task-info-banner {
    position: fixed;

    left: 16px;
    right: 16px;
    bottom: 16px;

    max-width: 480px;

    margin: 0 auto;

    z-index: 500;

    background:
        linear-gradient(
            135deg,
            #ff9a3c,
            #ff5e7e
        );

    border-radius: 20px;

    padding: 22px 20px 20px;

    box-shadow: 0 12px 34px rgba(0,0,0,.35);

    animation: taskBannerPop .3s ease;

    max-height: 70vh;

    overflow-y: auto;
}

@media (max-width: 520px) {

    .task-info-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

}

@keyframes taskBannerPop {
    from {
        transform: scale(.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.task-info-banner-title {
    margin: 0;

    font-size: 16px;

    font-weight: 800;

    color: #ffffff;
}

.task-info-close-button {
    position: absolute;

    top: 12px;
    right: 12px;

    width: 30px;
    height: 30px;

    border: none;

    border-radius: 50%;

    background: rgba(255,255,255,.25);

    color: #ffffff;

    font-size: 20px;

    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.task-info-close-button:active {
    transform: scale(.9);
}

.task-info-list {
    margin: 14px 0 0;

    padding-left: 20px;

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.task-info-list li {
    font-size: 13px;

    line-height: 1.6;

    color: #ffffff;
}

.tasks-guide-link {
    flex-shrink: 0;

    background: #ffffff;

    color: #6c5ce7;

    font-size: 12px;

    font-weight: 800;

    padding: 8px 12px;

    border-radius: 50px;

    text-decoration: none;

    box-shadow: 0 5px 20px rgba(0,0,0,.08);

    white-space: nowrap;
}

.tasks-user-avatar {
    width: 58px;
    height: 58px;

    border-radius: 50%;

    object-fit: cover;

    border: 3px solid #ffffff;

    box-shadow: 0 4px 15px rgba(0,0,0,.12);
}

.tasks-user-info {
    flex: 1;
}

.tasks-user-name {
    margin: 0;

    font-size: 18px;
    font-weight: 800;
}

.tasks-user-email {
    margin: 4px 0 0;

    font-size: 13px;
    color: #777;

    word-break: break-word;
}

/* =========================================================
   EARNINGS SUMMARY
========================================================= */

.earnings-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 15px;
}

.earning-card {
    background: #ffffff;

    border-radius: 20px;

    padding: 18px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);

    min-width: 0;
}

.earning-card-label {
    font-size: 12px;

    color: #777;

    margin-bottom: 8px;
}

.earning-card-value {
    font-size: 22px;

    font-weight: 800;

    color: #222;

    word-break: break-word;
}

.earning-card.highlight {
    background:
        linear-gradient(
            135deg,
            #6d3cff,
            #ff2d75
        );

    color: #ffffff;
}

.earning-card.highlight
.earning-card-label {
    color: rgba(255,255,255,.8);
}

.earning-card.highlight
.earning-card-value {
    color: #ffffff;
}

/* =========================================================
   TASK PROGRESS
========================================================= */

.task-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.section-title {
    margin: 0 0 6px;

    font-size: 19px;

    font-weight: 800;
}

.section-subtitle {
    margin: 0 0 18px;

    font-size: 13px;

    color: #777;

    line-height: 1.5;
}

.progress-info {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;

    margin-bottom: 8px;
}

.progress-count {
    font-size: 14px;

    font-weight: 700;
}

.progress-money {
    font-size: 14px;

    font-weight: 800;

    color: #6d3cff;
}

.progress-bar {
    width: 100%;

    height: 12px;

    background: #ececf5;

    border-radius: 50px;

    overflow: hidden;
}

.progress-fill {
    width: 0%;

    height: 100%;

    border-radius: 50px;

    background:
        linear-gradient(
            90deg,
            #6d3cff,
            #ff2d75
        );

    transition:
        width .4s ease;
}

/* =========================================================
   SMART LINKS
========================================================= */

.smart-links-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.smart-links-list {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.smart-link-item {
    width: 100%;

    padding: 15px;

    border-radius: 16px;

    background: #f7f7fc;

    border: 1px solid #ededf5;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;
}

.smart-link-info {
    min-width: 0;

    flex: 1;
}

.smart-link-title {
    margin: 0 0 4px;

    font-size: 15px;

    font-weight: 800;

    word-break: break-word;
}

.smart-link-url {
    margin: 0;

    font-size: 12px;

    color: #777;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.smart-link-clicks {
    flex-shrink: 0;

    font-size: 12px;

    font-weight: 800;

    color: #6d3cff;
}

.smart-link-button {
    border: none;

    padding: 9px 15px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #6d3cff,
            #ff2d75
        );

    color: #ffffff;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;
}

.smart-link-button:active {
    transform: scale(.97);
}

.smart-link-delete-button {
    border: none;

    padding: 9px 12px;

    border-radius: 12px;

    background: #fde0e0;

    color: #b3261e;

    font-size: 14px;

    cursor: pointer;

    margin-left: 8px;
}

.smart-link-delete-button:active {
    transform: scale(.97);
}

/* =========================================================
   BANK / WITHDRAWAL
========================================================= */

.withdrawal-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.withdrawal-balance {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 15px;

    margin-bottom: 18px;

    border-radius: 16px;

    background: #f7f7fc;
}

.withdrawal-balance-label {
    font-size: 13px;

    color: #777;
}

.withdrawal-balance-value {
    font-size: 21px;

    font-weight: 800;

    color: #6d3cff;
}

.bank-form {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.form-group {
    display: flex;

    flex-direction: column;

    gap: 6px;
}

.form-group label {
    font-size: 13px;

    font-weight: 700;

    color: #444;
}

.form-group input,
.form-group select {
    width: 100%;

    height: 46px;

    padding: 0 13px;

    border-radius: 12px;

    border: 1px solid #ddd;

    background: #ffffff;

    outline: none;

    font-size: 14px;

    transition: .2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #6d3cff;

    box-shadow:
        0 0 0 3px
        rgba(109,60,255,.10);
}

.withdraw-button {
    width: 100%;

    min-height: 48px;

    border: none;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #6d3cff,
            #ff2d75
        );

    color: #ffffff;

    font-size: 15px;

    font-weight: 800;

    cursor: pointer;

    margin-top: 5px;
}

.withdraw-button:disabled {
    opacity: .5;

    cursor: not-allowed;
}

.withdraw-note {
    margin: 10px 0 0;

    font-size: 12px;

    line-height: 1.5;

    color: #777;
}

.withdrawal-dates-notice {
    margin: 14px 0;

    padding: 12px 15px;

    border-radius: 14px;

    background: #eef6ff;

    color: #1a5fa8;

    font-size: 13px;

    font-weight: 600;

    line-height: 1.5;

    text-align: center;
}

.withdrawal-history-list {
    display: flex;

    flex-direction: column;

    gap: 10px;

    margin-top: 12px;
}

.withdrawal-history-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 14px 15px;

    border-radius: 16px;

    background: #f7f7fc;

    border: 1px solid #ededf5;
}

.withdrawal-history-info {
    display: flex;

    flex-direction: column;

    gap: 3px;

    min-width: 0;
}

.withdrawal-history-info strong {
    font-size: 15px;
}

.withdrawal-history-info span {
    font-size: 12px;

    color: #777;
}

.withdrawal-history-status {
    flex-shrink: 0;

    padding: 6px 12px;

    border-radius: 50px;

    font-size: 12px;

    font-weight: 800;

    text-transform: capitalize;
}

.withdrawal-history-status.pending {
    background: #fff4d6;

    color: #a3720b;
}

.withdrawal-history-status.approved {
    background: #d9f7e4;

    color: #147a3d;
}

.withdrawal-history-status.rejected {
    background: #fde0e0;

    color: #b3261e;
}

.view-all-transactions-link {
    display: block;

    text-align: center;

    margin-top: 16px;

    padding: 12px;

    border-radius: 14px;

    background: #ececf5;

    color: #6c5ce7;

    font-weight: 800;

    font-size: 14px;

    text-decoration: none;
}

.leaderboard-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.leaderboard-list {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.leaderboard-item {
    width: 100%;

    padding: 12px 15px;

    border-radius: 16px;

    background: #f7f7fc;

    border: 1px solid #ededf5;

    display: flex;

    align-items: center;

    gap: 12px;
}

.leaderboard-rank {
    width: 32px;

    flex-shrink: 0;

    text-align: center;

    font-size: 18px;

    font-weight: 800;

    color: #888;
}

.leaderboard-avatar {
    width: 38px;

    height: 38px;

    border-radius: 50%;

    object-fit: cover;

    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;

    min-width: 0;
}

.leaderboard-name {
    margin: 0;

    font-size: 14px;

    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.leaderboard-count {
    flex-shrink: 0;

    font-size: 13px;

    font-weight: 800;

    color: #6c5ce7;
}

.referral-balance-card {
    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.referral-balance-amount {
    font-size: 28px;

    font-weight: 800;

    color: #147a3d;

    margin-top: 8px;
}

/* =========================================================
   ADMIN SECTION
========================================================= */

.admin-section {
    display: none;

    background: #ffffff;

    border-radius: 22px;

    padding: 20px;

    margin-bottom: 15px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);

    border: 1px solid rgba(109,60,255,.15);
}

.admin-section.visible {
    display: block;
}

.admin-badge {
    display: inline-flex;

    align-items: center;

    padding: 6px 10px;

    border-radius: 50px;

    background: rgba(109,60,255,.10);

    color: #6d3cff;

    font-size: 11px;

    font-weight: 800;

    margin-bottom: 10px;
}

.admin-link-form {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.admin-action-button {
    width: 100%;

    min-height: 46px;

    border: none;

    border-radius: 13px;

    background: #222;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;
}

/* =========================================================
   NATIVE AD
========================================================= */

.tasks-native-ad {
    width: 100%;

    min-height: 120px;

    margin: 15px 0;

    background: #ffffff;

    border-radius: 22px;

    padding: 15px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.tasks-native-ad-container {
    width: 100%;

    max-width: 600px;

    min-height: 100px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;
}

.tasks-native-ad-container iframe {
    max-width: 100% !important;

    border: 0 !important;
}

/* =========================================================
   STATUS / EMPTY
========================================================= */

.tasks-status {
    text-align: center;

    padding: 30px 15px;

    color: #777;

    font-size: 14px;
}

.tasks-message {
    display: none;

    padding: 12px 14px;

    border-radius: 12px;

    margin-bottom: 15px;

    font-size: 13px;

    line-height: 1.5;
}

.tasks-message.show {
    display: block;
}

.tasks-message.success {
    background: #eafaf0;

    color: #177245;
}

.tasks-message.error {
    background: #fff0f0;

    color: #c62828;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .tasks-page {
        padding: 12px;
    }

    .tasks-page-title h1 {
        font-size: 21px;
    }

    .tasks-user-card {
        padding: 16px;
    }

    .tasks-user-avatar {
        width: 50px;
        height: 50px;
    }

    .earnings-grid {
        grid-template-columns: 1fr;
    }

    .earning-card {
        padding: 16px;
    }

    .earning-card-value {
        font-size: 20px;
    }

    .task-card,
    .smart-links-card,
    .withdrawal-card,
    .admin-section {
        padding: 17px;
        border-radius: 18px;
    }

    .smart-link-item {
        align-items: flex-start;

        flex-direction: column;
    }

    .smart-link-button {
        width: 100%;
    }

    .withdrawal-balance {
        flex-direction: column;

        align-items: flex-start;
    }

}

/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .tasks-page {
        padding: 8px;
    }

    .tasks-page-title h1 {
        font-size: 19px;
    }

    .section-title {
        font-size: 17px;
    }

    .tasks-user-name {
        font-size: 16px;
    }

}