/**
 * TS PDF Email Capture Popup Styles
 * 
 * Stili per il popup di cattura email per download PDF
 * Design coerente con tuttosemplice-search-popup
 */

/* Overlay */
#ts-pdf-email-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#ts-pdf-email-overlay.ts-popup-show {
    opacity: 1;
}

/* Modal Popup */
.ts-pdf-email-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: var(--wp--preset--color--white, white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    max-width: 90%;
    width: 450px;
    box-sizing: border-box;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ts-pdf-email-popup.ts-popup-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.ts-pdf-email-popup .ts-popup-header {
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #CF2E2E), #a72525);
    color: var(--wp--preset--color--white, white);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ts-pdf-email-popup .ts-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wp--preset--color--white, white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-pdf-email-popup .ts-pdf-icon {
    font-size: 22px;
}

.ts-pdf-email-popup .ts-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: var(--wp--preset--color--white, white);
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    opacity: 0.9;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.ts-pdf-email-popup .ts-popup-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

/* Content */
.ts-pdf-email-popup .ts-popup-content {
    padding: 28px;
}

.ts-pdf-email-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--wp--preset--color--contrast, #333);
    margin: 0 0 24px 0;
    text-align: center;
}

/* Form */
.ts-pdf-email-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ts-pdf-email-row {
    display: flex;
    gap: 12px;
}

.ts-pdf-email-row input {
    flex: 1;
}

.ts-pdf-email-form input[type="text"],
.ts-pdf-email-form input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.ts-pdf-email-form input[type="text"]:focus,
.ts-pdf-email-form input[type="email"]:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, #CF2E2E);
    box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.15);
}

.ts-pdf-email-form input::placeholder {
    color: #999;
}

/* Submit Button */
.ts-pdf-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #CF2E2E), #a72525);
    color: var(--wp--preset--color--white, white);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 6px 0 0 0;
    /* Reset margin-left to align with inputs */
    box-sizing: border-box;
}

.ts-pdf-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(207, 46, 46, 0.4);
}

.ts-pdf-submit-btn:active {
    transform: translateY(0);
}

.ts-pdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Privacy Note */
.ts-pdf-email-privacy {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin: 8px 0 0 0;
}

.ts-pdf-email-privacy a {
    color: var(--wp--preset--color--primary, #CF2E2E);
    text-decoration: underline;
}

.ts-pdf-email-privacy a:hover {
    text-decoration: none;
}

/* Success State */
.ts-pdf-email-success {
    text-align: center;
    padding: 20px 0;
}

.ts-pdf-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ts-pdf-email-success h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--wp--preset--color--contrast, #333);
    margin: 0 0 10px 0;
}

.ts-pdf-email-success p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* Error State */
.ts-pdf-email-error {
    background-color: #FFF0F0;
    border: 1px solid #FF6B6B;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 16px;
}

.ts-pdf-email-error p {
    font-size: 14px;
    color: #CC0000;
    margin: 0;
    text-align: center;
}

/* Shake Animation for Errors */
@keyframes ts-shake {

    0%,
    100% {
        transform: translate(-50%, -50%) translateX(0);
    }

    20%,
    60% {
        transform: translate(-50%, -50%) translateX(-10px);
    }

    40%,
    80% {
        transform: translate(-50%, -50%) translateX(10px);
    }
}

.ts-pdf-email-popup.ts-shake {
    animation: ts-shake 0.5s ease;
}

/* Responsive */
@media (max-width: 500px) {
    .ts-pdf-email-popup {
        width: 95%;
        max-width: none;
    }

    .ts-pdf-email-popup .ts-popup-content {
        padding: 22px 18px;
    }

    .ts-pdf-email-popup .ts-popup-header {
        padding: 15px 18px;
    }

    .ts-pdf-email-popup .ts-popup-header h3 {
        font-size: 16px;
    }

    .ts-pdf-email-row {
        flex-direction: column;
        gap: 14px;
    }

    .ts-pdf-email-form input[type="text"],
    .ts-pdf-email-form input[type="email"] {
        padding: 13px 14px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .ts-pdf-submit-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Dark mode support - Disabilitato per mantenere sfondo bianco */
/* Il popup mantiene sempre sfondo bianco per coerenza visiva */

/* Honeypot field (hidden) */
.ts-hp-group {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}