/**
 * CSC Buy Modal - Clean Two-Category Design
 * Category 1: Single Purchase (For Your Launch)
 * Category 2: Subscriptions (For Pros - Continuous Learning)
 */

/* ========================================
   Variables & Base
   ======================================== */
:root {
    --csc-modal-primary: #819D86;
    --csc-modal-primary-dark: #6B8A71;
    --csc-modal-primary-light: #E4F4EE;
    --csc-modal-accent: #F59E0B;
    --csc-modal-accent-dark: #D97706;
    --csc-modal-success: #10B981;
    --csc-modal-text: #1F2937;
    --csc-modal-text-light: #6B7280;
    --csc-modal-bg: #FFFFFF;
    --csc-modal-border: #E5E7EB;
    --csc-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --csc-modal-radius: 16px;
    --csc-modal-radius-sm: 12px;
}

/* ========================================
   Modal Overlay & Container
   ======================================== */
.csc-buy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.csc-buy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: csc-fade-in 0.2s ease;
}

.csc-buy-modal-container {
    position: relative;
    background: var(--csc-modal-bg);
    border-radius: var(--csc-modal-radius);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--csc-modal-shadow);
    animation: csc-modal-slide-up 0.3s ease;
}

@keyframes csc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes csc-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Close Button
   ======================================== */
.csc-buy-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 22px;
    color: var(--csc-modal-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.csc-buy-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--csc-modal-text);
}

/* ========================================
   Modal Content
   ======================================== */
.csc-buy-modal-content {
    padding: 32px;
}

/* ========================================
   Header with Course Info (Catalog)
   ======================================== */
.csc-buy-modal-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--csc-modal-border);
}

.csc-buy-modal-course-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.csc-buy-modal-course-img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csc-buy-modal-course-details h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--csc-modal-text);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.csc-buy-modal-view-link {
    color: var(--csc-modal-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s;
}

.csc-buy-modal-view-link:hover {
    color: var(--csc-modal-primary-dark);
}

/* ========================================
   Credits Section
   ======================================== */
.csc-buy-modal-credits-section {
    background: linear-gradient(135deg, var(--csc-modal-primary) 0%, var(--csc-modal-primary-dark) 100%);
    border-radius: var(--csc-modal-radius-sm);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.csc-buy-modal-credits-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.csc-credits-icon {
    font-size: 28px;
}

.csc-credits-count {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.csc-credits-label {
    font-size: 13px;
    opacity: 0.9;
}

.csc-buy-modal-unlock-btn {
    background: #fff;
    color: var(--csc-modal-primary-dark);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.csc-buy-modal-unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.csc-unlock-icon {
    font-size: 16px;
}

/* ========================================
   No Credits Section (for subscribers without credits)
   ======================================== */
.csc-buy-modal-no-credits-section {
    background: linear-gradient(135deg, var(--csc-modal-primary-light) 0%, #F0F9F4 100%);
    border-radius: var(--csc-modal-radius-sm);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(129, 157, 134, 0.3);
}

.csc-buy-modal-no-credits-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.csc-no-credits-icon {
    font-size: 24px;
}

.csc-no-credits-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--csc-modal-text);
}

.csc-no-credits-message {
    font-size: 13px;
    color: var(--csc-modal-text-light);
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.csc-buy-modal-promo-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%);
    padding: 14px 24px;
    border-radius: var(--csc-modal-radius-sm);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.csc-buy-modal-promo-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: promo-shine 3s infinite;
}

@keyframes promo-shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.csc-buy-modal-promo-inline .csc-promo-icon {
    font-size: 22px;
}

.csc-buy-modal-promo-inline .csc-promo-code {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    font-family: 'Monaco', 'Consolas', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.csc-buy-modal-promo-inline .csc-promo-discount {
    background: rgba(255, 255, 255, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   Promo Code Box (styled like credits page)
   ======================================== */
.csc-buy-modal-promo-box {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%);
    border-radius: var(--csc-modal-radius-sm);
    padding: 18px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.csc-buy-modal-promo-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: promo-box-shine 4s infinite;
}

@keyframes promo-box-shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.csc-promo-box-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    font-weight: 600;
}

.csc-promo-box-code-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.csc-promo-box-code {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.4);
}

.csc-promo-box-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.csc-promo-box-copy:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.csc-promo-box-copy .csc-copy-icon {
    font-size: 14px;
}

.csc-promo-box-discount {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

/* ========================================
   Promo Applied Option Styles
   ======================================== */
.csc-option-promo-applied {
    border: 2px solid var(--csc-modal-accent);
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
}

.csc-ribbon-promo {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%) !important;
    color: #fff !important;
    font-weight: 700;
}

.csc-price-with-discount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.csc-price-original {
    font-size: 16px;
    color: #9CA3AF;
    text-decoration: line-through;
    font-weight: 500;
}

.csc-price-discounted {
    font-size: 28px;
    font-weight: 800;
    color: var(--csc-modal-accent-dark);
    line-height: 1;
}

.csc-btn-promo-checkout {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.csc-btn-promo-checkout:hover {
    background: linear-gradient(135deg, var(--csc-modal-accent-dark) 0%, #B45309 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* ========================================
   Promo Section
   ======================================== */
.csc-buy-modal-promo-section {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%);
    border-radius: var(--csc-modal-radius-sm);
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.csc-buy-modal-promo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    margin-bottom: 6px;
}

.csc-promo-icon {
    font-size: 20px;
}

.csc-promo-code {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.csc-promo-discount {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.csc-promo-hint {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 0;
}

/* ========================================
   Category Sections
   ======================================== */
.csc-buy-modal-category {
    margin-bottom: 16px;
}

.csc-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.csc-category-icon {
    font-size: 20px;
}

.csc-category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--csc-modal-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Separator
   ======================================== */
.csc-buy-modal-separator {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.csc-buy-modal-separator::before,
.csc-buy-modal-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--csc-modal-border);
}

.csc-buy-modal-separator span {
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--csc-modal-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Option Cards
   ======================================== */
.csc-buy-modal-option {
    background: #fff;
    border: 2px solid var(--csc-modal-border);
    border-radius: var(--csc-modal-radius-sm);
    padding: 20px;
    position: relative;
    transition: all 0.2s ease;
}

.csc-buy-modal-option:hover {
    border-color: var(--csc-modal-primary);
}

.csc-option-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-top: 15px;
}

.csc-option-left {
    flex: 1;
}

.csc-option-left h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--csc-modal-text);
    margin: 0 0 8px 0;
}

.csc-option-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 140px;
}

/* Featured Option (Annual) */
.csc-option-featured {
    border-color: var(--csc-modal-accent);
    background: linear-gradient(180deg, #FFFBEB 0%, #FFF 50%);
}

.csc-option-featured:hover {
    border-color: var(--csc-modal-accent-dark);
}

/* Ribbon - Base style */
.csc-option-ribbon {
    position: absolute;
    top: -10px;
    left: 20px;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ribbon - Best offer (annual) */
.csc-option-featured .csc-option-ribbon {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Ribbon - Single purchase */
.csc-ribbon-single {
    background: var(--csc-modal-primary);
    box-shadow: 0 2px 8px rgba(129, 157, 134, 0.3);
}

/* Ribbon - Monthly (flexible) */
.csc-ribbon-monthly {
    background: #7C3AED;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* Option Description */
.csc-option-desc {
    font-size: 13px;
    color: var(--csc-modal-text-light);
    line-height: 1.5;
    margin: 0 0 10px 0;
}

/* Option Guarantee */
.csc-option-guarantee {
    font-size: 12px;
    color: var(--csc-modal-success);
    margin: 0;
    font-weight: 600;
}

/* Option Price */
.csc-option-price {
    margin-bottom: 6px;
}

.csc-price-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--csc-modal-text);
    line-height: 1;
}

.csc-price-period {
    font-size: 14px;
    color: var(--csc-modal-text-light);
    font-weight: 500;
}

.csc-price-billed {
    font-size: 11px;
    color: var(--csc-modal-text-light);
    margin: 0 0 10px 0;
}


.csc-option-monthly{padding-top: 10px;}


/* Option Buttons */
.csc-option-btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: var(--csc-modal-radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.csc-btn-single {
    background: var(--csc-modal-primary);
    color: #fff;
}

.csc-btn-single:hover {
    background: var(--csc-modal-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.csc-btn-annual {
    background: linear-gradient(135deg, var(--csc-modal-accent) 0%, var(--csc-modal-accent-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.csc-btn-annual:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.csc-btn-monthly {
    background: #7C3AED;
    color: #fff;
}

.csc-btn-monthly:hover {
    background: #6D28D9;
    color: #fff;
    transform: translateY(-1px);
}

/* ========================================
   Subscriptions Container
   ======================================== */
.csc-buy-modal-subscriptions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   Trust Badges
   ======================================== */
.csc-buy-modal-trust {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--csc-modal-border);
}

.csc-trust-item {
    font-size: 12px;
    color: var(--csc-modal-text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 680px) {
    .csc-buy-modal-content {
        padding: 24px 20px;
    }
    
    .csc-option-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .csc-option-right {
        text-align: left;
        min-width: auto;
        width: 100%;
    }
    
    .csc-option-btn {
        width: 100%;
        text-align: center;
    }
    
    .csc-price-amount {
        font-size: 26px;
    }
    
    .csc-buy-modal-credits-section {
        flex-direction: column;
        text-align: center;
    }
    
    .csc-buy-modal-credits-badge {
        flex-direction: column;
        gap: 6px;
    }
    
    .csc-buy-modal-no-credits-section {
        padding: 16px;
    }
    
    .csc-no-credits-message {
        font-size: 12px;
    }
    
    .csc-buy-modal-promo-inline {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 18px;
    }
    
    .csc-buy-modal-promo-inline .csc-promo-code {
        font-size: 16px;
    }
    
    .csc-buy-modal-promo-box {
        padding: 14px 16px;
    }
    
    .csc-promo-box-code {
        font-size: 18px;
        padding: 8px 14px;
        letter-spacing: 2px;
    }
    
    .csc-promo-box-copy {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .csc-price-with-discount {
        align-items: center;
    }
    
    .csc-price-discounted {
        font-size: 24px;
    }
    
    .csc-buy-modal-course-info {
        flex-direction: column;
        text-align: center;
    }
    
    .csc-buy-modal-trust {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .csc-category-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .csc-buy-modal {
        padding: 10px;
    }
    
    .csc-buy-modal-container {
        border-radius: 12px;
    }
    
    .csc-buy-modal-content {
        padding: 20px 16px;
    }
    
    .csc-buy-modal-option {
        padding: 20px;
    }
    
    .csc-option-left h4 {
        font-size: 15px;
    }
    
    .csc-option-desc {
        font-size: 12px;
    }
}


.title2{margin-top: 20px;}

.csc-buy-modal-option {
    margin-top: 25px;
}

/* ========================================
   Loading State
   ======================================== */
.csc-buy-modal-unlock-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.csc-buy-modal-unlock-btn.loading .csc-unlock-icon {
    animation: csc-spin 1s linear infinite;
}

@keyframes csc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   Success Animation
   ======================================== */
.csc-buy-modal-success {
    text-align: center;
    padding: 50px 30px;
}

.csc-success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--csc-modal-success) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: #fff;
    animation: csc-success-bounce 0.5s ease;
}

@keyframes csc-success-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.csc-success-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--csc-modal-text);
    margin: 0 0 10px 0;
}

.csc-success-message {
    font-size: 15px;
    color: var(--csc-modal-text-light);
    margin: 0 0 20px 0;
}

.csc-success-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--csc-modal-primary) 0%, var(--csc-modal-primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csc-success-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(129, 157, 134, 0.35);
    color: #fff;
}
