/* Competitor Watch Layout */
.competitor-watch-content {
	width: 100%;
	background: #f5f7f9;
	height: calc(100vh - 120px);
	padding: 2rem;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: hidden;
	display: flex;
	flex-direction: column;
}


.cw-body {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	height: 100%;
	overflow: hidden;
}

/* Three Column Layout */
.cw-three-column {
	display: grid;
	grid-template-columns: 25fr 45fr 30fr;
	gap: 1rem;
	max-width: 100%;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
}

.cw-column {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100%;
}

/* Companies Column */
.cw-companies-wrapper {
	background: white;
	border-radius: 12px;
	padding: 1rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
	width: 100%;
	flex: none;
	align-self: stretch;
}

.cw-column-title {
	background: #40AB26;
	color: white;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin: 0 0 1rem 0;
	font-size: 1.125rem;
	font-weight: 600;
}

/* Category List Styles */
.cw-category-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	flex: 0 0 auto;
}

.cw-category-item {
	border-bottom: 1px solid #e5e7eb;
}

.cw-category-item:last-child {
	border-bottom: none;
}

.cw-category-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem;
	cursor: pointer;
	background: #40AB26;
	color: white;
	transition: background-color 0.2s ease;
	user-select: none;
}

.cw-category-header:hover {
	background: #35911f;
}

.cw-category-chevron {
	font-size: 0.875rem;
	color: white;
	transition: transform 0.2s ease;
	display: inline-block;
	width: 1rem;
	text-align: center;
}

.cw-category-title {
	font-size: 0.9375rem;
	font-weight: 500;
	color: white;
}

.cw-category-content {
	list-style: none;
	margin: 0;
	padding: 0;
	padding-left: 1.5rem;
	padding-top: 0.25rem;
	padding-bottom: 0.5rem;
}

.cw-category-content .cw-company-item {
	padding-left: 0.5rem;
}

.cw-news-wrapper .cw-column-title {
	background: var(--primary-green);
	color: white;
	font-weight: 600;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin: 0;
	display: inline-flex;
	align-items: center;
}

.cw-companies-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.cw-company-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.cw-company-item:hover {
	background: #f1f5f9;
}

.cw-company-item.selected {
	background: #c1f4c4;
}

.cw-company-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 600;
	color: #6b7280;
	flex-shrink: 0;
}

.cw-company-item.selected .cw-company-icon {
	background: #0ea5e9;
	color: white;
}

.cw-company-name {
	font-size: 0.875rem;
	font-weight: 500;
	color: #1a202c;
	line-height: 1.4;
}

.cw-company-item.selected .cw-company-name {
	font-weight: 600;
}

/* Pulsating animation for companies with notification */
.cw-company-item.pulsating {
	animation: cw-pulsate-bg 1.5s ease-in-out infinite;
}

.cw-company-item.pulsating.selected {
	animation: cw-pulsate-bg-selected 1.5s ease-in-out infinite;
}

/* Red dot indicator on category headers only */
.cw-category-header.has-notification::after {
	content: '';
	position: absolute;
	right: 0.75rem;
	width: 10px;
	height: 10px;
	background-color: #ef4444;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
	animation: cw-pulse-dot 1s ease-in-out infinite;
}

.cw-category-header {
	position: relative;
}

@keyframes cw-pulse-dot {

	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.2);
		opacity: 0.8;
	}
}

@keyframes cw-pulsate-bg {

	0%,
	100% {
		background-color: #dcfce7;
		/* green-100 - light green */
	}

	50% {
		background-color: #86efac;
		/* green-300 - more visible green */
	}
}

@keyframes cw-pulsate-bg-selected {

	0%,
	100% {
		background-color: #bbf7d0;
		/* green-200 - light green for selected */
	}

	50% {
		background-color: #4ade80;
		/* green-400 - more visible green for selected */
	}
}

/* Details Column */

.cw-company-header {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1rem;
	background: white;
	padding: 1.5rem;
	border-radius: 12px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Keep the company header visible while details scroll */
.cw-company-header {
	position: sticky;
	top: 0;
	z-index: 10;
	border-bottom: 1px solid #e5e7eb;
}

.cw-company-header-icon {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.875rem;
	font-weight: 600;
	color: #6b7280;
	flex-shrink: 0;
}

.cw-company-header-text {
	flex: 1;
	min-width: 0;
}

.cw-company-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #1a202c;
	margin: 0 0 0.5rem 0;
}

.cw-company-address {
	font-size: 0.875rem;
	color: #6b7280;
	margin: 0;
}

.cw-company-address a {
	color: #059669;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.cw-company-address a:hover {
	color: #047857;
	text-decoration: underline;
}

.cw-company-website {
	color: var(--primary-green);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.cw-company-website:hover {
	color: var(--primary-green-dark);
	text-decoration: underline;
}

.cw-company-website::before {
	content: '🔗';
	margin-right: 0.25rem;
	font-size: 0.875rem;
}

#cwDetailsContent {
	flex: 1;
	min-height: 0;
}

#cwNewsContent {
	flex: 1;
	min-height: 0;
}

.cw-details-card {
	background: white;
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cw-section {
	margin-bottom: 1.5rem;
	background: #f0f9f0;
	border-radius: 12px;
	padding: 1.25rem;
}

.cw-section:last-child {
	margin-bottom: 0;
}

/* Two-column layout for Company Details and Financial Snapshot */
.cw-sections-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 0;
}

.cw-sections-row .cw-section {
	margin-bottom: 0;
}

/* Add space above Summary Insight block */
.cw-sections-row+.cw-section {
	margin-top: 1.5rem;
}

.cw-section-title {
	font-size: 1rem;
	font-weight: 600;
	color: #1a202c;
	margin: 0 0 1rem 0;
}

.cw-overview-text {
	font-size: 0.875rem;
	color: #4a5568;
	line-height: 1.6;
	margin: 0;
}

.cw-ai-summary {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cw-ai-summary-paragraph {
	margin: 0;
	font-size: 0.875rem;
	color: #334155;
	line-height: 1.6;
}

.cw-ai-summary-paragraph strong {
	color: #1a202c;
}

/* Info Grid */
.cw-info-grid {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cw-info-item {
	background: #f8fafc;
	border-radius: 8px;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	min-width: 0;
}

.cw-info-label {
	font-size: 0.75rem;
	color: #64748b;
	font-weight: 500;
	width: 100%;
}

.cw-info-value {
	font-size: 0.875rem;
	color: #1a202c;
	font-weight: 600;
	width: 100%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: normal;
	text-align: left;
	line-height: 1.4;
}

.cw-info-link {
	color: #0f766e;
	text-decoration: none;
	font-weight: 600;
}

.cw-info-link:hover {
	text-decoration: underline;
	color: #115e59;
}

/* Source footer: label + row of domain pills */
/* Source footer: display as a row with space-between */
.cw-source-footer {
	margin-top: 1.25rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cw-source-label {
	font-size: 0.75rem;
	color: #64748b;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Stacked Favicon Container */
.cw-favicon-stack-wrapper {
	position: relative;
	cursor: pointer;
}

.cw-favicon-stack {
	display: flex;
	align-items: center;
}

.cw-favicon-img,
.cw-favicon-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: white;
	border: 2px solid white;
	box-shadow: 0 0 0 1px #e2e8f0;
	margin-left: -12px;
	transition: transform 0.2s ease, margin 0.2s ease;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cw-favicon-icon {
	color: #ef4444;
	/* PDF Red */
}

.cw-favicon-icon .material-icons {
	font-size: 18px;
}

.cw-favicon-img:first-child,
.cw-favicon-icon:first-child {
	margin-left: 0;
}

.cw-favicon-overflow {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f1f5f9;
	border: 2px solid white;
	box-shadow: 0 0 0 1px #e2e8f0;
	color: #64748b;
	font-size: 0.7rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: -12px;
	z-index: 1;
}

/* Hover effect on stack */
.cw-favicon-stack-wrapper:hover .cw-favicon-img {
	transform: translateY(-2px);
	margin-left: -4px;
}

.cw-favicon-stack-wrapper:hover .cw-favicon-img:first-child {
	margin-left: 0;
}

/* Popover list */
.cw-source-popover {
	position: absolute;
	bottom: 100%;
	right: 0;
	margin-bottom: 0.5rem;
	background: white;
	border-radius: 8px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	border: 1px solid #e2e8f0;
	padding: 0.5rem;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transform: translateY(5px);
	transition: all 0.2s ease;
	min-width: 180px;
}

.cw-favicon-stack-wrapper:hover .cw-source-popover {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.cw-source-popover-inner {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.cw-source-popover-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.6rem;
	border-radius: 6px;
	text-decoration: none;
	color: #1e293b;
	font-size: 0.8rem;
	font-weight: 500;
	transition: background 0.15s ease;
}

.cw-source-popover-item:hover {
	background: #f1f5f9;
	color: #059669;
}

.cw-source-popover-item img {
	border-radius: 2px;
	flex-shrink: 0;
}

.cw-source-popover-item span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}



/* Full-width info item (e.g. Key Executives) */
.cw-info-item--full {
	grid-column: 1 / -1;
}

/* Key Executives list */
.cw-executives-list {
	list-style: disc;
	margin: 0;
	padding: 0 0 0 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.cw-executives-list li {
	font-size: 0.85rem;
	color: #1a202c;
	line-height: 1.5;
}

/* Metrics Grid */

.cw-metrics-grid {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cw-metric-item {
	background: #f8fafc;
	border-radius: 8px;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	min-width: 0;
}

.cw-metric-label {
	font-size: 0.75rem;
	color: #64748b;
	font-weight: 500;
	width: 100%;
}

.cw-metric-value {
	font-size: 0.875rem;
	color: #1a202c;
	font-weight: 600;
	width: 100%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: normal;
	text-align: left;
	line-height: 1.4;
}

/* News Column */
.cw-news-wrapper {
	background: white;
	border-radius: 12px;
	padding: 1rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

/* Keep the news header visible while news items scroll */
.cw-news-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: white;
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 0.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
}

.cw-news-header .cw-column-title {
	margin: 0;
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

/* Refresh button */
.cw-news-refresh-btn {
	background: transparent;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 0.375rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	color: #64748b;
	min-width: 32px;
	height: 32px;
}

.cw-news-refresh-btn:hover {
	background: #f0f9f0;
	border-color: var(--primary-green);
	color: var(--primary-green);
}

.cw-news-refresh-btn:active {
	transform: scale(0.95);
}

.cw-news-refresh-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cw-news-refresh-btn .material-icons {
	font-size: 18px;
	transition: transform 0.3s ease;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/* News badge indicator */
.cw-news-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #ef4444;
	/* Red background for contrast */
	color: white;
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: 12px;
	padding: 0.2rem 0.6rem;
	min-width: 22px;
	height: 22px;
	margin-left: 0.5rem;
	border: 2px solid white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	animation: pulse 2s ease-in-out infinite;
	vertical-align: middle;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}

	50% {
		opacity: 0.9;
		transform: scale(1.05);
	}
}

/* Toast notification */
.cw-news-toast {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	background: var(--primary-green);
	color: white;
	padding: 1rem 1.5rem;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 10000;
	font-size: 0.875rem;
	font-weight: 500;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.3s ease;
	max-width: 300px;
}

.cw-news-toast.show {
	opacity: 1;
	transform: translateY(0);
}

.cw-news-toast.error {
	background: #ef4444;
}

.cw-news-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cw-news-item {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	box-sizing: border-box;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: all 0.2s ease;
	position: relative;
	overflow: visible;
	display: flex;
	flex-direction: column;
	min-height: auto;
	cursor: pointer;
}

.cw-news-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
	border-color: var(--primary-green);
}

.cw-news-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--primary-green), #8b5cf6);
}

/* Highlighting for new articles */
.cw-news-item-new {
	background: #f0fdf4;
	border-color: #40AB26;
	border-width: 2px;
	box-shadow: 0 2px 8px rgba(64, 171, 38, 0.2);
}

.cw-news-item-new .cw-news-title {
	color: #40AB26;
	font-weight: 700;
}

.cw-news-item-new::before {
	height: 4px;
	background: linear-gradient(90deg, #40AB26, #2d7a15);
}

.cw-news-new-badge {
	display: inline-block;
	background: #40AB26;
	color: white;
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.2rem 0.5rem;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-left: 0.5rem;
	animation: pulse 2s infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.7;
	}
}

.cw-news-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.25rem;
}

.cw-news-source {
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
}

.cw-news-date {
	font-size: 0.75rem;
	color: #94a3b8;
}

.cw-news-title {
	margin: 0.5rem 0 0.75rem 0;
	font-size: 1rem;
	font-weight: 600;
	color: #1a202c;
	line-height: 1.4;
}

.cw-news-summary {
	margin: 0 0 0.75rem 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: #4a5568;
}

.cw-news-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.85rem;
	color: var(--primary-green);
	text-decoration: none;
	font-weight: 600;
}

.cw-news-link:hover {
	color: #2d7a15;
	text-decoration: underline;
}

.cw-news-link .material-icons {
	font-size: 16px;
}

.cw-news-card {
	background: #f8fafc;
	border-radius: 8px;
	padding: 1.5rem;
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-top: 0;
}

.cw-no-news {
	font-size: 0.875rem;
	color: #94a3b8;
	text-align: center;
	margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.cw-three-column {
		grid-template-columns: 30fr 40fr 30fr;
		gap: 0.75rem;
	}
}

@media (max-width: 992px) {
	.cw-three-column {
		grid-template-columns: 1fr;
		gap: 1rem;
		width: 100%;
		max-width: 100%;
	}

	.cw-details-column,
	.cw-news-column {
		display: none;
		width: 100%;
		max-width: 100%;
	}

	.cw-body.cw-show-details .cw-details-column,
	.cw-body.cw-show-news .cw-news-column {
		display: flex;
	}

	/* Stack sections on tablets and smaller screens */
	.cw-sections-row {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}

/* Loading Spinner */
.cw-loading-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	padding: 3rem;
	background: #f5f7f9;
	border-radius: 12px;
}

.cw-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid #e5e7eb;
	border-top: 4px solid var(--primary-green);
	border-radius: 50%;
	animation: cw-spin 1s linear infinite;
	margin-bottom: 1rem;
}

.cw-loading-text {
	font-size: 0.875rem;
	color: #64748b;
	margin-top: 0.5rem;
}

@keyframes cw-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

@media (max-width: 768px) {
	.competitor-watch-content {
		padding: 1rem;
	}

	.cw-three-column {
		gap: 0.75rem;
	}

	.cw-info-grid,
	.cw-metrics-grid {
		grid-template-columns: 1fr;
	}

	/* Stack sections vertically on smaller screens */
	.cw-sections-row {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}

/* No details placeholder */
.cw-no-details {
	text-align: center;
	padding: 3rem 1rem;
	color: #64748b;
	font-size: 1rem;
	font-style: italic;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	margin: 1rem 0;
}