/* PT FitMall Collaborator CSS - Modern and Sleek */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

.ptfc-ctv-auth-container, .ptfc-ctv-dashboard, .ptfc-ctv-auth-msg {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #1e293b;
    box-sizing: border-box;
    max-width: 1240px;
    margin: 0 auto;
}

/* Auth container */
.ptfc-ctv-auth-container {
    max-width: 480px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}
.ptfc-ctv-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}
.ptfc-ctv-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.ptfc-ctv-tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
}
.ptfc-ctv-tab-content {
    display: none;
}
.ptfc-ctv-tab-content.active {
    display: block;
}

.ptfc-ctv-field {
    margin-bottom: 18px;
}
.ptfc-ctv-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.ptfc-ctv-field input,
.ptfc-ctv-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s;
}
.ptfc-ctv-field input:focus,
.ptfc-ctv-field select:focus {
    outline: none;
    border-color: #000000;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0, 0.15);
}

/* Custom general buttons */
.ptfc-ctv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.ptfc-ctv-btn-primary {
    background: #000000;
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 15px;
}
.ptfc-ctv-btn-primary:hover {
    background: #e66200;
    color: #fff;
}
.ptfc-ctv-btn-logout {
    background: #f1f5f9;
    color: #475569;
}
.ptfc-ctv-btn-logout:hover {
    background: #e2e8f0;
}

.ptfc-ctv-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
}
.ptfc-ctv-alert.error {
    background: #f1f5f9;
    border: 1.5px solid #fecaca;
    color: #991b1b;
}

.ptfc-alert-error { background: #fee2e2; color: #b91c1c; padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; text-align: center; }
.ptfc-alert-success { background: #dcfce3; color: #166534; padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; text-align: center; }
.ptfc-auth-footer { text-align: center; margin-top: 25px; font-size: 14px; color: #475569; }
.ptfc-auth-link { color: #333333; font-weight: 600; text-decoration: none; }

/* Dashboard design */
.ptfc-ctv-dashboard {
    margin: 80px auto;
}
.ptfc-ctv-db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 20px;
    margin-bottom: 24px;
}
.ptfc-ctv-user-meta h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
}
.ptfc-ctv-user-meta h2 span {
    color: #000000;
}
.ptfc-ctv-sale-info {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ptfc-badge-sale {
    background: #0ea5e9;
    color: #fff;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 11px;
}

/* Widgets */
.ptfc-ctv-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.ptfc-ctv-widget-card {
    background: #fff;
    border: 1px solid #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}
.ptfc-widget-icon {
    font-size: 32px;
    background: #f1f5f9;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ptfc-widget-data {
    display: flex;
    flex-direction: column;
}
.ptfc-widget-data .ptfc-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}
.ptfc-widget-data .ptfc-number {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0;
    color: #0f172a;
}
.ptfc-widget-data .ptfc-sub {
    font-size: 11px;
    color: #64748b;
}

.ptfc-ctv-card {
    background: #fff;
    border: 1px solid #f5f5f5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}
.ptfc-ctv-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
}
.ptfc-ctv-card p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #64748b;
}

/* Referral tool */
.ptfc-referral-generator {
    background: #f8fafc;
    border-radius: 8px;
    padding: 18px;
}
.ptfc-generator-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.ptfc-generator-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
}
.ptfc-generator-row input:focus {
    outline: none;
    border-color: #000000;
    background: #fff;
}
.ptfc-generator-row .ptfc-ctv-btn {
    width: auto;
}
.ptfc-generator-result {
    display: flex;
    gap: 10px;
}
.ptfc-generator-result input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #000000;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #000000;
}
.ptfc-ctv-btn-copy {
    background: #000000;
    color: #fff;
    padding: 10px 24px;
}
.ptfc-ctv-btn-copy:hover {
    background: #e66200;
    color: #fff;
}

/* Table styling */
.ptfc-table-responsive {
    overflow-x: auto;
}
.ptfc-ctv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: none !important;
}
.ptfc-ctv-table th, .ptfc-ctv-table td {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}
.ptfc-ctv-table th {
    text-align: left;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}
.ptfc-ctv-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155;
    vertical-align: middle;
}
.text-right {
    text-align: right;
}
.text-success-bold {
    color: #10b981;
    font-size: 14px;
}

.ptfc-ctv-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.ptfc-ctv-badge-completed { background: #d1fae5; color: #065f46; }
.ptfc-ctv-badge-processing { background: #e0f2fe; color: #0369a1; }
.ptfc-ctv-badge-pending { background: #fef3c7; color: #78350f; }
.ptfc-ctv-badge-cancelled, .ptfc-ctv-badge-failed { background: #fee2e2; color: #991b1b; }

.ptfc-ctv-empty {
    text-align: center;
    padding: 40px 0;
    color: #94a3b8;
}

.ptfc-ctv-auth-msg {
    text-align: center;
    padding: 40px;
    border: 1px solid #f5f5f5;
    border-radius: 12px;
    background: #fff;
}
.ptfc-ctv-auth-msg.error {
    border-color: #fecaca;
    background: #f1f5f9;
    color: #991b1b;
}



/* Dashboard Tabbed Layout */
.ptfc-ctv-db-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}
.ptfc-ctv-sidebar, .ptfc-ctv-main-content {
    min-width: 0;
}



/* Sidebar */
.ptfc-ctv-sidebar {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: fit-content;
    border: 1px solid #f5f5f5;
}

.ptfc-ctv-user-meta {
    text-align: center;
}

.ptfc-ctv-user-meta h2 {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
}

.ptfc-ctv-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.ptfc-ctv-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ptfc-ctv-nav-item {
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.ptfc-ctv-nav-item:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ptfc-ctv-nav-item.active {
    background: #333333;
    color: #fff;
    box-shadow: 0 4px 12px rgba(51,51,51, 0.2);
}

.ptfc-mobile-text {
    display: none;
}

.ptfc-ctv-sidebar-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.ptfc-ctv-btn-logout-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ptfc-ctv-btn-logout-sidebar:hover {
    background: #f1f5f9;
    color: #000;
    border-color: #000;
}

/* Main Content */
.ptfc-tab-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 24px;
}

/* Account Info Grid */
.ptfc-account-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .ptfc-account-info-grid {
        grid-template-columns: 1fr;
    }
}

.ptfc-info-group label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}

.ptfc-info-val {
    font-size: 16px;
    color: #1e293b;
    font-weight: 500;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.ptfc-info-val.ptfc-highlight-val {
    background: #f8f9fa;
    border-color: #e2e8f0;
}

/* Forms */
.ptfc-form-group {
    margin-bottom: 20px;
}
.ptfc-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
.ptfc-input {
    width: 100%;
    padding: 12px 16px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    line-height: normal !important;
    min-height: 48px !important;
}
.ptfc-input:focus {
    background: #fff !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1) !important;
}

/* Password Toggle */
.ptfc-password-wrapper {
    position: relative;
    width: 100%;
}
.ptfc-password-wrapper .ptfc-input {
    padding-right: 48px !important; /* Make room for icon */
}
.ptfc-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    padding: 0;
    margin: 0;
    color: #1e293b !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto !important;
    box-shadow: none !important;
    width: 24px;
    height: 24px;
}
.ptfc-toggle-password:hover, .ptfc-toggle-password:active, .ptfc-toggle-password:focus {
    color: #000000 !important;
    outline: none !important;
    background: transparent !important;
}
.ptfc-toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: currentColor !important;
    display: block;
}

/* Button override */
button.ptfc-ctv-btn, input.ptfc-ctv-btn, a.ptfc-ctv-btn {
    border-radius: 12px !important;
    min-height: 46px !important;
    text-transform: none !important;
    box-shadow: none !important;
}
button.ptfc-ctv-btn-primary {
    background: #333333 !important;
    color: #fff !important;
    border: 1px solid #333333 !important;
}
button.ptfc-ctv-btn-primary:hover {
    background: #c2410c !important;
    border-color: #c2410c !important;
    color: #fff !important;
}

/* Modal styling */
.ptfc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
.ptfc-modal-box {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 24px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}
.ptfc-modal-overlay.active {
    display: flex;
}
.ptfc-modal-overlay.active .ptfc-modal-box {
    transform: scale(1);
}
.ptfc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0 4px;
}
.ptfc-modal-close:hover {
    color: #0f172a;
}
.ptfc-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.ptfc-modal-content {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
}

/* Media Queries (Mobile Responsive) */
@media (max-width: 992px) {
    .ptfc-ctv-db-layout {
        display: block;
    }
    .ptfc-desktop-text {
        display: none;
    }
    .ptfc-mobile-text {
        display: inline;
    }
    .ptfc-ctv-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        z-index: 999;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        margin: 0;
        border: none;
        height: auto;
    }
    .ptfc-ctv-user-meta {
        display: none;
    }
    .ptfc-ctv-sidebar-footer {
        display: none;
    }
    .ptfc-ctv-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        gap: 0;
    }
    .ptfc-ctv-nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 4px;
        font-size: 11px;
        font-weight: 500;
        flex: 1;
        border-radius: 12px;
        background: transparent !important;
        color: #64748b !important;
        box-shadow: none !important;
    }
    .ptfc-ctv-nav-item svg {
        margin: 0 auto;
    }
    .ptfc-ctv-nav-item.active {
        color: #333333 !important;
    }
    .ptfc-ctv-nav-item.active svg {
        stroke: #333333;
    }
    .ptfc-ctv-dashboard {
        padding-bottom: 30px !important; 
    }
    .ptfc-ctv-table th, .ptfc-ctv-table td {
        white-space: nowrap;
    }
    .ptfc-mobile-logout {
        display: block !important;
    }
    .ptfc-mobile-user-meta {
        display: block !important;
        background: #f8fafc;
        border-radius: 16px;
        padding: 24px 20px;
        border: 1px solid #f5f5f5;
    }
}

@media (max-width: 768px) {
    .ptfc-ctv-widgets {
        grid-template-columns: 1fr;
    }
    .ptfc-ctv-db-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .ptfc-ctv-db-header .ptfc-ctv-btn-logout {
        width: 100%;
        text-align: center;
    }
    .ptfc-generator-row {
        flex-direction: column;
    }
    .ptfc-generator-result {
        flex-direction: column;
    }
    .ptfc-ctv-dashboard {
        margin: 20px auto;
        padding: 0 16px;
    }
    .ptfc-ctv-card {
        padding: 16px;
    }
    .ptfc-mobile-transparent-card {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .ptfc-tab-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    /* Mobile Table Card Layout */
    .ptfc-ctv-table, 
    .ptfc-ctv-table tbody, 
    .ptfc-ctv-table tr, 
    .ptfc-ctv-table td {
        display: block;
        width: 100%;
        white-space: normal;
    }
    .ptfc-ctv-table thead {
        display: none;
    }
    .ptfc-ctv-table tr {
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 8px 16px;
        background: #fff;
    }
    .ptfc-ctv-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 12px 0 !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        background: transparent !important;
    }
    .ptfc-ctv-table td:last-child {
        border-bottom: none !important;
    }
    .ptfc-ctv-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: #64748b;
        text-transform: uppercase;
        text-align: left;
        margin-right: 16px;
    }
    .ptfc-ctv-table td.text-right {
        text-align: right;
    }
}
