/**
 * Download Leads Frontend Popup Styles - v3
 * Compact, Clean, Simple
 * 
 * @package Wanderer Blog
 */

/* Popup Overlay */
.dl-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.dl-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.dl-popup-open {
    overflow: hidden;
}

/* Popup Container */
.dl-popup-container {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

.dl-popup-overlay.active .dl-popup-container {
    transform: translateY(0) scale(1);
}

/* Close Button */
.dl-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-popup-close:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Popup Header */
.dl-popup-header {
    text-align: center;
    padding: 20px 20px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.dl-popup-icon {
    width: 48px;
    height: 48px;
    background: #ecfdf5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #059669;
}

.dl-popup-icon svg {
    width: 24px;
    height: 24px;
}

.dl-popup-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.dl-popup-doc-title {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    padding: 4px 10px;
    background: #f8fafc;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Form */
.dl-popup-form {
    padding: 16px 20px 20px;
}

.dl-form-intro {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 14px;
    text-align: center;
}

.dl-form-group {
    margin-bottom: 12px;
}

.dl-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.dl-form-group label .required {
    color: #ef4444;
}

.dl-form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    transition: all 0.15s ease;
    background: #fff;
    box-sizing: border-box;
}

.dl-form-group input:focus {
    outline: none;
    border-color: #25805b;
    box-shadow: 0 0 0 3px rgba(37, 128, 91, 0.1);
}

.dl-form-group input::placeholder {
    color: #a1a1aa;
}

/* Error State */
.dl-form-group.has-error input {
    border-color: #ef4444;
    background: #fef2f2;
}

.dl-error-msg {
    display: block;
    font-size: 11px;
    color: #ef4444;
    margin-top: 3px;
}

.dl-error-msg:empty {
    display: none;
}

/* Form Actions */
.dl-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.dl-btn-cancel,
.dl-btn-submit {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.dl-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.dl-btn-cancel:hover {
    background: #e2e8f0;
}

.dl-btn-submit {
    background: #25805b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.dl-btn-submit:hover:not(:disabled) {
    background: #1f6f4a;
}

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

.dl-btn-loading {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dl-spinner {
    animation: dl-spin 0.7s linear infinite;
}

@keyframes dl-spin {
    to { transform: rotate(360deg); }
}

/* Privacy Note */
.dl-form-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    color: #94a3b8;
    margin: 14px 0 0;
}

.dl-form-privacy svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* ==================== */
/* SUCCESS VIEW - SIMPLE */
/* ==================== */
.dl-success {
    padding: 28px 24px;
    text-align: center;
}

.dl-success-icon {
    width: 52px;
    height: 52px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #059669;
}

.dl-success-icon svg {
    width: 26px;
    height: 26px;
}

.dl-success h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.dl-success-msg {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 18px;
    line-height: 1.5;
}

.dl-success-msg strong {
    color: #1e293b;
    font-weight: 600;
}

.dl-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    background: #25805b;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.dl-btn-download:hover {
    background: #1f6f4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 128, 91, 0.25);
    color: white !important;
}

.dl-btn-download svg {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .dl-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .dl-popup-container {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 14px 14px 0 0;
    }
    
    .dl-form-actions {
        flex-direction: column-reverse;
        gap: 6px;
    }
    
    .dl-btn-cancel,
    .dl-btn-submit {
        width: 100%;
    }
}

/* Form shake animation on error */
@keyframes dl-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.dl-form-group.has-error {
    animation: dl-shake 0.3s ease;
}
