/* CHC Custom Postbox Styles */

/* New Post Animation Styles */
.chc-new-post {
    animation: chc-post-slide-in 0.5s ease-out;
    border-left: 3px solid #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
    transition: all 0.3s ease;
}

@keyframes chc-post-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight effect for newly created posts */
.chc-new-post:hover {
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

/* Remove the highlight after a few seconds */
.chc-new-post.chc-post-settled {
    border-left: none;
    box-shadow: none;
    animation: none;
}

.chc-postbox {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chc-postbox-content {
    width: 100%;
}

.chc-postbox-textarea-wrapper {
    margin-bottom: 12px;
}

.chc-postbox-textarea {
    width: 100%;
    min-height: 80px;
    padding-top: 12px;
    padding-left: 24px;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    outline: none;
    resize: none;
    transition: border-color 0.2s ease;
}

.chc-postbox-textarea:focus {
    border: none !important;
    outline: none !important;
    background: inherit !important;
    box-shadow: none !important;
}

.chc-postbox-textarea:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: inherit !important;
}


.chc-postbox-textarea::placeholder {
    color: #999 !important;
    font-style: italic !important;
    content: "Say something to start the discussion..." !important;
}


.chc-postbox-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    max-height: 52px;
    padding: 8px 20px;
}

.chc-postbox-actions {
    display: flex;
    align-items: center;
    overflow: visible;
    position: relative;
}

/* Post Type Button Styles */
.chc-post-type-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #666 !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
}

.chc-post-type-btn {
    line-height: 0 !important;
}

.chc-post-type-btn:hover,
.chc-postbox .chc-post-type-btn:hover,
.chc-postbox button.chc-post-type-btn:hover {
    background: #f0f8ff !important;
    border: 1px solid #e1e8ed !important;
    color: #333 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.chc-post-type-btn:active,
.chc-postbox .chc-post-type-btn:active,
.chc-postbox button.chc-post-type-btn:active {
    background: #e6f3ff !important;
    transform: scale(0.95) !important;
    text-decoration: none !important;
}

.chc-post-type-btn.active,
.chc-postbox .chc-post-type-btn.active,
.chc-postbox button.chc-post-type-btn.active {
    background: rgba(223, 226, 249, 0.8) !important;
    color: #333 !important;
    border: 1px solid #DFE2F9 !important;
}

.chc-post-type-btn.active .chc-post-type-icon,
.chc-postbox .chc-post-type-btn.active .chc-post-type-icon,
.chc-postbox button.chc-post-type-btn.active .chc-post-type-icon {
    filter: none !important;
    opacity: 1 !important;
}

/* Post Type Icon Styles */
.chc-post-type-icon,
.chc-text-post-icon,
.chc-question-post-icon,
.chc-resource-request-post-icon,
.chc-image-post-icon,
.chc-video-post-icon,
.chc-poll-post-icon,
.chc-file-post-icon,
.chc-link-post-icon {
    display: block !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: visible !important;
    transition: all 0.2s ease !important;
}


.chc-post-type-btn:hover .chc-post-type-icon,
.chc-postbox .chc-post-type-btn:hover .chc-post-type-icon,
.chc-postbox button.chc-post-type-btn:hover .chc-post-type-icon,
.chc-post-type-btn:hover .chc-text-post-icon,
.chc-post-type-btn:hover .chc-question-post-icon,
.chc-post-type-btn:hover .chc-resource-request-post-icon,
.chc-post-type-btn:hover .chc-image-post-icon,
.chc-post-type-btn:hover .chc-video-post-icon,
.chc-post-type-btn:hover .chc-poll-post-icon,
.chc-post-type-btn:hover .chc-file-post-icon,
.chc-post-type-btn:hover .chc-link-post-icon {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* Ensure images inside buttons are always visible */
.chc-post-type-btn img {
    display: block !important;
    visibility: visible !important;
    opacity: inherit !important;
}

/* Additional defensive styles to override any theme conflicts */
.chc-postbox .chc-post-type-btn {
    font-size: 0 !important;
    /* Hide any text content */
    line-height: 1 !important;
}

.chc-postbox .chc-post-type-btn img.chc-post-type-icon {
    display: block !important;
    visibility: visible !important;

}

/* Override any PeepSo button styles that might interfere */
.chc-postbox button.chc-post-type-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Ensure button content is properly displayed */
.chc-postbox button.chc-post-type-btn>* {
    display: block !important;
    visibility: visible !important;
}

/* Add Resource Button Styles - positioned with same spacing as post type icons */
.chc-postbox-add-resource {
    display: flex;
    align-items: center;
    /* No margin needed since it's inside the actions container with gap: 8px */
    margin-left: 12px;
}

.chc-resource-library-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Mona Sans', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: 0;
    cursor: pointer;
    user-select: none;
    /* Removed button-like styling */
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-height: none;
    opacity: 1;
    transition: none;
    box-sizing: border-box;
}

/* Removed hover styling to prevent button-like behavior */

.chc-resource-library-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    accent-color: #3273F6;
}

.chc-resource-library-option input[type="checkbox"]:focus {
    outline: none;
    box-shadow: none;
}


.chc-checkbox-text {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chc-postbox {
        padding: 12px;
        margin-bottom: 16px;
    }

    .chc-postbox-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .chc-postbox-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .chc-post-type-btn {
        width: 32px;
        height: 32px;
    }

    .chc-post-type-icon,
    .chc-text-post-icon,
    .chc-question-post-icon,
    .chc-resource-request-post-icon,
    .chc-image-post-icon,
    .chc-video-post-icon,
    .chc-poll-post-icon,
    .chc-file-post-icon,
    .chc-link-post-icon {
        width: 18px !important;
        height: 18px !important;
    }

    /* Image Upload Mobile Styles */
    .chc-image-upload-dropzone {
        padding: 30px 16px;
        min-height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chc-upload-primary-text {
        font-size: 14px;
    }

    .chc-upload-secondary-text {
        font-size: 11px;
    }

    .chc-image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .chc-image-preview-header {
        padding: 10px 12px;
    }

    .chc-preview-count {
        font-size: 13px;
    }

    .chc-clear-images-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* File Upload Mobile Styles */
    .chc-file-upload-dropzone {
        padding: 30px 16px;
        min-height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chc-file-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .chc-file-preview-header {
        padding: 10px 12px;
    }

    .chc-clear-files-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* Resource Info Box Mobile Styles */
    .chc-resource-info-header {
        padding: 10px 12px;
        font-size: 12px;
        max-height: 40px;
    }

    .chc-resource-field-name {
        padding: 12px;
    }

    .chc-resource-field-description {
        padding: 12px;
    }

    .chc-resource-input,
    .chc-resource-textarea {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .chc-postbox {
        padding: 10px;
    }

    .chc-postbox-textarea {
        padding: 10px;
        font-size: 13px;
    }

    .chc-postbox-actions {
        gap: 6px;
    }

    .chc-post-type-btn {
        width: 30px;
        height: 30px;
    }

    .chc-post-type-icon,
    .chc-text-post-icon,
    .chc-question-post-icon,
    .chc-resource-request-post-icon,
    .chc-image-post-icon,
    .chc-video-post-icon,
    .chc-poll-post-icon,
    .chc-file-post-icon,
    .chc-link-post-icon {
        width: 16px !important;
        height: 16px !important;
    }

    /* Image Upload Small Mobile Styles */
    .chc-image-upload-dropzone {
        padding: 24px 12px;
        min-height: 80px;
    }

    .chc-image-upload-icon {
        width: 36px;
        height: 36px;
    }

    .chc-upload-primary-text {
        font-size: 13px;
    }

    .chc-upload-secondary-text {
        font-size: 10px;
    }

    .chc-image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
        padding: 10px;
        max-height: 250px;
    }

    .chc-remove-image {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 2px;
        right: 2px;
    }

    .chc-add-more-icon {
        font-size: 20px;
    }

    .chc-add-more-text {
        font-size: 10px;
    }

    /* File Upload Small Mobile Styles */
    .chc-file-upload-dropzone {
        padding: 24px 12px;
        min-height: 80px;
    }

    .chc-file-upload-icon {
        width: 36px;
        height: 36px;
    }

    .chc-file-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
        padding: 10px;
        max-height: 250px;
    }

    .chc-remove-file-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 2px;
        right: 2px;
    }

    .chc-upload-error {
        font-size: 11px;
        padding: 4px 8px;
        bottom: 4px;
    }

    /* Resource Info Box Small Mobile Styles */
    .chc-resource-info-header {
        padding: 8px 10px;
        font-size: 11px;
    }

    .chc-resource-field-name {
        padding: 10px;
    }

    .chc-resource-field-description {
        padding: 10px;
    }

    .chc-resource-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .chc-resource-input,
    .chc-resource-textarea {
        padding: 8px 10px;
        font-size: 12px;
    }

    .chc-resource-textarea {
        min-height: 70px;
    }
}

/* Focus states for accessibility */
.chc-post-type-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.chc-resource-library-option:focus-within {
    outline: none;
}

.chc-resource-library-option input[type="checkbox"]:focus {
    outline: none;
    box-shadow: none;
}

/* Simple show/hide animation for resource library option */

.chc-resource-library-option[style*="display: block"] {
    opacity: 0;
}

.chc-resource-library-option:not([style*="display: block"]) {
    opacity: 1;
}

/* Post Type Visibility Styles */
.text-post-type,
.image-post-type,
.video-post-type,
.poll-post-type,
.file-post-type,
.link-post-type {
    transition: opacity 0.2s ease-in-out;
}

/* Ensure post types are properly hidden when not active */
.image-post-type,
.video-post-type,
.poll-post-type,
.file-post-type,
.link-post-type {
    display: none;
}

/* Text post variations - all use the same .text-post-type container */
.text-post-type[data-text-variation="text"] .chc-postbox-textarea {
    /* Default text post styling */
}

.text-post-type[data-text-variation="question"] .chc-postbox-textarea {
    /* Question post styling - can be customized if needed */
}

/* Post Submission Messages */
.chc-postbox-message {
    display: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-family: 'Mona Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid;
}

.chc-message-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.chc-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.chc-message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Loading state for submit button */
.chc-postbox-post-btn.chc-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.chc-postbox-post-btn.chc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: chc-spin 1s linear infinite;
}

@keyframes chc-spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

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

.text-post-type[data-text-variation="resource-request"] .chc-postbox-textarea {
    /* Resource request post styling - can be customized if needed */
}

/* ===== IMAGE UPLOAD POST TYPE STYLES ===== */


.chc-image-textarea-wrapper {
    border-top: 1px solid #ddd;
}


/* Image Upload Container */
.chc-image-upload-container {
    padding-top: 24px;
    padding-right: 24px;
    padding-bottom: 24px;
    padding-left: 24px;
}


/* Image Upload Dropzone */
.chc-image-upload-dropzone {
    border: 1px dashed #707070;
    border-radius: 8px;
    padding: 24px 24px;
    text-align: center;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chc-image-upload-dropzone:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.chc-image-upload-dropzone.chc-dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    border-style: solid;
}

/* Upload Content */
.chc-image-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.chc-image-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chc-upload-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.chc-image-upload-dropzone:hover .chc-upload-icon {
    opacity: 1;
}

/* Upload Text */
.chc-image-upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chc-upload-primary-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin: 0;
    line-height: 1.4;
}

.chc-upload-secondary-text {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
}

/* Hidden File Input - positioned to cover entire dropzone */
.chc-image-file-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* Image Preview Container */
.chc-image-preview-container {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
}

.chc-image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.chc-preview-count {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.chc-clear-images-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chc-clear-images-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* Image Preview Grid */
.chc-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

/* Individual Image Preview */
.chc-image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.chc-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.chc-image-preview-item:hover .chc-preview-image {
    transform: scale(1.05);
}

/* Remove Image Button */
.chc-remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.chc-remove-image:hover {
    background-color: rgba(220, 38, 38, 0.9);
}

/* Upload Status Indicator */
.chc-upload-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    text-align: center;
    border-radius: 0 0 6px 6px;
    z-index: 5;
}

.chc-upload-progress {
    font-weight: 500;
}

/* Add More Images Button */
.chc-add-more-images {
    border: 2px dashed #d1d5db;
    background-color: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chc-add-more-images:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.chc-add-more-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.chc-add-more-icon {
    font-size: 24px;
    font-weight: 300;
    color: #6b7280;
    line-height: 1;
}

.chc-add-more-text {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Image Preview Wrapper */
.chc-image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
}

/* Upload Error Message */
.chc-upload-error {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 20;
    display: none;
    white-space: nowrap;
}

/* ===== FILE UPLOAD POST TYPE STYLES ===== */

.chc-file-textarea-wrapper {
    border-top: 1px solid #ddd;
}

/* File Upload Container */
.chc-file-upload-container {
    padding-top: 24px;
    padding-right: 24px;
    padding-bottom: 24px;
    padding-left: 24px;
}

/* File Upload Dropzone */
.chc-file-upload-dropzone {
    border: 1px dashed #707070;
    border-radius: 8px;
    padding: 24px 24px;
    text-align: center;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chc-file-upload-dropzone:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.chc-file-upload-dropzone.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    border-style: solid;
}

/* Upload Content */
.chc-file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.chc-file-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chc-file-upload-dropzone .chc-upload-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.chc-file-upload-dropzone:hover .chc-upload-icon {
    opacity: 1;
}

/* Upload Text */
.chc-file-upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Hidden File Input */
.chc-file-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* File Preview Container */
.chc-file-preview-container {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
}

.chc-file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.chc-clear-files-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chc-clear-files-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* File Preview Grid */
.chc-file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.chc-file-preview-item {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chc-file-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Remove File Button */
.chc-remove-file-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.chc-remove-file-btn:hover {
    background-color: rgba(220, 38, 38, 0.9);
}

/* File Preview Wrapper */
.chc-file-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    height: 100%;
    position: relative;
}

/* File Icon */
.chc-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.chc-file-icon i {
    font-size: 32px;
    color: #6b7280;
}

/* File Info */
.chc-file-info {
    text-align: center;
    width: 100%;
    min-height: 0;
}

.chc-file-name {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
    word-break: break-word;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chc-file-size {
    font-size: 10px;
    color: #6b7280;
    line-height: 1;
}

/* Add More Files Button */
.chc-add-more-files {
    border: 1px dashed #9ca3af;
    background-color: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chc-add-more-files:hover {
    border-color: #6b7280;
    background-color: #f3f4f6;
}

.chc-add-more-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    height: 100%;
}

.chc-add-more-icon {
    font-size: 24px;
    color: #9ca3af;
    margin-bottom: 4px;
    line-height: 1;
}

.chc-add-more-text {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
}

/* ===== RESOURCE INFO BOX STYLES ===== */

.chc-resource-info-box {
    max-height: 296px;
    background: #F2F6FC;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    margin-top: 20px;
}

.chc-resource-info-header {
    background: #4A6EA9;
    color: #ffffff;
    padding: 8px 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 16px;
    line-height: 1.4;
}

.chc-resource-info-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.chc-resource-info-icon svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.chc-resource-info-text {
    flex: 1;
    font-weight: 500;
    font-size: 16px;
    font-family: 'Mona Sans', sans-serif;

}

.chc-resource-field-name {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.chc-resource-field-description {
    padding: 16px;
    border-bottom: none;
}

.chc-resource-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 8px;

    font-family: 'Mona Sans', sans-serif;
}

.chc-resource-input {
    width: 100%;

    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #333333;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    max-height: 44px
}

.chc-resource-input:focus {
    outline: none;
    border-color: #6B7FBD;
    box-shadow: 0 0 0 3px rgba(107, 127, 189, 0.1);
}

.chc-resource-input::placeholder {
    color: #999999;
    font-style: normal;
}


#chc-resource-name {
    font-size: 14px;
    max-height: 44px;
}

/* Read-only state for resource name field (used for link post type) */
.chc-resource-name-readonly {
    background-color: #EBEBEB !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    font-size: 12px !important;
    font-family: 'Mona Sans', sans-serif !important;
    font-weight: 400 !important;
}

.chc-resource-name-readonly:focus {
    border-color: #C1CBD7 !important;
    box-shadow: none !important;
}

.chc-resource-name-readonly::placeholder {
    color: #666666 !important;
    font-style: normal !important;
    font-size: 12px !important;
    font-family: 'Mona Sans', sans-serif !important;
    font-weight: 400 !important;
}

.chc-resource-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #333333;
    background: #ffffff;
    resize: none;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    max-height: 100px;
}



.chc-resource-textarea:focus {
    outline: none;
    border-color: #6B7FBD;
    box-shadow: 0 0 0 3px rgba(107, 127, 189, 0.1);
}

.chc-resource-textarea::placeholder {
    color: #999999;
    font-style: normal;
}

.chc-vide-url-wrapper {
    padding: 24px;
    position: relative;
}

/* Pseudo Input Container */
.chc-video-url-pseudo-input {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #C1CBD7;
    background: #ffffff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: text;
    outline: none;
    transition: border-color 0.3s ease;
}

.chc-video-url-pseudo-input:focus {
    border-color: #007cba;
}

/* Icon */
.chc-video-url-icon {
    width: 20px;
    height: 20px;
    margin-left: 16px;
    margin-right: 16px;
    background: url('/wp-content/themes/peepso-theme-gecko-child/assets/icons/video-url-input-icon.png') no-repeat center;
    background-size: 20px 20px;
    flex-shrink: 0;
}

/* Text Area */
.chc-video-url-text {
    flex: 1;
    font-family: 'Mona Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    padding-right: 15px;
    min-height: 20px;
    line-height: 20px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placeholder state */
.chc-video-url-text:empty::before {
    content: attr(data-placeholder);
    color: #AEAEB2;
    pointer-events: none;
}

/* Editable text */
.chc-video-url-text[contenteditable="true"] {
    cursor: text;
}

/* Clear button (X) */
.chc-video-url-clear {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    background: url('/wp-content/themes/peepso-theme-gecko-child/assets/icons/url_cancel.png') no-repeat center;
    background-size: 24px 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    user-select: none;
}

.chc-video-url-clear:hover {
    opacity: 0.7;
}


.chc-video-textarea-wrapper {
    border-top: 1px solid #ddd;
}

/* ===== LINK POST TYPE STYLES ===== */

.chc-link-url-wrapper {
    padding: 24px;
    position: relative;
}

/* Field Group Container */
.chc-link-field-group {
    margin-bottom: 20px;
}

.chc-link-field-group:last-of-type {
    margin-bottom: 0;
}

/* Field Labels */
.chc-link-field-label {
    display: block;
    font-family: 'Mona Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* Pseudo Input Container */
.chc-link-url-pseudo-input {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #C1CBD7;
    background: #ffffff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: text;
    outline: none;
    transition: border-color 0.3s ease;
}

.chc-link-url-pseudo-input:focus {
    border-color: #007cba;
}

/* Icon */
.chc-link-url-icon {
    width: 20px;
    height: 20px;
    margin-left: 16px;
    margin-right: 16px;
    background: url('/wp-content/themes/peepso-theme-gecko-child/assets/icons/video-url-input-icon.png') no-repeat center;
    background-size: 20px 20px;
    flex-shrink: 0;
}

/* Text Area */
.chc-link-url-text {
    flex: 1;
    font-family: 'Mona Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    padding-right: 15px;
    min-height: 20px;
    line-height: 20px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Placeholder state */
.chc-link-url-text:empty::before {
    content: attr(data-placeholder);
    color: #AEAEB2;
    pointer-events: none;
}

/* Editable text */
.chc-link-url-text[contenteditable="true"] {
    cursor: text;
}

/* Clear button (X) */
.chc-link-url-clear {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    background: url('/wp-content/themes/peepso-theme-gecko-child/assets/icons/url_cancel.png') no-repeat center;
    background-size: 24px 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    user-select: none;
}

.chc-link-url-clear:hover {
    opacity: 0.7;
}

/* Link Text Pseudo Input */
.chc-link-text-pseudo-input {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #C1CBD7;
    background: #ffffff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: text;
    outline: none;
    transition: border-color 0.3s ease;
}

.chc-link-text-pseudo-input:focus {
    border-color: #007cba;
}

/* Link Text Icon */
.chc-link-text-icon {
    width: 20px;
    height: 20px;
    margin-left: 16px;
    margin-right: 16px;
    background: url('/wp-content/themes/peepso-theme-gecko-child/assets/icons/link-text-input-icon.png') no-repeat center;
    background-size: 20px 20px;
    flex-shrink: 0;
}

/* Link Text Area */
.chc-link-text-text {
    flex: 1;
    font-family: 'Mona Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    padding-right: 15px;
    min-height: 20px;
    line-height: 20px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 16px;
}

/* Link Text Placeholder state */
.chc-link-text-text:empty::before {
    content: attr(data-placeholder);
    color: #AEAEB2;
    pointer-events: none;
}

/* Link Text Editable text */
.chc-link-text-text[contenteditable="true"] {
    cursor: text;
}

.chc-link-textarea-wrapper {
    border-top: 1px solid #ddd;
}

.chc-poll-textarea-wrapper {
    border-top: 1px solid #ddd;
}


.chc-poll-options-container {
    padding: 24px;
}

/* Poll Option Wrapper - horizontal layout with even spacing */
.chc-poll-option-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 8px;
}

.chc-poll-option-wrapper:last-child {
    margin-bottom: 0;
}

/* Add button on the left of each option */
.chc-poll-option-add-btn {
    flex-shrink: 0;
    width: 35px;
    height: 40px;
}

.chc-poll-option-add-btn .chc-poll-add-option-btn {
    width: 35px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
    font-size: 16px;
}

.chc-poll-option-add-btn .chc-poll-add-option-btn:hover {
    background: #e9ecef;
    border-color: #3273F6;
    color: #3273F6;
}

/* Poll Option Input - takes up most space with consistent height */
.chc-poll-option-input-wrapper {
    flex: 1;
}

.chc-poll-option-input {
    width: 100%;
    height: 40px;
    max-height: 40px;
    padding: 0 16px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.chc-poll-option-input:focus {
    border-color: #3273F6;
    box-shadow: 0 0 0 3px rgba(50, 115, 246, 0.1);
}

/* Delete button on the right - same size as add button */
.chc-poll-option-actions {
    flex-shrink: 0;
    width: 35px;
    height: 40px;
}

.chc-poll-remove-option {
    width: 35px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
    font-size: 16px;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.chc-poll-remove-option i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.chc-poll-remove-option:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Poll Actions Container - positioned at bottom */
.chc-poll-actions-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px dashed #e1e5e9;
}

/* Main Add New Option Button */
.chc-poll-add-option-wrapper {
    flex-shrink: 0;
}

#chc-add-poll-option {
    background: #3273F6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#chc-add-poll-option:hover {
    background: #2563eb;
}

/* Poll Settings - positioned to right of add button */
.chc-poll-settings-wrapper {
    flex: 1;
}

.chc-poll-multiple-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.chc-poll-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    accent-color: #3273F6;
}

.chc-poll-checkbox-text {
    user-select: none;
}

/* ===== POSTBOX TOOLBAR BUTTONS ===== */

/* Postbox Options Container */
.chc-postbox-options {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cancel Button */
.chc-postbox-cancel-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border: 1px solid #C1CBD7 !important;
    background: #ffffff !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
}

.chc-postbox-cancel-btn:hover {
    background: #f8f9fa !important;
    border-color: #9ca3af !important;
    transform: scale(1.05) !important;
}

.chc-postbox-cancel-btn:active {
    background: #f1f3f4 !important;
    transform: scale(0.95) !important;
}

.chc-cancel-icon {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    object-fit: contain !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}

.chc-postbox-cancel-btn:hover .chc-cancel-icon {
    opacity: 1 !important;
}

/* Post Button */
.chc-postbox-post-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 71px !important;
    height: 36px !important;
    padding: 0 !important;
    border: none !important;
    background: #6271EB !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: 'Mona Sans', sans-serif !important;
    font-weight: 500 !important;
    font-style: normal !important;
    font-size: 14px !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
}

.chc-postbox-post-btn:hover {
    background: #5563e8 !important;
    transform: scale(1.02) !important;
}

.chc-postbox-post-btn:active {
    background: #4c5ce5 !important;
    transform: scale(0.98) !important;
}

/* ===== CUSTOM TOOLTIP STYLES ===== */

/* Custom Tooltip Styles */
.chc-tooltip {
    position: absolute;
    background: #2c3e50;
    color: #ffffff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.4;
    max-width: 320px;
    word-wrap: break-word;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.chc-tooltip:before {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.chc-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive Tooltip Styles */
@media (max-width: 768px) {
    .chc-tooltip {
        max-width: 280px !important;
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
}