/**
 * PDF Download Manager Pro - Frontend Styles
 * Created by Ruben Garcia Jr - BixBit PDF Download
 */

/* Popup Overlay */
.pdm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
}

/* Popup Container */
.pdm-popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Close Button */
.pdm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.pdm-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* Content Area */
.pdm-popup-content {
    padding: 40px 30px 30px;
}

/* Header */
.pdm-popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.pdm-popup-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.pdm-popup-subtitle {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

/* Form Layout */
.pdm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

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

.pdm-form-row .pdm-form-group {
    margin-bottom: 0;
}

/* Labels */
.pdm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Inputs */
.pdm-form-group input[type="text"],
.pdm-form-group input[type="email"],
.pdm-form-group input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.pdm-form-group input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.pdm-form-group input.pdm-error {
    border-color: #dc3545;
}

/* Consent */
.pdm-consent-group {
    margin: 20px 0;
}

.pdm-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.pdm-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
}

/* Submit Button */
.pdm-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pdm-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

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

.pdm-btn-loading {
    display: none;
}

/* Messages */
.pdm-form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.pdm-form-message.error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.pdm-form-message.success {
    background-color: #efe;
    color: #3a7;
    border: 1px solid #cfc;
}

/* Success Message */
.pdm-success-message {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.pdm-success-message h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

/* ============================================
   Download Button Base (Shortcode Output)
   ============================================ */
.pdm-trigger,
.pdm-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: Inter, sans-serif;
    font-size: 17.8px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    gap: 8px;
}

/* Default style (gradient) — backward compatible */
.pdm-trigger:not(.pdm-btn-filled):not(.pdm-btn-outline),
.pdm-download-btn:not(.pdm-btn-filled):not(.pdm-btn-outline) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
}

.pdm-trigger:not(.pdm-btn-filled):not(.pdm-btn-outline):hover,
.pdm-download-btn:not(.pdm-btn-filled):not(.pdm-btn-outline):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

/* ============================================
   Variant: Filled — All Black + White Text
   Usage: class="pdm-btn-filled" or variant="filled"
   ============================================ */
.pdm-btn-filled {
    background-color: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #111827 !important;
}

.pdm-btn-filled:hover {
    background-color: #1f2937 !important;
    border-color: #1f2937 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.4);
}

/* ============================================
   Variant: Outline — White Border + Transparent
   Usage: class="pdm-btn-outline" or variant="outline"
   Best on dark/colored backgrounds
   ============================================ */
.pdm-btn-outline {
    background-color: transparent !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

.pdm-btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Outline on light backgrounds — auto-invert */
.pdm-btn-outline--dark {
    background-color: transparent !important;
    color: #111827 !important;
    border: 1px solid #111827 !important;
}

.pdm-btn-outline--dark:hover {
    background-color: #111827 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.3);
}

/* Body Lock When Popup Open */
body.pdm-popup-open {
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .pdm-popup-container {
        width: 95%;
        max-height: 95vh;
    }

    .pdm-popup-content {
        padding: 30px 20px 20px;
    }

    .pdm-form-row {
        grid-template-columns: 1fr;
    }

    .pdm-form-row .pdm-form-group {
        margin-bottom: 15px;
    }
}
