/**
 * Crazy Master - Premium Content Frontend Styling
 * Modern, Responsive, Mobile-First
 */

.cm-premium-wrapper {
    margin: 32px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #1e293b;
    box-sizing: border-box;
}

.cm-premium-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   LOCKED STATE STYLING
   ========================================================================== */

.cm-locked-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.cm-locked-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #f59e0b, #ef4444, #3b82f6);
}

.cm-locked-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 9999px;
    margin-bottom: 16px;
    border: 1px solid #fde68a;
}

.cm-locked-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.3;
}

.cm-locked-desc {
    font-size: 15px;
    color: #475569;
    max-width: 580px;
    margin: 0 auto 24px;
}

/* Highlights Chips */
.cm-locked-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.cm-highlight-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Teaser Preview with Blurred Answer */
.cm-locked-qa-preview {
    text-align: left;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 28px;
    max-width: 680px;
}

.cm-preview-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin: 0 0 14px;
}

.cm-locked-qa-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cm-locked-qa-item {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.cm-locked-q-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.cm-q-num {
    color: #2563eb;
    margin-right: 4px;
}

.cm-locked-a-blur {
    position: relative;
    overflow: hidden;
    padding: 6px 8px;
    background: #f1f5f9;
    border-radius: 6px;
}

.cm-blur-mask {
    filter: blur(4px);
    user-select: none;
    opacity: 0.6;
    font-size: 13px;
    color: #64748b;
}

.cm-blur-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    white-space: nowrap;
    backdrop-filter: blur(2px);
}

/* Unlock CTA Action Button */
.cm-unlock-action-box {
    margin-top: 10px;
}

.cm-unlock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 17px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    max-width: 100%;
}

.cm-unlock-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
    color: #ffffff !important;
}

.cm-unlock-price-tag {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cm-payment-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* ==========================================================================
   UNLOCKED STATE STYLING
   ========================================================================== */

.cm-unlocked-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.cm-unlocked-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: #ffffff;
    padding: 14px 20px;
}

.cm-unlocked-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.cm-icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.cm-badge-unlocked-pill {
    background: #fde68a;
    color: #78350f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 9999px;
}

/* Unlocked Sections */
.cm-unlocked-section {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.cm-unlocked-section:last-child {
    border-bottom: none;
}

.cm-unlocked-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
}

.cm-section-icon {
    font-size: 18px;
}

.cm-description-body {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
}

/* Accordion (Q&A) */
.cm-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cm-accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.2s ease;
}

.cm-accordion-item.is-open {
    border-color: #3b82f6;
    box-shadow: 0 4px 8px -2px rgba(59, 130, 246, 0.1);
}

.cm-accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    transition: background 0.2s;
}

.cm-accordion-header:hover {
    background: #f1f5f9;
}

.cm-accordion-question {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin-right: 12px;
}

.cm-q-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.cm-accordion-arrow {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.cm-accordion-item.is-open .cm-accordion-arrow {
    transform: rotate(180deg);
    color: #2563eb;
}

.cm-accordion-content {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.cm-answer-inner {
    padding: 18px;
    background: #fafafa;
}

.cm-a-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.cm-answer-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
}

.cm-answer-text p:last-child {
    margin-bottom: 0;
}

/* Video Grid */
.cm-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cm-video-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cm-video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.cm-video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #0f172a;
}

.cm-video-embed-wrap iframe,
.cm-video-embed-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cm-video-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cm-video-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.4;
}

.cm-video-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   MY ACCOUNT PREMIUM CONTENT TAB
   ========================================================================== */

.cm-account-premium-wrapper {
    margin: 20px 0;
}

.cm-account-header {
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

.cm-account-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.cm-account-empty {
    text-align: center;
    padding: 48px 24px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
}

.cm-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.cm-account-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.cm-account-empty p {
    font-size: 14px;
    color: #64748b;
    max-width: 450px;
    margin: 0 auto 20px;
}

.cm-purchased-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cm-purchased-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cm-purchased-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.cm-purchased-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #f1f5f9;
    overflow: hidden;
}

.cm-purchased-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-unlocked-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cm-purchased-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cm-purchased-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
}

.cm-purchased-title a {
    color: #0f172a;
    text-decoration: none;
}

.cm-purchased-title a:hover {
    color: #2563eb;
}

.cm-purchased-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 600;
}

.cm-purchased-cta {
    margin-top: auto;
}

.cm-view-content-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #2563eb !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
}

.cm-view-content-btn:hover {
    background: #1d4ed8 !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .cm-locked-card {
        padding: 24px 16px;
    }

    .cm-locked-title {
        font-size: 20px;
    }

    .cm-unlock-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .cm-unlocked-section {
        padding: 18px 14px;
    }
}
