/**
 * Frontend styles for Custom Fields PF
 */

/* Form Container */
.cfpf-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form Title */
.cfpf-form-title {
    text-align: center;
    color: #0073aa;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
}

/* Progress Section */
.cfpf-progress-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.cfpf-progress-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

/* Message Styles */
.cfpf-error,
.cfpf-success,
.cfpf-info {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
}

.cfpf-error {
    background: #ffeaea;
    border-left-color: #dc3232;
    color: #dc3232;
}

.cfpf-success {
    background: #eafaea;
    border-left-color: #46b450;
    color: #46b450;
}

.cfpf-info {
    background: #e5f5ff;
    border-left-color: #0073aa;
    color: #0073aa;
}

/* Category Sections */
.cfpf-category-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.cfpf-category-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cfpf-category-title {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
    font-size: 20px;
    font-weight: 600;
}

.cfpf-category-description {
    margin: 0 0 20px 0;
    color: #666;
    font-style: italic;
    line-height: 1.6;
}

/* Fields Layout */
.cfpf-fields-group {
    display: grid;
    gap: 20px;
}

.cfpf-field-wrapper {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.cfpf-field-wrapper:hover {
    background: #f5f5f5;
    border-color: #0073aa;
}

.cfpf-field-wrapper:focus-within {
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Field Labels */
.cfpf-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.cfpf-field-label.required::after {
    content: ' *';
    color: #dc3232;
    font-weight: bold;
}

/* Input Styles */
.cfpf-field-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
    background: #fff;
}

.cfpf-field-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.cfpf-field-input:invalid {
    border-color: #dc3232;
}

/* Radio and Checkbox Groups */
.cfpf-radio-group,
.cfpf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cfpf-radio-option,
.cfpf-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cfpf-radio-option:hover,
.cfpf-checkbox-option:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.cfpf-radio-option input,
.cfpf-checkbox-option input {
    margin: 0;
    cursor: pointer;
}

.cfpf-radio-option input:checked+label,
.cfpf-checkbox-option input:checked+label {
    font-weight: 600;
    color: #0073aa;
}

/* Info Message */
.cfpf-info-message {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 20px;
    color: #0073aa;
    line-height: 1.6;
}

.cfpf-info-message h3,
.cfpf-info-message h4 {
    margin-top: 0;
    color: #0073aa;
}

.cfpf-info-message p:last-child {
    margin-bottom: 0;
}

/* File Upload */
.cfpf-file-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.cfpf-file-upload:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.cfpf-file-upload.dragover {
    border-color: #46b450;
    background: #f0fff0;
}

.cfpf-file-upload p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.cfpf-file-upload input[type="file"] {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.cfpf-current-file {
    margin-top: 15px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
}

.cfpf-current-file strong {
    color: #333;
}

.cfpf-current-file a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.cfpf-current-file a:hover {
    text-decoration: underline;
}

/* Form Actions */
.cfpf-form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.cfpf-submit-button {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cfpf-submit-button:hover {
    background: linear-gradient(135deg, #005a87, #004a73);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

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

.cfpf-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Widget */
.cfpf-progress-widget {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 250px;
    font-size: 12px;
}

.cfpf-progress-widget h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #0073aa;
    font-weight: 600;
}

.cfpf-progress-widget .progress-bar {
    background: #f1f1f1;
    border-radius: 10px;
    height: 16px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.cfpf-progress-widget .progress-fill {
    background: linear-gradient(90deg, #46b450, #5cbf60);
    height: 100%;
    transition: width 0.3s ease;
}

.cfpf-progress-widget .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: #333;
}

.cfpf-progress-widget .progress-details {
    color: #666;
    font-size: 11px;
}

/* Loading States */
.cfpf-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Validation States */
.cfpf-field-wrapper.error {
    border-color: #dc3232;
    background: #ffeaea;
}

.cfpf-field-wrapper.success {
    border-color: #46b450;
    background: #eafaea;
}

.cfpf-field-error {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cfpf-form-container {
        padding: 15px;
    }

    .cfpf-category-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .cfpf-category-title {
        font-size: 18px;
    }

    .cfpf-field-wrapper {
        padding: 15px;
    }

    .cfpf-radio-group,
    .cfpf-checkbox-group {
        gap: 10px;
    }

    .cfpf-submit-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .cfpf-progress-widget {
        display: none;
    }

    .cfpf-file-upload {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .cfpf-form-container {
        padding: 10px;
    }

    .cfpf-category-section {
        padding: 15px;
    }

    .cfpf-field-wrapper {
        padding: 12px;
    }

    .cfpf-radio-option,
    .cfpf-checkbox-option {
        padding: 6px 10px;
    }
}