/**
 * Frontend Styles for Gated PDF Download Plugin
 *
 * @package GatedPdfDownload
 */

/* Popup Overlay */
.gated-pdf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

/* Prevent body scroll when popup is open */
body.gated-pdf-popup-open {
    overflow: hidden;
}

/* Popup Container */
.gated-pdf-popup-container {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: gatedPdfPopupFadeIn 0.3s ease-out;
}

@keyframes gatedPdfPopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Popup Content */
.gated-pdf-popup-content {
    padding: 0;
    position: relative;
}

/* Close Button */
.gated-pdf-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #666;
    transition: all 0.2s ease;
}

.gated-pdf-popup-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Popup Header */
.gated-pdf-popup-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.gated-pdf-popup-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.gated-pdf-popup-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Form Styles */
.gated-pdf-form {
    padding: 30px;
}

/* Form Fields */
.gated-pdf-form-fields {
    margin-bottom: 30px;
}

.gated-pdf-form-field {
    margin-bottom: 20px;
}

.gated-pdf-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.gated-pdf-form-field .required {
    color: #e74c3c;
}

.gated-pdf-form-field input,
.gated-pdf-form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.gated-pdf-form-field input:focus,
.gated-pdf-form-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.gated-pdf-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Field Error Messages */
.gated-pdf-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Form Actions */
.gated-pdf-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.gated-pdf-form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.gated-pdf-cancel-btn {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.gated-pdf-cancel-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.gated-pdf-submit-btn {
    background-color: #007cba;
    color: white;
    position: relative;
}

.gated-pdf-submit-btn:hover:not(:disabled) {
    background-color: #005a87;
}

.gated-pdf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gated-pdf-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gated-pdf-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: gatedPdfSpin 1s linear infinite;
}

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

/* Form Messages */
.gated-pdf-form-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.gated-pdf-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.gated-pdf-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Download Button Styles */
.gated-pdf-download-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007cba;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.gated-pdf-download-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.gated-pdf-download-btn:active {
    transform: translateY(0);
}

/* Error Messages */
.gated-pdf-error {
    padding: 12px 16px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gated-pdf-popup-container {
        width: 95%;
        margin: 20px;
    }

    .gated-pdf-popup-header,
    .gated-pdf-form {
        padding: 20px;
    }

    .gated-pdf-form-actions {
        flex-direction: column-reverse;
    }

    .gated-pdf-form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gated-pdf-popup-header h2 {
        font-size: 20px;
    }

    .gated-pdf-form-field input,
    .gated-pdf-form-field textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
