/* ================================================
   Turkey Store — Paywall & Purchase UI
   ================================================ */

/* Paywall Barrier */
.ts-paywall-barrier {
    margin: 32px 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
}
.ts-paywall-lock {
    text-align: center;
    padding: 40px 24px;
}
.ts-paywall-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}
.ts-paywall-heading {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}
.ts-paywall-price {
    font-size: 1.8em;
    font-weight: bold;
    color: #1a1a1a;
    margin: 16px 0;
}
.ts-paywall-desc {
    font-size: 0.92em;
    color: #666;
    margin-bottom: 20px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.ts-paywall-login-note {
    font-size: 0.8em;
    color: #888;
    margin-top: 12px;
}

/* Purchase Button */
.ts-buy-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 1.05em;
    font-weight: bold;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.ts-buy-btn:hover { opacity: 0.9; }
.ts-buy-btn:active { transform: scale(0.98); }
.ts-buy-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Unlocked Content */
.ts-paywall-unlocked {
    margin: 24px 0;
    border-left: 4px solid #2e7d32;
    padding-left: 0;
}
.ts-paywall-unlocked-badge {
    background: #e8f5e9;
    color: #2e7d32;
    display: inline-block;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 16px;
}
.ts-paywall-content {
    margin-bottom: 20px;
}

/* Download Section */
.ts-dl-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}
.ts-dl-heading {
    margin: 0 0 12px;
    font-size: 1em;
    color: #333;
}
.ts-download-btn {
    display: inline-block;
    padding: 10px 22px;
    margin: 4px 8px 4px 0;
    background: #2e7d32;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    transition: opacity 0.15s;
}
.ts-download-btn:hover { opacity: 0.9; color: #fff; }

/* Processing (post-checkout, waiting for webhook) */
.ts-paywall-processing {
    text-align: center;
    padding: 40px 24px;
    margin: 32px 0;
    border: 2px dashed #4caf50;
    border-radius: 12px;
    background: #f1f8e9;
}
.ts-paywall-processing .ts-paywall-icon { font-size: 2em; }
.ts-paywall-processing .ts-paywall-message {
    font-size: 1.1em;
    color: #2e7d32;
    margin: 12px 0 8px;
}
.ts-paywall-processing .ts-paywall-sub {
    font-size: 0.85em;
    color: #666;
}

/* ================================================
   Modal
   ================================================ */
.ts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
}
.ts-modal {
    background: #fff;
    max-width: 420px;
    width: 100%;
    border-radius: 12px;
    padding: 32px 28px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.ts-modal h3 {
    margin: 0 0 8px;
    font-size: 1.2em;
}
.ts-modal-desc {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
}
.ts-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6em;
    cursor: pointer;
    color: #888;
    line-height: 1;
}
.ts-modal-close:hover { color: #222; }
.ts-modal-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9em;
    color: #333;
}
.ts-modal-form input {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
}
.ts-modal-form input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}
.ts-modal-submit {
    width: 100%;
    padding: 13px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}
.ts-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.ts-modal-submit:hover:not(:disabled) { opacity: 0.9; }
.ts-modal-message {
    margin-top: 14px;
    font-size: 0.9em;
    color: #555;
    min-height: 1.2em;
}
.ts-modal-message.ts-error { color: #c62828; }
.ts-modal-note {
    font-size: 0.78em;
    color: #888;
    margin-top: 16px;
    text-align: center;
}

/* ================================================
   My Page
   ================================================ */
.ts-my-page {
    padding: 24px 0;
}
.ts-mypage-greeting {
    font-size: 1.05em;
    color: #333;
}
.ts-mypage-login {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}
.ts-purchased-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.ts-purchased-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 8px;
}
.ts-purchased-title {
    font-weight: bold;
    color: #333;
    text-decoration: none;
}
.ts-purchased-title:hover { color: #0073aa; }
.ts-purchased-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ts-mypage-view {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
}
.ts-mypage-view:hover { opacity: 0.9; color: #fff; }
.ts-mypage-dl {
    padding: 8px 16px;
    background: #2e7d32;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
}
.ts-mypage-dl:hover { opacity: 0.9; color: #fff; }
.ts-mypage-logout {
    margin-top: 28px;
    font-size: 0.85em;
}

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 600px) {
    .ts-paywall-lock { padding: 28px 16px; }
    .ts-paywall-price { font-size: 1.4em; }
    .ts-buy-btn { padding: 12px 28px; font-size: 1em; }
    .ts-modal { padding: 24px 20px; }
    .ts-purchased-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
