/**
 * Core Download Plugin - Frontend Styles
 *
 * @package Core_Download_Plugin
 */

/* Download Wrapper */
.cdp-download-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Download Button */
.cdp-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.cdp-download-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
    color: #ffffff !important;
}

.cdp-download-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.cdp-button-icon {
    display: flex;
    align-items: center;
}

.cdp-button-icon svg {
    width: 18px;
    height: 18px;
}

/* Download All Button */
.cdp-download-all-btn {
    margin-top: 15px;
}

/* Redownload Button */
.cdp-redownload-button {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.cdp-redownload-button:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

/* Already Downloaded Notice */
.cdp-already-downloaded-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    font-size: 14px;
    margin-bottom: 15px;
}

.cdp-already-downloaded-notice .cdp-check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #28a745;
}

.cdp-already-downloaded-notice .cdp-check-icon svg {
    width: 16px;
    height: 16px;
}

/* Expired Notice */
.cdp-expired-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.cdp-expired-notice .cdp-warning-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    color: #856404;
}

.cdp-expired-notice .cdp-warning-icon svg {
    width: 16px;
    height: 16px;
}

/* Download Count */
.cdp-download-count {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* Login Required */
.cdp-login-required {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.cdp-login-required p {
    margin: 0 0 15px;
    color: #555;
}

.cdp-login-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 500;
}

.cdp-login-link:hover {
    background-color: #005a87;
}

/* Lead Capture Form */
.cdp-lead-form-wrapper {
    max-width: 400px;
    padding: 25px;
    background-color: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* File Preview */
.cdp-file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cdp-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: #e9ecef;
    border-radius: 6px;
    color: #495057;
}

.cdp-file-icon svg {
    width: 24px;
    height: 24px;
}

.cdp-file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cdp-file-preview .cdp-file-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.cdp-file-preview .cdp-file-size {
    font-size: 12px;
    color: #888;
}

/* Form */
.cdp-lead-form {
    margin: 0;
}

.cdp-form-intro {
    margin: 0 0 20px;
    color: #555;
    font-size: 14px;
}

.cdp-form-field {
    margin-bottom: 16px;
}

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

.cdp-form-field .required {
    color: #dc3545;
}

.cdp-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.cdp-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.cdp-input:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

/* Consent Checkbox */
.cdp-consent-field {
    margin-top: 20px;
}

.cdp-consent-field label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    cursor: pointer;
}

.cdp-consent-field input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Submit Button */
.cdp-submit-button {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.cdp-submit-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6e 100%);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

.cdp-submit-button:active {
    transform: translateY(1px);
}

.cdp-submit-button:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

/* Form Messages */
.cdp-form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
}

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

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

/* Loading State */
.cdp-lead-form.loading .cdp-submit-button {
    position: relative;
    color: transparent;
}

.cdp-lead-form.loading .cdp-submit-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cdp-spin 0.8s linear infinite;
}

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

/* Download Success State */
.cdp-download-ready {
    text-align: center;
    padding: 20px;
}

.cdp-download-ready .cdp-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #d4edda;
    border-radius: 50%;
    margin-bottom: 15px;
    color: #28a745;
}

.cdp-download-ready .cdp-success-icon svg {
    width: 30px;
    height: 30px;
}

.cdp-download-ready p {
    margin: 0 0 20px;
    color: #155724;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
    .cdp-lead-form-wrapper {
        padding: 20px;
    }

    .cdp-download-button {
        width: 100%;
        justify-content: center;
    }

    .cdp-file-preview {
        flex-direction: column;
        text-align: center;
    }

    .cdp-expired-notice,
    .cdp-already-downloaded-notice {
        font-size: 13px;
        padding: 10px 12px;
    }
}
