/* ================================================
   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; }

/* Download Box ([turkey_download]) */
.ts-download-box {
    margin: 28px 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}
.ts-download-box .ts-paywall-unlocked-badge { margin: 16px 16px 0; }
.ts-download-box .ts-dl-section { margin: 0; border: none; border-radius: 0; }
.ts-download-offer {
    text-align: center;
    padding: 32px 24px;
}
.ts-download-offer-title {
    font-size: 1.05em;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}
.ts-download-offer-files {
    font-size: 0.88em;
    color: #666;
    margin-bottom: 10px;
}

/* 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 (v0.3.0)
   ================================================ */
.ts-my-page { padding: 24px 0; }
.ts-mypage-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.ts-mypage-greeting { font-size: 1.15em; font-weight: bold; color: #333; margin-bottom: 4px; }
.ts-mypage-email { font-size: 0.85em; color: #888; }
.ts-mypage-login { padding: 24px; background: #f9f9f9; border-radius: 8px; }
.ts-mypage-section { margin-bottom: 32px; }
.ts-mypage-section h3 { font-size: 1.1em; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #0073aa; }
.ts-mypage-empty { color: #888; }
.ts-mypage-items { display: flex; flex-direction: column; gap: 14px; }
.ts-mypage-item {
    border: 1px solid #e0e0e0; border-radius: 10px; padding: 18px 20px; background: #fafafa;
}
.ts-mypage-item.ts-expired { opacity: 0.6; }
.ts-mypage-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ts-mypage-item-title { font-weight: bold; color: #333; text-decoration: none; font-size: 1.05em; }
.ts-mypage-item-title:hover { color: #0073aa; }
.ts-mypage-item-meta { font-size: 0.82em; color: #888; margin-bottom: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.ts-mypage-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ts-btn {
    display: inline-block; padding: 8px 16px; border-radius: 5px; font-size: 0.85em;
    text-decoration: none; font-weight: bold; transition: opacity 0.15s;
}
.ts-btn:hover { opacity: 0.9; }
.ts-btn-primary { background: #0073aa; color: #fff; }
.ts-btn-primary:hover { color: #fff; }
.ts-btn-dl { background: #2e7d32; color: #fff; }
.ts-btn-dl:hover { color: #fff; }
.ts-btn-receipt { background: #555; color: #fff; }
.ts-btn-receipt:hover { color: #fff; }
.ts-badge { font-size: 0.75em; padding: 3px 8px; border-radius: 3px; font-weight: bold; }
.ts-badge-expired { background: #fce4ec; color: #c62828; }
.ts-history-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.ts-history-table th, .ts-history-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
.ts-history-table th { background: #f5f5f5; font-weight: normal; color: #666; }
.ts-history-table a { color: #0073aa; }
.ts-mypage-actions { margin-top: 24px; display: flex; gap: 16px; }
.ts-mypage-link { color: #666; text-decoration: none; font-size: 0.85em; }
.ts-mypage-link:hover { color: #0073aa; }

/* My Page Login Form */
.ts-mypage-login-box {
    max-width: 420px;
    margin: 32px auto;
    padding: 32px 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}
.ts-mypage-login-box h3 { margin: 0 0 8px; font-size: 1.2em; }
.ts-login-desc { font-size: 0.9em; color: #555; margin-bottom: 20px; }
.ts-login-form label {
    display: block; margin-bottom: 14px; font-size: 0.9em; color: #333;
}
.ts-login-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-login-form input:focus {
    border-color: #0073aa; outline: none; box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}
.ts-login-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-login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.ts-login-submit:hover:not(:disabled) { opacity: 0.9; }
.ts-login-message { margin-top: 12px; font-size: 0.9em; color: #555; min-height: 1.2em; }
.ts-login-message.ts-error { color: #c62828; }
.ts-login-links { margin-top: 16px; text-align: center; font-size: 0.85em; }
.ts-login-links a { color: #0073aa; text-decoration: none; }
.ts-login-note { margin-top: 12px; text-align: center; font-size: 0.78em; color: #888; }

/* Expired paywall */
.ts-paywall-expired { border-color: #ffcdd2; background: linear-gradient(180deg, #fff5f5 0%, #fce4ec 100%); }

/* ================================================
   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;
    }
}
