/**
 * Chapter Purchase Frontend Styles - SIMPLIFIED VERSION
 * Clean, non-intrusive design that won't break page layouts
 * Based on wp-manga-chapter-permissions approach
 */

/* Main locked chapter container - similar to wp-manga's content-blocked style */
.content-blocked.imcp-locked-chapter {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
}

.imcp-locked-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.content-blocked.imcp-locked-chapter h3 {
    font-size: 22px;
    margin: 0 0 20px 0;
    color: #1f2937;
    font-weight: 600;
}

.content-blocked.imcp-locked-chapter p {
    margin: 10px 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
}

/* Purchase info section */
.imcp-purchase-info {
    background: #f9fafb;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.imcp-price-line,
.imcp-balance-line {
    font-size: 16px;
    margin: 8px 0;
    color: #374151;
}

.imcp-price-line strong,
.imcp-balance-line strong {
    font-size: 20px;
    margin-left: 8px;
}

.imcp-balance-line strong.sufficient {
    color: #10b981;
}

.imcp-balance-line strong.insufficient {
    color: #ef4444;
}

.imcp-locked-price {
    font-size: 18px;
    color: #374151;
    margin: 15px 0;
}

/* Buttons */
.imcp-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer !important;
    transition: all 0.2s ease;
    border: none;
    margin: 10px 5px;
    pointer-events: auto !important;
    position: relative;
    z-index: 9999 !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.imcp-btn-purchase {
    background: #3b82f6;
    color: #fff;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
}

.imcp-btn-purchase:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    cursor: pointer !important;
}

.imcp-btn-login {
    background: #10b981;
    color: #fff;
}

.imcp-btn-login:hover {
    background: #059669;
    color: #fff;
    text-decoration: none;
}

.imcp-btn-addcoins {
    background: #f59e0b;
    color: #fff;
}

.imcp-btn-addcoins:hover {
    background: #d97706;
    color: #fff;
    text-decoration: none;
}

.imcp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Notes and messages */
.imcp-note {
    font-size: 13px;
    color: #10b981;
    margin: 12px 0 0 0;
    font-style: italic;
}

.imcp-insufficient {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
}

/* Toast notifications */
.imcp-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #3b82f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.imcp-toast.success {
    border-left-color: #10b981;
}

.imcp-toast.error {
    border-left-color: #ef4444;
}

.imcp-toast-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    color: #1f2937;
}

.imcp-toast-message {
    font-size: 14px;
    color: #6b7280;
}

/* Loading spinner */
.imcp-loading {
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .content-blocked.imcp-locked-chapter {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .imcp-locked-icon {
        font-size: 36px;
    }
    
    .content-blocked.imcp-locked-chapter h3 {
        font-size: 18px;
    }
    
    .imcp-btn {
        padding: 10px 24px;
        font-size: 14px;
        display: block;
        width: 100%;
        margin: 8px 0;
    }
    
    .imcp-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Ensure compatibility with reading page layout */
.reading-content .content-blocked.imcp-locked-chapter {
    margin: 30px auto;
}

.c-blog-post .content-blocked.imcp-locked-chapter {
    margin: 20px 0;
}

/* Critical fix for button clickability - Override any conflicting styles */
button.imcp-btn-purchase,
.imcp-btn-purchase {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 99999 !important;
    position: relative !important;
    display: inline-block !important;
}

button.imcp-btn-purchase:hover,
.imcp-btn-purchase:hover {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Prevent any overlay from blocking the button */
.content-blocked.imcp-locked-chapter * {
    pointer-events: auto !important;
}

/* Ensure button is always on top */
.content-blocked.imcp-locked-chapter button {
    position: relative;
    z-index: 99999 !important;
    cursor: pointer !important;
}
