/* Placeholder input wrapper */
.textarea-wrapper {
    position: relative;
    width: 100%;
}

/* Ensure all input fields with placeholder support take full width */
.textarea-wrapper textarea,
.textarea-wrapper input {
    width: 100% !important;
}

/* Specific styling for RCS input fields */
.rcs-text-field,
.rcs-url-field,
[data-supports-placeholders="true"] {
    width: 100% !important;
    box-sizing: border-box;
}

/* Ensure form controls containing placeholder fields are full width */
.form-control:has([data-supports-placeholders="true"]) {
    width: 100%;
}

/* Alternative selector for older browsers */
.form-control .textarea-wrapper,
.form-control textarea[data-supports-placeholders="true"],
.form-control input[data-supports-placeholders="true"] {
    width: 100%;
}

/* Suggestions dropdown container */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    z-index: 9999 !important; /* Very high z-index to appear above everything */
    
    /* Strong background to ensure visibility */
    background: white !important;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Scrolling */
    max-height: 16rem;
    overflow-y: auto;
    
    /* Animation */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    
    /* Ensure it's in front */
    isolation: isolate;
}

.suggestions-box.hidden {
    opacity: 0;
    transform: translateY(-0.5rem);
    pointer-events: none;
}

/* Individual suggestion items */
.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.15s ease;
    display: block;
    background: white;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f3f4f6 !important;
}

.suggestion-item .value {
    font-weight: 600;
    color: #059669; /* Green color for placeholder values */
    font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

.suggestion-item .description {
    font-size: 0.75rem;
    color: #6b7280; /* Gray color for descriptions */
    line-height: 1.2;
    display: block;
}

/* Style for highlighted matches */
.suggestion-item mark {
    background-color: #fef3c7; /* Yellow highlight */
    color: #92400e; /* Darker yellow text */
    padding: 0.1em 0.2em;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Responsive design for smaller screens */
@media (max-width: 640px) {
    .suggestions-box {
        max-height: 12rem;
    }
    
    .suggestion-item {
        padding: 0.5rem 0.75rem;
    }
    
    .suggestion-item .value {
        font-size: 0.8rem;
    }
    
    .suggestion-item .description {
        font-size: 0.7rem;
    }
}

/* Global override to ensure suggestions appear above everything */
.suggestions-box {
    z-index: 999999 !important;
}

/* Ensure the wrapper doesn't interfere */
.textarea-wrapper {
    position: relative;
    z-index: auto;
}

/* Override any potential conflicts */
.suggestions-box:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
}