/* Frontend Styles pour Mon Ebook V2 - Layout Vertical Mobile-First */

.mon-ebook-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mon-ebook-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #F4C2C2;
    border-radius: 12px;
    color: #3c1a28;
    position: relative;
    overflow: hidden;
}

.mon-ebook-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.mon-ebook-title {
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: none;
    position: relative;
    z-index: 1;
}

.mon-ebook-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0 auto 25px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.mon-ebook-price-section {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.mon-ebook-price {
    font-size: 2.5em;
    font-weight: 900;
    color: #3c1a28;
    margin: 10px 0;
    text-shadow: none;
}

.price-currency {
    font-size: 0.7em;
    margin-left: 8px;
    opacity: 0.9;
}

/* Styles pour les prix promotionnels */
.price-comparison {
    margin-bottom: 20px;
}

.price-comparison .original-price {
    display: block;
    font-size: 1.2em;
    color: rgba(60, 26, 40, 0.55);
    text-decoration: line-through;
    margin-bottom: 10px;
}

.mon-ebook-price.promo-price {
    background: #D8A7A7;
    padding: 15px 25px;
    border-radius: 15px;
    border: 3px solid #3c1a28;
    box-shadow: 0 8px 25px rgba(216, 167, 167, 0.5);
    animation: pulse-promo 2s infinite;
}

@keyframes pulse-promo {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 8px 25px rgba(216, 167, 167, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 12px 35px rgba(216, 167, 167, 0.6);
    }
}

.savings {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: #000;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 700;
    display: inline-block;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.promo-countdown {
    background: #D8A7A7;
    color: #3c1a28;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 600;
    margin-top: 20px;
    display: inline-block;
    animation: urgency-blink 2s infinite;
    box-shadow: 0 4px 15px rgba(216, 167, 167, 0.3);
}

@keyframes urgency-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.promo-badge {
    display: inline-block;
    background: #D8A7A7;
    color: #3c1a28;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.mon-ebook-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Section Couverture - Design Central */
.mon-ebook-cover-section {
    text-align: center;
    margin-bottom: 40px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.mon-ebook-cover-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

/* Media Section - Amélioré */
.mon-ebook-media {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mon-ebook-cover {
    text-align: center;
}

.ebook-cover-image {
    max-width: 100%;
    max-height: 450px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ebook-cover-image:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

/* Section Aperçu PDF - Plus Grande et Visible */
.mon-ebook-extract {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.mon-ebook-extract h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mon-ebook-extract h3::before {
    content: "📄";
    font-size: 1.2em;
}

.extract-container {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    background: #eef2f7;
    border-bottom: 1px solid #d9e2ec;
}

.pdf-btn {
    border: 1px solid #c8d2dc;
    background: #fff;
    color: #243447;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

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

.pdf-page-indicator {
    font-weight: 600;
    color: #334e68;
    min-width: 72px;
    text-align: center;
}

.pdf-canvas-wrap {
    width: 100%;
    max-height: 980px;
    min-height: 520px;
    overflow: auto;
    background: #e8edf3;
    padding: 12px;
    box-sizing: border-box;
}

.pdf-canvas {
    display: block;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}

.pdf-viewer-fallback {
    padding: 12px;
    text-align: center;
    color: #7a2e2e;
    background: #fff1f1;
    border-top: 1px solid #f3d0d0;
}

.extract-iframe-fallback {
    width: 100%;
    height: 780px;
    border: none;
    border-top: 1px solid #dbe2ea;
    background: #fff;
}

.extract-pdf-viewer.is-fallback .pdf-toolbar,
.extract-pdf-viewer.is-fallback .pdf-canvas-wrap {
    display: none;
}

.extract-iframe {
    width: 100%;
    height: 720px;
    border: none;
    border-radius: 8px;
    background: white;
    display: block;
}

.extract-note {
    text-align: center;
    margin-top: 15px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
    padding: 10px;
    background: #e9ecef;
    border-radius: 6px;
}

/* Section Achat - Design Moderne et Centré */
.mon-ebook-purchase {
    background: #fff;
    border: 1px solid #e6ebf0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.mon-ebook-purchase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e6762c;
}

.purchase-form-container h3 {
    text-align: center;
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.purchase-form-container h3::before {
    content: "🛒";
    font-size: 1.2em;
}

.purchase-form {
    max-width: 520px;
    margin: 0 auto;
}

.form-group.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-col {
    min-width: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1em;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

.optional {
    color: #6b7280;
    font-size: 0.9em;
    margin-left: 3px;
}

.email-input,
.text-input,
.select-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d7dee6;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.email-input:focus,
.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: #5f7aa0;
    box-shadow: 0 0 0 3px rgba(95, 122, 160, 0.12);
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
    font-style: italic;
}

.newsletter-signup {
    background: #fff;
    padding: 10px 0;
    border-radius: 8px;
    border: none;
}

.legal-consent {
    margin-top: 4px;
}

.legal-label {
    align-items: flex-start;
}

.legal-label a {
    color: #334e68;
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: #495057;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* Résumé de commande et bouton PayPal */
.purchase-summary {
    background: #fafbfd;
    border: 1px solid #e1e8ef;
    border-radius: 8px;
    padding: 16px;
    margin: 18px 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-line:last-child {
    border-bottom: none;
}

.summary-line.total {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    border-top: 2px solid #667eea;
    padding-top: 15px;
    margin-top: 10px;
}

.price {
    color: #27ae60;
    font-weight: bold;
}

.btn-purchase {
    width: 100%;
    background: linear-gradient(135deg, #0070ba 0%, #003087 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 112, 186, 0.3);
    background: linear-gradient(135deg, #005ea6 0%, #002973 100%);
}

.btn-purchase:active {
    transform: translateY(0);
}

.btn-purchase::before {
    content: '🔒';
    margin-right: 8px;
}

/* Section badges de confiance */
.trust-badges {
    margin-top: 25px;
    text-align: center;
}

.trust-badges h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
}

.badges-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #e8f5e8;
    color: #27ae60;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.trust-badge.security {
    background: #e3f2fd;
    color: #1976d2;
}

.trust-badge.instant {
    background: #fff3e0;
    color: #f57c00;
}

.purchase-form-container {
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    padding: 30px;
    height: fit-content;
}

.purchase-form-container h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6em;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.required {
    color: #e74c3c;
}

.email-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.help-text {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    display: block;
}

.newsletter-signup {
    margin: 25px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.purchase-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.summary-line.total {
    border-top: 2px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.1em;
}

.summary-line.savings {
    color: #27ae60;
    font-weight: 600;
    border-top: 1px solid #27ae60;
    padding-top: 10px;
    margin-top: 10px;
}

.summary-line .price.promo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.summary-line .original-price {
    font-size: 0.9em;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.summary-line .promo-price {
    color: #e74c3c;
    font-weight: bold;
}

.total-price {
    color: #2c3e50;
    font-weight: bold;
}

.savings-amount {
    color: #27ae60;
    font-weight: bold;
}

.purchase-actions {
    text-align: center;
    margin: 25px 0;
}

.paypal-buttons-container {
    max-width: 420px;
    margin: 0 auto 14px;
}

.paypal-buttons-container:empty {
    margin-bottom: 0;
}

.paypal-or-separator {
    display: flex;
    align-items: center;
    max-width: 420px;
    margin: 4px auto;
    color: #999;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 10px;
}

.paypal-or-separator::before,
.paypal-or-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.btn-purchase {
    background: linear-gradient(45deg, #0070ba, #003087);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
}

.btn-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,112,186,0.3);
}

.btn-purchase.promo-active {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    animation: promo-pulse 2s infinite;
}

.btn-purchase.promo-active:hover {
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

@keyframes promo-pulse {
    0%, 100% { 
        transform: translateY(0) scale(1); 
    }
    50% { 
        transform: translateY(-2px) scale(1.02); 
    }
}

.promo-urgency {
    margin-top: 15px;
    background: #D8A7A7;
    color: #3c1a28;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-block;
    animation: urgency-glow 2s infinite;
}

@keyframes urgency-glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(216, 167, 167, 0.3);
    }
    50% { 
        box-shadow: 0 0 20px rgba(216, 167, 167, 0.6);
    }
}

.btn-purchase:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.btn-purchase.loading .btn-text {
    display: none;
}

.btn-purchase.loading .btn-loading {
    display: inline;
}

.purchase-info {
    margin-top: 25px;
}

.purchase-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.purchase-info li {
    padding: 8px 0;
    color: #555;
    font-size: 0.9em;
    position: relative;
    padding-left: 25px;
}

.purchase-info li:before {
    content: "✓";
    color: #27ae60;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Messages */
.purchase-messages {
    margin-top: 20px;
}

.mon-ebook-success, .mon-ebook-error, .mon-ebook-info {
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

.mon-ebook-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mon-ebook-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mon-ebook-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal PayPal */
.paypal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 25px 30px 30px;
    text-align: center;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-paypal {
    background: linear-gradient(45deg, #0070ba, #003087);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-paypal:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,112,186,0.3);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .mon-ebook-container {
        margin: 10px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .mon-ebook-header {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .mon-ebook-title {
        font-size: 1.8em;
        margin-bottom: 12px;
    }
    
    .mon-ebook-description {
        font-size: 1em;
        margin-bottom: 20px;
    }
    
    .mon-ebook-price {
        font-size: 2em;
    }
    
    .ebook-cover-image {
        max-height: 300px;
    }
    
    .pdf-canvas-wrap {
        min-height: 380px;
        max-height: 640px;
        padding: 8px;
    }

    .extract-iframe-fallback {
        height: 560px;
    }

    .pdf-toolbar {
        justify-content: center;
    }

    .extract-iframe {
        height: 520px;
    }
    
    .mon-ebook-purchase {
        padding: 20px 15px;
    }

    .form-group.two-cols {
        grid-template-columns: 1fr;
    }
    
    .purchase-form {
        max-width: 100%;
    }
    
    .badges-list {
        flex-direction: column;
        align-items: center;
    }
    
    .trust-badge {
        justify-content: center;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .mon-ebook-container {
        margin: 5px;
        padding: 12px;
    }
    
    .mon-ebook-title {
        font-size: 1.5em;
    }
    
    .mon-ebook-price {
        font-size: 1.8em;
    }
    
    .pdf-canvas-wrap {
        min-height: 320px;
        max-height: 520px;
        padding: 6px;
    }

    .extract-iframe-fallback {
        height: 440px;
    }

    .extract-iframe {
        height: 400px;
    }
    
    .email-input, .btn-purchase {
        padding: 12px;
        font-size: 1em;
    }
}

/* Animations et transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mon-ebook-cover-section,
.mon-ebook-extract,
.mon-ebook-purchase {
    animation: fadeInUp 0.6s ease-out;
}

.mon-ebook-extract {
    animation-delay: 0.2s;
}

.mon-ebook-purchase {
    animation-delay: 0.4s;
}

.extract-actions {
    margin-top: 12px;
    text-align: center;
}

.btn-extract-fullscreen {
    display: inline-block;
    background: #2c3e50;
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-extract-fullscreen:hover {
    color: #fff;
    text-decoration: none;
    opacity: 0.92;
}

.summary-line.download-limit-line {
    border-top: 1px dashed #cfd8dc;
    margin-top: 8px;
    padding-top: 10px;
    color: #546e7a;
}

.download-limit-note {
    margin: 4px 0 14px;
    color: #546e7a;
    font-size: 0.9em;
    text-align: center;
}

.contact-help-box {
    margin-top: 20px;
    padding: 14px 18px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 0.9em;
    line-height: 1.6;
    color: #1f2937;
}

.contact-help-box a {
    color: #1e40af;
    text-decoration: underline;
}

.contact-help-box a:hover {
    color: #1d4ed8;
}

.paypal-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(8, 12, 20, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
}

.paypal-popup-overlay-content {
    background: #fff;
    color: #2c3e50;
    border-radius: 12px;
    padding: 22px 24px;
    max-width: 520px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.paypal-popup-overlay-content h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

body.mon-ebook-popup-active {
    overflow: hidden;
}