/* PDR Frontend Styles - Compact Version */

.pdr-download-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pdr-download-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* ============================================
   DOWNLOAD BUTTON STYLES
   ============================================ */
.pdr-download-section .wp-block-button__link,
.pdr-download-section .wp-element-button,
.pdr-download-section .wp-block-button .wp-block-button__link {
    background: #0073aa !important;
    color: #ffffff !important;
    border: 2px solid #0073aa !important;
    padding: 10px 24px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
}

.pdr-download-section .wp-block-button__link:hover,
.pdr-download-section .wp-element-button:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.35) !important;
    transform: translateY(-2px) !important;
}

.pdr-download-section .wp-block-button__link:focus,
.pdr-download-section .wp-element-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.4) !important;
}

/* ============================================
   MODAL STYLES - Compact
   ============================================ */
.pdr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pdr-modal {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pdrModalFadeIn 0.3s ease;
    margin: auto;
}

@keyframes pdrModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   MODAL HEADER - Compact
   ============================================ */
.pdr-modal-header {
    padding: 14px 20px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #ffffff;
    border-radius: 10px 10px 0 0;
    z-index: 2;
}

.pdr-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e1e2a;
    flex: 1;
}

.pdr-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.pdr-modal-close:hover {
    background: #f1f3f5;
    color: #000;
}

/* ============================================
   MODAL BODY - Compact
   ============================================ */
.pdr-modal-body {
    padding: 16px 20px 20px;
}

/* ============================================
   FORM STYLES - Compact
   ============================================ */
#pdr-download-form .pdr-form-group {
    margin-bottom: 10px;
}

#pdr-download-form label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    font-size: 0.82rem;
    color: #1e1e2a;
}

#pdr-download-form .pdr-required {
    color: #dc3545;
    margin-left: 2px;
}

#pdr-download-form input,
#pdr-download-form textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

#pdr-download-form input:focus,
#pdr-download-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#pdr-download-form textarea {
    resize: vertical;
    min-height: 44px;
    max-height: 60px;
}

/* Mobile Input with Country Code - Compact */
.pdr-mobile-input-wrapper {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.pdr-country-code {
    width: 80px;
    min-width: 70px;
    padding: 7px 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.pdr-country-code:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.pdr-mobile-input {
    flex: 1;
}

/* REMOVED: .pdr-field-note - No longer needed */

/* Form Actions - Compact */
.pdr-form-actions {
    margin-top: 14px;
}

.pdr-submit-button {
    width: 100%;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pdr-submit-button:hover {
    background: #005a87;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

.pdr-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   SUCCESS MESSAGE - Compact
   ============================================ */
#pdr-success-message {
    text-align: center;
    padding: 15px 10px;
}

#pdr-success-message p {
    font-size: 1rem;
    color: #28a745;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.pdr-success-close-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.pdr-success-close-button {
    padding: 10px 36px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 120px;
}

.pdr-success-close-button:hover {
    background: #005a87;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

/* ============================================
   ERROR MESSAGES - Compact
   ============================================ */
.pdr-form-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 2px;
    display: block;
}

.pdr-form-group.has-error input,
.pdr-form-group.has-error textarea,
.pdr-form-group.has-error .pdr-country-code,
.pdr-form-group.has-error .pdr-mobile-input {
    border-color: #dc3545;
}

.pdr-global-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid #f5c6cb;
    font-size: 0.85rem;
}

/* ============================================
   LOADING SPINNER - Compact
   ============================================ */
.pdr-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: pdrSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes pdrSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {
    .pdr-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .pdr-modal-header {
        padding: 12px 16px 10px;
    }

    .pdr-modal-header h2 {
        font-size: 1rem;
    }

    .pdr-modal-body {
        padding: 14px 16px 16px;
    }

    #pdr-download-form .pdr-form-group {
        margin-bottom: 10px;
    }

    #pdr-download-form input,
    #pdr-download-form textarea {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    #pdr-download-form textarea {
        min-height: 44px;
        max-height: 60px;
    }

    .pdr-mobile-input-wrapper {
        flex-wrap: wrap;
    }

    .pdr-country-code {
        width: 100%;
        min-width: unset;
    }

    .pdr-submit-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .pdr-success-close-button {
        padding: 10px 30px;
        font-size: 0.9rem;
        min-width: 100px;
    }

    .pdr-download-section .wp-block-button__link,
    .pdr-download-section .wp-element-button {
        width: 100% !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .pdr-modal {
        max-height: 98vh;
    }

    .pdr-modal-body {
        padding: 12px 14px 14px;
    }

    #pdr-download-form .pdr-form-group {
        margin-bottom: 8px;
    }

    #pdr-download-form label {
        font-size: 0.8rem;
    }

    #pdr-download-form input,
    #pdr-download-form textarea {
        font-size: 0.85rem;
        padding: 6px 8px;
    }

    #pdr-download-form textarea {
        min-height: 40px;
        max-height: 50px;
    }

    .pdr-submit-button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .pdr-success-close-button {
        padding: 8px 24px;
        font-size: 0.85rem;
        min-width: 80px;
    }

    #pdr-success-message p {
        font-size: 0.9rem;
    }

    .pdr-modal-header h2 {
        font-size: 0.9rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.pdr-modal-close:focus-visible,
.pdr-success-close-button:focus-visible,
.pdr-submit-button:focus-visible,
#pdr-download-form input:focus-visible,
#pdr-download-form textarea:focus-visible,
.pdr-country-code:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Scrollbar styling */
.pdr-modal::-webkit-scrollbar {
    width: 4px;
}

.pdr-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 10px 10px 0;
}

.pdr-modal::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 2px;
}

.pdr-modal::-webkit-scrollbar-thumb:hover {
    background: #a8b0b8;
}