/**
 * IAB TCF Tabbed Interface Styles
 *
 * Styles for the tabbed interface in the preferences modal
 * when IAB TCF is enabled.
 *
 * @package WPConsent
 */

/* Vendors Link in Banner - styled as link */
.wpconsent-view-vendors-link {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 500;
	display: block;
	margin-top: 12px;
}

.wpconsent-view-vendors-link:hover {
	text-decoration: none;
}

/* TC String Storage Disclosure */
.wpconsent-tc-string-storage-disclosure {
	margin: 16px 0 20px 0;
	padding: 12px 16px;
	background-color: rgba(0, 115, 170, 0.05);
	border-left: 3px solid var(--wpconsent-preferences-bg, #0073aa);
	border-radius: 4px;
}

.wpconsent-tc-string-storage-disclosure .wpconsent-storage-info {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--wpconsent-text, #555);
}

/* TCF Tabs Container */
.wpconsent-tcf-tabs-container {
	margin: 20px 0;
}

/* Tab Navigation */
.wpconsent-tcf-tabs-nav {
	display: flex;
	border-bottom: 2px solid #e0e0e0;
	margin-bottom: 20px;
}

/* Tab Buttons */
.wpconsent-tcf-tab-button {
	background: transparent;
	border: none;
	padding: 12px 20px;
	font-size: 16px;
	font-weight: 500;
	color: var(--wpconsent-text, #666);
	cursor: pointer;
	border-bottom: 3px solid transparent;
	transition: all 0.3s ease;
	flex: 1;
	text-align: center;
}

.wpconsent-tcf-tab-button:hover {
	color: var(--wpconsent-text, #333);
	background-color: rgba(0, 0, 0, 0.03);
}

.wpconsent-tcf-tab-button.wpconsent-tcf-tab-active {
	color: var(--wpconsent-background, #fff);
	border-bottom-color: var(--wpconsent-text, #fff);
	background-color: var(--wpconsent-text, #fff);
}

.wpconsent-tcf-tab-button:focus {
	outline: 2px solid var(--wpconsent-preferences-bg, #0073aa);
	outline-offset: 2px;
}

/* Tab Content */
.wpconsent-tcf-tab-content {
	display: none;
}

.wpconsent-tcf-tab-content.wpconsent-tcf-tab-active {
	display: block;
}

/* Vendor Search */
.wpconsent-tcf-vendor-search {
	margin-bottom: 20px;
	max-width: 400px;
	position: relative;
}

.wpconsent-vendor-search-container {
	display: flex;
	gap: 8px;
	align-items: center;
}

.wpconsent-vendor-search-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 16px;
	transition: border-color 0.3s ease;
	box-sizing: border-box;
}

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

.wpconsent-vendor-search-input::placeholder {
	color: #999;
}

/* Filter Button */
.wpconsent-vendor-filter-button {
	background: #0073aa;
	border: 2px solid #0073aa;
	border-radius: 6px;
	color: white;
	cursor: pointer;
	font-size: 16px;
	padding: 12px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	box-sizing: border-box;
}

.wpconsent-vendor-filter-button:hover {
	background: #005a87;
	border-color: #005a87;
}

.wpconsent-vendor-filter-button:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wpconsent-vendor-filter-button.active {
	background: #005a87;
	border-color: #005a87;
}

.wpconsent-filter-icon {
	font-size: 18px;
	font-weight: bold;
}

/* Filter Dropdown */
.wpconsent-vendor-filter-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 2px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	margin-top: 8px;
	max-height: 300px;
	overflow-y: auto;
}

.wpconsent-filter-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	border-bottom: 1px solid #eee;
	background: #f9f9f9;
	border-radius: 4px 4px 0 0;
}

.wpconsent-filter-header h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

.wpconsent-filter-clear {
	background: transparent;
	border: 1px solid #0073aa;
	border-radius: 4px;
	color: #0073aa;
	cursor: pointer;
	font-size: 12px;
	padding: 4px 8px;
	transition: all 0.3s ease;
}

.wpconsent-filter-clear:hover {
	background: #0073aa;
	color: white;
}

.wpconsent-filter-purposes {
	padding: 8px;
}

.wpconsent-filter-purpose-item {
	display: flex;
	align-items: center;
	padding: 6px 8px;
	border-radius: 4px;
	transition: background-color 0.2s ease;
}

.wpconsent-filter-purpose-item:hover {
	background-color: #f5f5f5;
}

.wpconsent-filter-purpose-checkbox {
	margin-right: 8px;
	cursor: pointer;
}

.wpconsent-filter-purpose-label {
	cursor: pointer;
	font-size: 13px;
	color: #333;
	line-height: 1.4;
	flex: 1;
}

/* Vendors List */
/* No vendors message */
.wpconsent-no-vendors {
	text-align: center;
	color: #666;
	font-style: italic;
	padding: 20px;
	background-color: #f9f9f9;
	border-radius: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.wpconsent-tcf-tabs-nav {
		flex-direction: column;
	}

	.wpconsent-tcf-tab-button {
		flex: none;
		border-bottom: none;
		border-right: 3px solid transparent;
	}

	.wpconsent-tcf-tab-button.wpconsent-tcf-tab-active {
		border-right-color: var(--wpconsent-preferences-bg, #0073aa);
		border-bottom-color: transparent;
	}
}


/* Table-like layout for IAB TCF vendors */
.wpconsent-tcf-vendors-table {
	width: 100%;
}

.wpconsent-tcf-vendors-header {
	display: flex;
	align-items: center;
	padding: 12px 0;
	background-color: rgba(0, 0, 0, 0.03);
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	margin-bottom: 8px;
}

.wpconsent-vendor-name-header {
	flex: 1;
	/* Empty space for vendor names column */
}

.wpconsent-vendor-toggles-header {
	display: flex;
	align-items: center;
	min-width: 200px;
	justify-content: flex-end;
}

.wpconsent-master-toggle-group {
	display: flex;
	gap: 40px;
	align-items: center;
	justify-content: flex-end;
}

.wpconsent-master-toggle-column {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 80px;
	flex-shrink: 0;
}

.wpconsent-master-toggle-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--wpconsent-text);
	text-align: center;
	white-space: nowrap;
}

.wpconsent-master-toggle {
	/* Use existing checkbox toggle styles */
}

/* Vendor table row layout */
.wpconsent-vendor-table-row {
	display: flex;
	align-items: center;
	padding: 8px 0;
}

.wpconsent-vendor-name-cell {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Remove bottom margin from label in vendor table row for proper vertical alignment. */
.wpconsent-vendor-table-row .wpconsent-cookie-category-text label {
	margin-bottom: 0;
}

/* Add padding to vendor details description. */
.wpconsent-vendor-details {
	padding: 16px 20px;
	line-height: 1.6;
}

.wpconsent-vendor-table-checkboxes {
	display: flex;
	gap: 40px;
	align-items: center;
	min-width: 200px;
	justify-content: flex-end;
}

.wpconsent-vendor-checkbox-column {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	width: 80px;
	flex-shrink: 0;
}

/* Active Filters Display */
.wpconsent-active-filters {
	margin: 12px 0 16px;
	padding: 0;
}

.wpconsent-active-filters-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.wpconsent-active-filters-label {
	font-size: 14px;
	font-weight: 500;
	margin-right: 4px;
}

.wpconsent-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #e8f4f8;
	color: #0073aa;
	padding: 4px 8px 4px 12px;
	border-radius: 16px;
	font-size: 13px;
	line-height: 1.4;
	white-space: nowrap;
	border: 1px solid #b3d9ea;
}

.wpconsent-specialfeature-chip {
	background: #fff4e5;
	color: #9b6a00;
	border-color: #f0d0a0;
}

.wpconsent-filter-chip-remove {
	background: transparent;
	border: none;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.wpconsent-filter-chip-remove:hover,
.wpconsent-filter-chip-remove:focus {
	background-color: rgba(0, 0, 0, 0.1);
	outline: none;
}

.wpconsent-filter-chip-remove:active {
	background-color: rgba(0, 0, 0, 0.15);
}

/* IAB TCF Banner Single-Column Layout */
.wpconsent-iab-tcf .wpconsent-banner-body {
	width: auto; /* Override fixed width from base banner styles */
	max-width: 100%; /* Allow body to use full banner width */
	font-size: 14px; /* Reduced font size for better space utilization */
	max-height: 90vh; /* Limit height to 90% of viewport */
	overflow-y: auto; /* Allow scrolling for very small screens */
}

.wpconsent-iab-tcf .wpconsent-banner-message {
	text-align: left; /* Align text left for better readability */
	font-size: 14px; /* Consistent smaller font */
}

/* Inline Purposes and Special Features */
.wpconsent-tcf-purposes-inline,
.wpconsent-tcf-special-features-inline {
	font-size: 12px; /* Smaller font for inline lists */
	line-height: 1.4;
	margin: 10px 0;
	color: var(--wpconsent-text, #000);
	text-align: left; /* Left align purposes and features */
}

.wpconsent-tcf-purposes-inline strong,
.wpconsent-tcf-special-features-inline strong {
	font-weight: 600;
}

/* Section Titles */
.wpconsent-tcf-section-title {
	font-size: var(--wpconsent-font-size); /* Match banner body font size */
	font-weight: 600;
	margin: 12px 0 0 0; /* Match banner body paragraph margin */
	color: var(--wpconsent-text, #000);
	text-align: left;
}

.wpconsent-tcf-section-title:first-child {
	margin-top: 0;
}

.wpconsent-tcf-special-features-section {
	margin-top: 20px;
}

.wpconsent-tcf-special-features-section .wpconsent-tcf-section-title {
	margin-top: 0;
}

/* Lists */
.wpconsent-tcf-purposes-list,
.wpconsent-tcf-special-features-list {
	list-style: none;
	margin: 12px 0 0 0; /* Match paragraph spacing */
	padding: 0;
	text-align: left;
}

.wpconsent-tcf-purposes-list li,
.wpconsent-tcf-special-features-list li {
	padding: 0;
	margin-top: 12px; /* Match paragraph spacing */
	font-size: var(--wpconsent-font-size); /* Match banner body font size */
	line-height: var(--wpconsent-line-height); /* Match banner body line height */
	color: var(--wpconsent-text, #000);
}

.wpconsent-tcf-purposes-list li:first-child,
.wpconsent-tcf-special-features-list li:first-child {
	margin-top: 0;
}

/* Section Separator */
.wpconsent-tcf-section-separator {
	border-top: 2px solid #e0e0e0;
	margin: 30px 0 20px 0;
}

/* Section Heading */
.wpconsent-tcf-section-heading {
	font-size: 18px;
	font-weight: 600;
	color: var(--wpconsent-text, #333);
	margin: 0 0 12px 0;
}

/* Special Purposes Section */
.wpconsent-tcf-special-purposes-section {
	margin-top: 20px;
}

.wpconsent-tcf-special-purposes-description,
.wpconsent-tcf-features-description,
.wpconsent-tcf-special-features-description {
	margin-bottom: 16px;
}

.wpconsent-tcf-special-purposes-description .wpconsent-tab-description,
.wpconsent-tcf-features-description .wpconsent-tab-description,
.wpconsent-tcf-special-features-description .wpconsent-tab-description {
	margin: 8px 0 0 0;
	color: var(--wpconsent-text, #666);
	font-size: 14px;
	line-height: 1.5;
}

/* Special Purpose Items (no checkboxes, no badges) */
.wpconsent-special-purpose-item .wpconsent-preferences-accordion-header {
	padding-right: 16px;
}

/* Features Section */
.wpconsent-tcf-features-section {
	margin-top: 20px;
}

.wpconsent-feature-item .wpconsent-preferences-accordion-header {
	padding-right: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.wpconsent-iab-tcf .wpconsent-banner-message {
		text-align: center; /* Center text on mobile for better appearance */
	}

	.wpconsent-tcf-purposes-inline,
	.wpconsent-tcf-special-features-inline {
		font-size: 12px; /* Slightly smaller on mobile */
	}
}

/* Banner width for IAB TCF */
.wpconsent-iab-tcf .wpconsent-banner {
	max-width: 1000px; /* Wider banner for better content display */
	min-width: 0; /* Allow responsive sizing */
}

@media (max-width: 1040px) {
	.wpconsent-iab-tcf .wpconsent-banner {
		max-width: 95%; /* Responsive width on smaller screens */
		min-width: 0; /* Remove min-width constraint on smaller screens */
	}
}

/* IAB TCF Illustrations Styling (IAB TCF Policy B(b)) */
.wpconsent-iab-illustrations {
	margin-top: 16px;
	padding: 12px 16px;
	background-color: rgba(0, 0, 0, 0.03);
	border-left: 3px solid var(--wpconsent-preferences-bg, #0073aa);
	border-radius: 4px;
}

.wpconsent-iab-illustrations-label {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: var(--wpconsent-text, #333);
}

.wpconsent-iab-illustration {
	margin: 8px 0 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--wpconsent-text, #666);
	font-style: italic;
}

.wpconsent-iab-illustration:first-of-type {
	margin-top: 0;
}

/* Category Section Headings (IAB TCF Policy B(e) & C(e)) */
.wpconsent-category-section-heading {
	font-size: 18px;
	font-weight: 600;
	color: var(--wpconsent-text, #333);
	margin: 20px 0 8px 0;
	padding: 12px 16px;
	background-color: rgba(0, 0, 0, 0.03);
	border-left: 4px solid var(--wpconsent-preferences-bg, #0073aa);
	border-radius: 4px;
}

.wpconsent-category-section-description {
	font-size: 14px;
	color: var(--wpconsent-text, #666);
	margin: 0 0 16px 0;
	padding: 0 16px;
	font-style: italic;
}

/* IAB TCF Section specific styling */
.wpconsent-iab-tcf-section {
	margin-top: 30px;
}

.wpconsent-iab-tcf-section .wpconsent-category-section-heading {
	border-left-color: #0073aa; /* Distinct color for IAB TCF */
}

.wpconsent-non-tcf-section .wpconsent-category-section-heading {
	border-left-color: #999; /* Different color for non-TCF */
}
