/**
 * Fresh PDF Download Plugin - Frontend Styles
 */

.fresh-pdf-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    max-width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.fresh-pdf-container:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.fresh-pdf-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 24px;
}

.fresh-pdf-icon {
    color: #0073aa;
    margin-right: 16px;
    margin-top: 4px;
    flex-shrink: 0;
}

.fresh-pdf-info {
    flex: 1;
}

.fresh-pdf-title {
    margin: 0 0 8px 0;
    color: #0073aa;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.fresh-pdf-description {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.fresh-pdf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.fresh-pdf-meta span {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.fresh-pdf-meta svg {
    margin-right: 6px;
    color: #0073aa;
}

.fresh-pdf-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.fresh-pdf-form-group {
    margin-bottom: 20px;
}

.fresh-pdf-form-group:last-child {
    margin-bottom: 0;
}

.fresh-pdf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.fresh-pdf-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.fresh-pdf-form-group input[type="email"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.fresh-pdf-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

.fresh-pdf-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6e 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.fresh-pdf-btn:active {
    transform: translateY(0);
}

.fresh-pdf-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fresh-pdf-btn .btn-icon {
    display: flex;
    align-items: center;
}

.fresh-pdf-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fresh-pdf-btn-direct {
    background: linear-gradient(135deg, #28a745 0%, #20a040 100%);
}

.fresh-pdf-btn-direct:hover {
    background: linear-gradient(135deg, #20a040 0%, #1e8e3a 100%);
}

.fresh-pdf-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fresh-pdf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fresh-pdf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fresh-pdf-direct {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

/* Form row layout for side-by-side fields */
.fresh-pdf-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.fresh-pdf-form-group.fresh-pdf-half {
    flex: 1;
    margin-bottom: 0;
}

.fresh-pdf-form-group label .required {
    color: #dc3232;
    font-weight: bold;
}

.fresh-pdf-form-group input[type="text"],
.fresh-pdf-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.fresh-pdf-form-group input[type="text"]:focus,
.fresh-pdf-form-group input[type="email"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.fresh-pdf-form-group input:invalid {
    border-color: #dc3232;
}

.fresh-pdf-form-group input:invalid:focus {
    border-color: #dc3232;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

/* =================================================================
   CAPTCHA STYLES
   ================================================================= */

.fresh-pdf-captcha-group {
    margin: 20px 0;
    text-align: center;
}

.fresh-pdf-captcha-container {
    display: inline-block;
    margin: 0 auto;
}

.fresh-pdf-captcha-container .g-recaptcha {
    margin: 0 auto;
    display: inline-block;
}

.captcha-error {
    color: #d63384;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
    display: none;
}

/* reCAPTCHA v3 - No additional styling needed as it's invisible */

/* reCAPTCHA v2 responsiveness */
@media (max-width: 768px) {
    .fresh-pdf-captcha-container .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
    }
}

@media (max-width: 480px) {
    .fresh-pdf-captcha-container .g-recaptcha {
        transform: scale(0.75);
        transform-origin: center;
    }
}

/* CAPTCHA loading state */
.fresh-pdf-captcha-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fresh-pdf-container {
        padding: 20px;
        margin: 24px 0;
    }
    
    .fresh-pdf-header {
        flex-direction: column;
        text-align: center;
    }
    
    .fresh-pdf-icon {
        margin: 0 0 12px 0;
        align-self: center;
    }
    
    .fresh-pdf-meta {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .fresh-pdf-form {
        padding: 16px;
    }
    
    .fresh-pdf-form-group input[type="email"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .fresh-pdf-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Responsive design for form rows */
@media (max-width: 768px) {
    .fresh-pdf-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .fresh-pdf-form-group.fresh-pdf-half {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .fresh-pdf-container {
        padding: 16px;
        margin: 20px 0;
        border-radius: 8px;
    }
    
    .fresh-pdf-title {
        font-size: 18px;
    }
    
    .fresh-pdf-description {
        font-size: 15px;
    }
    
    .fresh-pdf-meta {
        padding: 10px;
    }
    
    .fresh-pdf-form {
        padding: 12px;
    }
    
    .fresh-pdf-form-row {
        gap: 4px;
    }
    
    .fresh-pdf-form-group.fresh-pdf-half {
        margin-bottom: 12px;
    }
    
    .fresh-pdf-form-group input[type="text"],
    .fresh-pdf-form-group input[type="email"] {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .fresh-pdf-container {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .fresh-pdf-title {
        color: #3498db;
    }
    
    .fresh-pdf-description {
        color: #bdc3c7;
    }
    
    .fresh-pdf-meta {
        background: #34495e;
        border-left-color: #3498db;
        color: #ecf0f1;
    }
    
    .fresh-pdf-form {
        background: #34495e;
        border-color: #495057;
    }
    
    .fresh-pdf-form-group input[type="email"] {
        background: #2c3e50;
        border-color: #495057;
        color: #ecf0f1;
    }
    
    .fresh-pdf-form-group input[type="email"]:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    }
    
    .fresh-pdf-direct {
        background: #34495e;
        border-color: #495057;
    }
}

/* Print styles */
@media print {
    .fresh-pdf-container {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .fresh-pdf-form,
    .fresh-pdf-direct {
        display: none;
    }
    
    .fresh-pdf-meta::after {
        content: " (PDF download available online)";
        font-style: italic;
        color: #666;
    }
}
