:root {
    --color-light-green: var(--wc-green, #f0f9f4); /* WordPress success color, fallback to light green */
    --color-light-red: #fce0dd; /* WordPress error color, fallback to light red */
    --color-background-red: var(--wp-admin-color-error, #fef7f6); /* Same as above */
    --color-tooltip-bg: var(--wp-admin-color-error, rgba(140, 51, 51, 0.8)); /* Fallback to your tooltip background */
    --color-wordpress-blue: var(--wc-blue, #007cba); /* Primary admin color, fallback to WordPress blue */
    --color-white: #ffffff;
    --color-gray: var(--wc-blue, #007cba); /* Secondary color, fallback to WordPress blue */
}

/* Ensure the iframe inside the TinyMCE editor has a white background */
.ad-block-guard-rich-text {
    transition: background-color 0.3s ease;
    padding: 10px; /* Optional: Add padding to make the background more visible */
}

div.cf-container__fields {
    margin-top: 1rem;
    margin-left: 2rem;
}

.cf-field__body {
    padding-top: .6rem;
    padding-bottom: .6rem;
}

/* Very light green background */
.cf-complex__group.highlight-green {
    background-color: var(--color-light-green); 
}

/* Very light red background */
.cf-complex__group.highlight-red {
    background-color: var(--color-light-red); 
}

/* Change background color on hover to light red */
.cf-field.disabled:hover {
    background-color: var(--color-light-red); 
}

.cf-field {
    position: relative; /* Ensure positioning context for the tooltip */
    transition: background-color 0.3s; /* Smooth transition for background color change */
}

.cf-field.disabled::after {
    content: attr(data-pro-feature-message);
    position: absolute;
    left: 50%;
    top: 30%; /* Position below the parent */
    transform: translateX(-50%); /* Center horizontally */
    padding: 12px; /* Increase padding */
    background: var(--color-tooltip-bg); /* Dark background */
    color: var(--color-white); /* White text */
    border-radius: 5px; /* Rounded corners */
    white-space: nowrap; /* Prevent text wrapping */
    z-index: 1000; /* Ensure tooltip is above other elements */
    display: none; /* Hidden by default */
    font-size: 16px; /* Increase font size */
    line-height: 1.4; /* Improve line height */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Optional shadow */
}

.cf-field.disabled:hover::after {
    display: block; /* Show tooltip on hover */
}

.pro-feature-label {
    position: relative; /* Ensure positioning context for any additional styling */
    display: inline-block; /* Ensure the span behaves inline but allows for block-level styling */
    padding: 2px 4px; /* Padding around the text */
    background: var(--color-tooltip-bg); /* Dark background */
    color: var(--color-white); /* White text */
    border-radius: 5px; /* Rounded corners */
    font-size: 12px; /* Font size for the label text */
    line-height: 1.4; /* Improve line height */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Optional shadow */
    white-space: nowrap; /* Prevent text wrapping */
}

span.pro-feature-label a {
    text-decoration: none;
    color: var(--color-white);
}

span.pro-feature-label a:hover {
    text-decoration: underline;
    color: var(--color-white);
}

/* Common Styles for Current Tabs */
.cf-container__tabs-item--current,
.cf-complex__tabs-item--current {
    background-color: var(--color-wordpress-blue) !important; /* WordPress secondary color */
    color: var(--color-white) !important; /* Ensure the text is white */
    border-bottom-color: var(--color-wordpress-blue) !important; /* Match the bottom border to the background */
    transition: background-color .1s linear, color .1s linear;
}

/* Specific Styles for Primary Tab Buttons */
.cf-container__tabs-item--current button {
    background-color: var(--color-wordpress-blue) !important; /* WordPress blue */
    color: var(--color-white) !important; /* Ensure the button text is white */
    border: none; /* Remove any borders on the button */
    width: 100%; /* Ensure the button takes full width */
    text-align: center; /* Center the text inside the button */
}

/* Remove Focus Outline for Buttons */
.cf-container__tabs-item--current button:focus {
    outline: none; /* Remove focus outline */
}

/* Inherit Colors for Text Inside Complex Tabs */
.cf-complex__tabs-title span,
.cf-complex__group-title span {
    color: inherit; /* Inherit the color for text inside the span */
}

.cf-checkbox__label {
    font-weight: 600;
}

div.cf-field__body .cf-number__input {
    width: 125px !important;
}

.tab-icon {
    font-weight: bold;
    margin-left: 5px;
}

input[name^="carbon_fields_compact_input[_ad_block_guard_usergroup_settings]["][name$="][_overlay_title]"] {
    /* Your styles here */
    max-width: 450px !important;
}

/* coloring for tabs that aren't accessible */
.read-only-tab {
    background-color: rgba(255, 0, 0, 0.1) !important;
    cursor: not-allowed;
}

.read-only-tab .cf-complex__tabs-title {
    color: #ff0000 !important;
}

.read-only-tab:hover .pro-feature-label {
    display: inline-block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: var(--color-tooltip-bg);
    color: #fff;
    padding: 2px 4px;
    border-radius: 5px;
    white-space: nowrap;
}

.pro-feature-text,
.pro-feature-message {
    font-size: 80%;
}

div.wu-ad-block-guard-scrollable-box {
    width: 100%;
    border: 1px solid #ddd;
    padding: 2px;
    box-sizing: border-box;
}

div.wu-ad-block-guard-scrollable-content {
    border: 1px solid #ddd;
    width: 100%;
    max-height: 100px; /* Adjust height relative to viewport height */
    overflow-x: auto; /* Horizontal scrolling if needed */
    overflow-y: auto; /* Vertical scrolling if needed */
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
    word-wrap: break-word; /* Break long words to fit the container */
    word-break: break-all; /* Break long unbreakable text */
    line-height: 1.2; /* Adjust line-height to control spacing */
}

/* Style for the tabs with pro features */
.cf-complex__tabs-item.pro-feature {
    background-color: var(--color-background-red); /* Set the background to red */
    transition: background-color 0.3s ease-in-out; /* Smooth transition */
}

.cf-complex__tabs-item.pro-feature .cf-complex__tabs-title {
    color: var(--color-white); /* Ensure text is readable on red background */
}

/* Style for the tooltip */
.tooltip {
    position: absolute;
    background-color: var(--color-tooltip-bg);
    color: var(--color-white);
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
    font-size: 14px;
}

.cf-complex__tabs-item.pro-feature:hover {
    background-color: var(--color-background-red); /* Keep background red on hover */
}

.cf-complex__tabs-item.pro-feature:hover .tooltip {
    display: block;
}

/* Override the active (current) tab styles specifically for pro-feature tabs */
.cf-complex__tabs-item.pro-feature.cf-complex__tabs-item--current {
    background-color: var(--color-tooltip-bg) !important; /* Ensure the background is set to tooltip color */
}

.cf-complex__tabs-item.pro-feature.cf-complex__tabs-item--current .cf-complex__tabs-title {
    color: var(--color-white) !important; /* Ensure text is white when active */
}

/* Custom styles for Carbon Fields checkboxes */
.cf-checkbox__label {
    display: inline-block; /* Keeps the label inline with the checkbox */
    padding-left: 8px; /* Adds space between the checkbox and the label */
    max-width: calc(100% - 40px); /* Ensures the label wraps within its container */
    word-wrap: break-word; /* Allows the label to break at word boundaries if necessary */
}

.checkbox-icon {
    float: left;
}

.adblock-status-text {
    text-align: center;
    padding: 5px 10px; /* Light padding */
    border-radius: 2px; /* Border radius */
    display: inline-block; /* Ensures the background wraps around the text */
}

.adblock-status-yes {
    width: 30px;
    background-color: var(--color-light-green, #D2ECD8); /* Light green background for Yes */
    color: #28a745;
}

.adblock-status-no {
    opacity: 0.8;
    width: 30px;
    background-color: #e2e3e5; /* Light gray background for No */
    color: #6c757d;
}

.cf-multiselect {
    margin: 0 0 0 50px;
    padding: 0 25px 0 0;
}

.cf-multiselect .cf-field__head .cf-field__label {
    font-weight: 300;
}
