/* ================================================================
   Account Page — Visual Design
   ================================================================ */

/* Page background: soft purple-grey for depth */
.tts-account-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: -24px;
    padding: 24px;
    border-radius: var(--tts-radius-lg);
}

/* --- Card base: lift from background --- */
.tts-account-page > .tts-card,
.tts-account-page .tts-upgrade-cards .tts-card,
.tts-account-page > .tts-account-card,
.tts-main-content > div > .tts-account-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ================================================================
   1. Account Card — one wide card, two columns
   ================================================================ */
.tts-account-card {
    display: grid;
    grid-template-columns: 2fr 1fr;
}

.tts-account-card > .tts-account-status {
    border-right: 1px solid #eee;
}

@media (max-width: 768px) {
    .tts-account-card {
        grid-template-columns: 1fr;
    }
    .tts-account-card > .tts-account-status {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* ====================================================================
   PRO Features grid — shared by Account & Upgrade pages
   (markup lives in admin/partials/pro-features-grid.php)
   ==================================================================== */

.tts-pro-features {
    margin-top: 32px;
}

.tts-pro-features-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--tts-text-primary);
    margin: 0 0 30px;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: nowrap;
}

.tts-pro-features-heading::before,
.tts-pro-features-heading::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--tts-border-color, #e2e2e2);
}

.tts-license-features-section {
    margin-top: 0;
}

.tts-license-feature-card {
    padding: 20px;
}

.tts-license-feature-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--tts-text-primary);
    margin: 0 0 4px;
}

.tts-license-feature-heading svg {
    color: var(--tts-purple);
    flex-shrink: 0;
}

.tts-license-feature-desc {
    font-size: 13px;
    color: var(--tts-text-secondary);
    margin: 0 0 14px;
    min-height: 36px;
}

.tts-license-features-section .tts-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tts-license-features-section .tts-feature-list li {
    font-size: 14px;
    color: var(--tts-text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
}

.tts-license-features-section .tts-feature-list li::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--tts-green-bg, #e6f7f1);
    border: 1px solid var(--tts-green-border, #b8e6d0);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3L3 5L7 1' stroke='%231D9E75' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 782px) {
    .tts-license-features-section .tts-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --- Status (left column) --- */
.tts-account-status {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
}

.tts-account-status-info {
    flex: 1;
    min-width: 200px;
}

.tts-account-status-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tts-account-plan-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
}

.tts-account-plan-line {
    font-size: 16px;
    font-weight: 700;
    color: var(--tts-text-primary);
}

.tts-account-plan-detail {
    font-size: 13px;
    color: var(--tts-text-secondary);
    margin: 0 0 6px;
}

.tts-account-email {
    font-size: 13px;
    color: var(--tts-text-hint);
    margin: 0;
}

.tts-account-email strong {
    color: var(--tts-text-primary);
    font-weight: 500;
}

.tts-btn-disconnect {
    font-size: 12px;
    color: var(--tts-red);
    border-color: var(--tts-red);
}

.tts-btn-disconnect:hover {
    background: var(--tts-red);
    color: #fff;
}

/* --- Credits meter (right column) --- */
.tts-credits-meter {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tts-credits-meter h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 16px;
    color: var(--tts-text-hint);
}

.tts-credits-numbers {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.tts-credits-balance {
    font-size: 28px;
    font-weight: 700;
    color: var(--tts-text-primary);
}

.tts-credits-total {
    font-size: 14px;
    color: var(--tts-text-hint);
}

.tts-credits-bar {
    height: 10px;
    background: #ede9fe;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tts-credits-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: var(--tts-purple);
    transition: width 0.3s ease;
}

.tts-credits-bar-fill.green { background: var(--tts-purple); }
.tts-credits-bar-fill.amber { background: var(--tts-amber); }
.tts-credits-bar-fill.red   { background: var(--tts-red); }

.tts-credits-breakdown,
.tts-credits-reset-line {
    font-size: 12px;
    color: var(--tts-text-hint);
}

.tts-credits-reset-line {
    margin-top: 2px;
}

/* ================================================================
   1b. License banner — compact one-line plan summary used for free
       users on Settings/Account pages and on the upgrade page.
   ================================================================ */
.tts-license-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: #f3f0ff;
    border: 1px solid #e0d9ff;
    border-radius: var(--tts-radius-lg, 12px);
    margin-bottom: 16px;
}

.tts-license-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tts-license-banner-label {
    font-size: 13px;
    color: var(--tts-text-hint);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tts-license-banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tts-green);
    flex-shrink: 0;
}

.tts-license-banner-plan {
    font-size: 14px;
    font-weight: 600;
    color: var(--tts-text-primary);
}

.tts-license-banner-sep {
    color: var(--tts-text-hint);
}

.tts-license-banner-credits {
    font-size: 13px;
    color: var(--tts-text-secondary);
}

.tts-license-banner-topup {
    font-size: 12px;
    font-weight: 500;
    color: var(--tts-purple);
    border: 1px solid var(--tts-purple-border);
    background: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.tts-license-banner-topup:hover {
    background: var(--tts-purple-bg);
    border-color: var(--tts-purple);
    color: var(--tts-purple);
}

.tts-license-banner-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .tts-license-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ================================================================
   2. Upgrade Plan Cards — Pro & Agency side by side
   ================================================================ */
.tts-interval-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 16px;
}

.tts-interval-label {
    color: var(--tts-text-hint);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.tts-interval-label.active {
    color: var(--tts-text-primary);
    font-weight: 600;
}

.tts-toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--tts-purple);
    border: none;
    border-radius: 11px;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.tts-toggle-knob {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.tts-toggle-switch:not(.active) .tts-toggle-knob {
    transform: translateX(-18px);
}

.tts-interval-toggle .tts-save-badge {
    background: var(--tts-purple-bg);
    color: var(--tts-purple);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.tts-upgrade-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.tts-upgrade-cards[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.tts-upgrade-cards[data-count="3"] {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 1100px) {
    .tts-upgrade-cards[data-count="3"] {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .tts-upgrade-cards,
    .tts-upgrade-cards[data-count="2"],
    .tts-upgrade-cards[data-count="3"] {
        grid-template-columns: 1fr;
    }
}

/* Pro card: purple top accent */
.tts-upgrade-cards .tts-card[data-plan="pro"] {
    border-top: 3px solid var(--tts-purple);
}

.tts-upgrade-section {
    padding: 24px;
}

.tts-upgrade-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tts-upgrade-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--tts-text-primary);
    margin: 0;
}

.tts-upgrade-select-row {
    margin-bottom: 16px;
}

.tts-account-page .tts-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--tts-radius-md, 8px);
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    color: var(--tts-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.tts-account-page .tts-select:focus {
    outline: none;
    border-color: var(--tts-purple);
    box-shadow: 0 0 0 2px var(--tts-purple-bg);
}

.tts-upgrade-select-row .tts-select {
    width: 100%;
}

.tts-upgrade-price-block {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tts-upgrade-price-left {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.tts-upgrade-price-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--tts-text-primary);
}

.tts-upgrade-price-period {
    font-size: 14px;
    color: var(--tts-text-hint);
}

.tts-upgrade-billed {
    font-size: 12px;
    color: #686476;
}

.tts-upgrade-features {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tts-upgrade-features li {
    font-size: 13px;
    color: var(--tts-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tts-upgrade-features li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tts-purple-bg);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3L3 5L7 1' stroke='%236B45D4' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.tts-upgrade-features li:first-child::before {
    background-color: var(--tts-purple);
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='6' viewBox='0 0 8 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3L3 5L7 1' stroke='%23ffffff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tts-upgrade-section .tts-btn-primary {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    display: flex;
    box-sizing: border-box;
}

.tts-upgrade-footer {
    font-size: 13px;
    color: var(--tts-text-hint);
}

.tts-upgrade-footer a {
    color: var(--tts-purple);
    text-decoration: none;
}

.tts-upgrade-footer a:hover {
    text-decoration: underline;
}

/* ================================================================
   3. Credit Top-ups
   ================================================================ */
.tts-topup-section {
    padding: 24px;
}

.tts-topup-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--tts-text-primary);
}

.tts-topup-section .tts-card-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: #434048;
}

.tts-topup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tts-topup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
}

@media (max-width: 768px) {
    .tts-topup-grid {
        grid-template-columns: 1fr;
    }
}

.tts-topup-grid .tts-topup-section {
    padding: 0;
}

.tts-topup-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--tts-text-primary);
    min-width: 70px;
}

.tts-topup-benefits {
    background: #f5f3ff;
    border-radius: 10px;
    padding: 16px;
}

.tts-topup-benefits ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tts-topup-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #434048;
}

svg.tts-topup-benefit-icon {
    flex-shrink: 0;
}

/* ================================================================
   4. Checkout Modal
   ================================================================ */
.tts-checkout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.tts-checkout-overlay.active {
    display: flex;
}

.tts-checkout-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tts-checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tts-checkout-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--tts-text-primary);
}

.tts-checkout-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--tts-text-hint);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tts-checkout-close:hover {
    color: var(--tts-text-primary);
}

.tts-checkout-body {
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

/* ================================================================
   5. Utility
   ================================================================ */
.tts-card-body-text {
    padding: 0 24px 20px;
    margin: 0;
}
