/* 
User Submitted Posts Custom Styling for RowFuel Theme
Matches the RowFuel design system with consistent colors, fonts, and spacing
*/

/* Main Form Container */
div#user-submitted-posts {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--rowfuel-light-padding);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Container Wrapper */
.usp-form-container {
    margin: 40px 0;
    padding: 0;
}

.usp-form-container div#user-submitted-posts {
    margin: 0 auto;
}

/* Integration with RowFuel page styles */
.page-item .usp-form-container {
    margin-top: 30px;
}

/* Ensure proper spacing when form is the main content */
.page-item:has(.usp-form-container) {
    padding-bottom: 20px;
}

div#user-submitted-posts form {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Form Fieldsets */
div#user-submitted-posts fieldset {
    box-sizing: border-box;
    margin: 0 0 25px 0;
    padding: 0;
    border: none;
    position: relative;
}

/* Form Labels */
div#user-submitted-posts fieldset label {
    display: block;
    width: 100%;
    margin: 0 0 8px 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--rowfuel-deep-blue);
    line-height: 1.4;
}

/* Form Inputs */
div#user-submitted-posts fieldset input.usp-input,
div#user-submitted-posts fieldset input[type="text"],
div#user-submitted-posts fieldset input[type="email"],
div#user-submitted-posts fieldset input[type="url"],
div#user-submitted-posts fieldset input[type="file"] {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 15px;
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

div#user-submitted-posts fieldset input.usp-input:focus,
div#user-submitted-posts fieldset input[type="text"]:focus,
div#user-submitted-posts fieldset input[type="email"]:focus,
div#user-submitted-posts fieldset input[type="url"]:focus,
div#user-submitted-posts fieldset input[type="file"]:focus {
    outline: none;
    border-color: var(--rowfuel-light-blue);
    box-shadow: 0 0 0 3px rgba(42, 146, 211, 0.1);
}

/* Textarea */
div#user-submitted-posts textarea.usp-textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 15px;
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

div#user-submitted-posts textarea.usp-textarea:focus {
    outline: none;
    border-color: var(--rowfuel-light-blue);
    box-shadow: 0 0 0 3px rgba(42, 146, 211, 0.1);
}

/* Select Dropdowns */
div#user-submitted-posts select {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 15px;
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

div#user-submitted-posts select:focus {
    outline: none;
    border-color: var(--rowfuel-light-blue);
    box-shadow: 0 0 0 3px rgba(42, 146, 211, 0.1);
}

div#user-submitted-posts select.usp-multiple {
    min-height: 80px;
}

/* Category Indentation */
div#user-submitted-posts .usp-cat-child { text-indent: 20px; }
div#user-submitted-posts .usp-cat-grand { text-indent: 40px; }
div#user-submitted-posts .usp-cat-great { text-indent: 60px; }
div#user-submitted-posts .usp-cat-great-great { text-indent: 80px; }

/* Rich Text Editor */
div#user-submitted-posts div.usp_text-editor {
    margin: 15px 0 0 0;
}

div#user-submitted-posts div.wp-editor-container {
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    overflow: hidden;
}

div#user-submitted-posts div.wp-editor-tools {
    background-color: var(--rowfuel-gray2);
    border-bottom: 1px solid var(--rowfuel-gray3);
}

div#user-submitted-post .wp-editor-tabs {
    padding: 10px;
}

div#user-submitted-post .wp-switch-editor {
    background-color: transparent;
    border: 1px solid var(--rowfuel-gray3);
    border-radius: 4px;
    padding: 5px 10px;
    margin-right: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--rowfuel-gray1);
    cursor: pointer;
    transition: all 0.3s ease;
}

div#user-submitted-post .wp-switch-editor:hover,
div#user-submitted-post .wp-switch-editor:focus {
    background-color: var(--rowfuel-light-blue);
    color: #ffffff;
    border-color: var(--rowfuel-light-blue);
}

div#user-submitted-post .wp-switch-editor.active-switcher {
    background-color: var(--rowfuel-light-blue);
    color: #ffffff;
    border-color: var(--rowfuel-light-blue);
}

/* File Upload Section */
div#user-submitted-posts fieldset.usp-images {
    margin: 30px 0;
    padding: 20px;
    background-color: var(--rowfuel-gray2);
    border-radius: 6px;
    border: 2px dashed var(--rowfuel-gray3);
}

div#user-submitted-posts div#usp-upload-message {
    font-size: 14px;
    color: var(--rowfuel-gray1);
    margin-bottom: 15px;
    line-height: 1.5;
}

div#user-submitted-posts fieldset input.usp-input.usp-clone {
    margin: 10px 0 0 0;
    font-size: 14px;
    padding: 10px 12px;
}

div#user-submitted-posts a#usp_add-another {
    display: inline-block;
    clear: both;
    margin: 15px 0 0 0;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: var(--rowfuel-light-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

div#user-submitted-posts a#usp_add-another:hover {
    color: var(--rowfuel-deep-blue);
    text-decoration: underline;
}

/* Submit Button */
div#user-submitted-posts div#usp-submit {
    margin: 30px 0 0 0;
    text-align: center;
}

div#user-submitted-posts input[type="submit"].usp-submit {
    background: var(--rowfuel-light-blue);
    color: #ffffff;
    padding: 15px 40px;
    border: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

div#user-submitted-posts input[type="submit"].usp-submit:hover {
    background: var(--rowfuel-yellow);
    color: var(--rowfuel-deep-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

div#user-submitted-posts input[type="submit"].usp-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Error and Success Messages */
div#user-submitted-posts div.usp-error {
    color: #d32f2f;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    margin: 10px 0;
    padding: 10px 15px;
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
}

div#user-submitted-posts div#usp-error-message {
    margin: 0 0 25px 0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

div#user-submitted-posts div#usp-error-message.usp-callout-failure {
    color: #d32f2f;
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
}

div#user-submitted-posts div#usp-success-message {
    margin: 0 0 25px 0;
    padding: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #2e7d32;
    background-color: #e8f5e8;
    border-left: 4px solid #2e7d32;
    border-radius: 6px;
}

/* Checkbox Fields */
div#user-submitted-posts fieldset.usp-checkbox {
    padding: 15px 0;
    margin: 20px 0;
    background-color: var(--rowfuel-gray2);
    border-radius: 6px;
    padding: 15px;
}

div#user-submitted-posts fieldset.usp-checkbox input {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -2px;
    margin-right: 8px;
    width: auto;
}

div#user-submitted-posts fieldset.usp-checkbox label {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    color: var(--rowfuel-deep-blue);
}

/* Hidden Elements */
.usp-hidden, .usp-no-js { display: none; }
.usp-js { display: block; }

/* Validation Errors (Parsley) */
div#user-submitted-posts ul.parsley-errors-list {
    display: none;
    list-style-type: none;
    margin: 5px 0 0 0;
    padding: 0;
}

div#user-submitted-posts ul.parsley-errors-list.filled {
    display: block;
    float: none;
    clear: both;
    margin: 5px 0 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.4;
}

div#user-submitted-posts ul.parsley-errors-list.filled li.parsley-required,
div#user-submitted-posts ul.parsley-errors-list.filled li.parsley-type {
    display: block;
    margin: 0 0 5px 0;
    padding: 8px 12px;
    color: #ffffff;
    background-color: #d32f2f;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
}

/* Chosen Select Plugin Customization */
div#user-submitted-posts .chosen-container[style] {
    box-sizing: border-box;
    display: block;
    float: none;
    clear: both;
    width: 100% !important;
    margin: 0;
}

div#user-submitted-posts .chosen-container .chosen-results {
    color: #333;
    font-family: 'Poppins', sans-serif;
}

div#user-submitted-posts .chosen-container-single .chosen-single {
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: none;
    padding: 12px 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    height: auto;
}

div#user-submitted-posts .chosen-container-single .chosen-single:focus,
div#user-submitted-posts .chosen-container-single.chosen-container-active .chosen-single {
    border-color: var(--rowfuel-light-blue);
    box-shadow: 0 0 0 3px rgba(42, 146, 211, 0.1);
}

div#user-submitted-posts .chosen-container-multi .chosen-choices {
    border: 2px solid var(--rowfuel-gray3);
    border-radius: 6px;
    background: #ffffff;
    padding: 8px 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

div#user-submitted-posts .chosen-container-multi.chosen-container-active .chosen-choices {
    border-color: var(--rowfuel-light-blue);
    box-shadow: 0 0 0 3px rgba(42, 146, 211, 0.1);
}

div#user-submitted-posts .chosen-container-multi .chosen-choices li.search-choice {
    background: var(--rowfuel-light-blue);
    border: none;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 3px 5px 3px 0;
}

div#user-submitted-posts .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
    color: #ffffff;
    text-decoration: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

div#user-submitted-posts .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
    color: var(--rowfuel-yellow);
}

/* reCAPTCHA Styling */
div#user-submitted-posts fieldset.usp-recaptcha {
    margin: 25px 0;
}

div#user-submitted-posts .g-recaptcha {
    border-radius: 6px;
    overflow: hidden;
}

/* Cloudflare Turnstile Styling */
div#user-submitted-posts .cf-turnstile {
    margin: 15px 0;
    border-radius: 6px;
    overflow: hidden;
}

/* Placeholder Styling */
div#user-submitted-posts input::placeholder,
div#user-submitted-posts textarea::placeholder {
    color: var(--rowfuel-gray1);
    font-style: italic;
    opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    div#user-submitted-posts {
        padding: var(--rowfuel-mobile-padding);
        margin: 0 10px;
    }
    
    div#user-submitted-posts fieldset {
        margin-bottom: 20px;
    }
    
    div#user-submitted-posts fieldset label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    div#user-submitted-posts fieldset input.usp-input,
    div#user-submitted-posts fieldset input[type="text"],
    div#user-submitted-posts fieldset input[type="email"],
    div#user-submitted-posts fieldset input[type="url"],
    div#user-submitted-posts fieldset input[type="file"],
    div#user-submitted-posts textarea.usp-textarea,
    div#user-submitted-posts select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    div#user-submitted-posts fieldset.usp-images {
        padding: 15px;
        margin: 20px 0;
    }
    
    div#user-submitted-posts input[type="submit"].usp-submit {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    div#user-submitted-posts div#usp-submit {
        margin: 25px 0 0 0;
    }
}

@media (max-width: 480px) {
    div#user-submitted-posts {
        margin: 0 5px;
        padding: 15px;
    }
    
    div#user-submitted-posts fieldset {
        margin-bottom: 15px;
    }
    
    div#user-submitted-posts fieldset label {
        font-size: 13px;
    }
    
    div#user-submitted-posts fieldset input.usp-input,
    div#user-submitted-posts fieldset input[type="text"],
    div#user-submitted-posts fieldset input[type="email"],
    div#user-submitted-posts fieldset input[type="url"],
    div#user-submitted-posts fieldset input[type="file"],
    div#user-submitted-posts textarea.usp-textarea,
    div#user-submitted-posts select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    div#user-submitted-posts input[type="submit"].usp-submit {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    div#user-submitted-posts div#usp-upload-message {
        font-size: 13px;
    }
    
    div#user-submitted-posts a#usp_add-another {
        font-size: 13px;
    }
}

/* Focus Visible Enhancement for Accessibility */
div#user-submitted-posts input:focus-visible,
div#user-submitted-posts textarea:focus-visible,
div#user-submitted-posts select:focus-visible,
div#user-submitted-posts input[type="submit"]:focus-visible {
    outline: 2px solid var(--rowfuel-light-blue);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    div#user-submitted-posts fieldset input.usp-input,
    div#user-submitted-posts fieldset input[type="text"],
    div#user-submitted-posts fieldset input[type="email"],
    div#user-submitted-posts fieldset input[type="url"],
    div#user-submitted-posts fieldset input[type="file"],
    div#user-submitted-posts textarea.usp-textarea,
    div#user-submitted-posts select {
        border-width: 3px;
    }
    
    div#user-submitted-posts input[type="submit"].usp-submit {
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    div#user-submitted-posts fieldset input.usp-input,
    div#user-submitted-posts fieldset input[type="text"],
    div#user-submitted-posts fieldset input[type="email"],
    div#user-submitted-posts fieldset input[type="url"],
    div#user-submitted-posts fieldset input[type="file"],
    div#user-submitted-posts textarea.usp-textarea,
    div#user-submitted-posts select,
    div#user-submitted-posts input[type="submit"].usp-submit,
    div#user-submitted-posts a#usp_add-another {
        transition: none;
    }
    
    div#user-submitted-posts input[type="submit"].usp-submit:hover {
        transform: none;
    }
}