/* ---------- ORIGINAL BASE STYLES ---------- */
/* Body */
body {
	height: 100vh;
	overflow: hidden;
	margin: 0;
}

/* Map Container */
#graph {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Remove default graph borders if any */
#patternGraph {
	border: none;
}

/* ---------- MODAL OVERLAY & CONTAINER ---------- */
#modal {
	display: none; /* Hidden by default */
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(255, 255, 255, 0.95); /* High opacity white background */
	backdrop-filter: blur(2px);
}

#modalContent {
	width: 94%;
	max-width: 1400px;
	margin: 4% auto; /* Center vertically/horizontally */
	background: #F2F2F2; /* Matches body background as requested */
	padding: 30px;
	border: 1px solid #ddd;
	box-shadow: 0 10px 40px rgba(0,0,0,0.1);
	border-radius: 4px;
	position: relative;
	box-sizing: border-box;
}

/* Close Button */
#modalClose {
	position: absolute;
	top: 20px;
	right: 20px;
	background: transparent;
	border: 1px solid #ccc;
	color: #666;
	cursor: pointer;
	padding: 5px 15px;
	text-transform: uppercase;
	font-size: 12px;
	border-radius: 4px;
	z-index: 10;
}
#modalClose:hover {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* ---------- MODAL LAYOUT ---------- */

/* The main flex container holding Graph (Left) and Details (Right) */
.modal-row {
	display: flex;
	flex-direction: row;
	gap: 30px;
	align-items: flex-start;
}

/* Left Column: Mini Graph */
.modal-col.graph-col {
	width: 300px; /* Fixed width for the graph column */
	flex-shrink: 0;
}

#miniGraph {
	background: #fff;
	border-radius: 8px;
	width: 100%;
	height: 300px;
	border: 1px solid #e0e0e0;
}

/* Right Side: Title + 3 Columns */
.modal-right {
	flex-grow: 1;
	display: grid;
	/* 3 Equal columns for Rep / Behavior / Workplace */
	grid-template-columns: 1fr 1fr 1fr; 
	gap: 30px;
}

/* Make the Main Title span all 3 columns */
.modal-right > .titleGroup {
	grid-column: 1 / -1; /* Span from line 1 to end */
	margin-top: 0;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #ccc;
}

/* Specific styling for the 3 detail columns */
.modal-right .modal-col {
	min-width: 0; /* Prevents text overflow issues */
}

/* ---------- TYPOGRAPHY & TAGS ---------- */
h2#repTitle {
	font-size: 36px;
	line-height: 1.1em;
	font-weight: normal;
	color: #333;
	margin:0;
}

#modal h3 {
	margin: 20px 0 10px 0;
	font-weight:bold;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #333;
}

/* Small labels (REPRESENTATION, BEHAVIORS, WORKPLACE) */
#modal .label {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 10px;
	font-weight: bold;
	color: #fff;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Tag Colors */
.tag-representation { background-color: #60A6AD; }
.tag-behavior       { background-color: #F2B400; }
.tag-workplace      { background-color: #EC8CA4; }

/* Description text under Representation tag */
#repDescr {
	font-size: 16px;
	line-height: 1.5;
	color: #555;
	text-transform: none; /* Override default H3 uppercase */
	margin-top: 0;
}

/* ---------- VERBATIM LISTS ---------- */
#modal .verbatim-list {
	list-style-type: none;
	margin: 0;
	padding: 0;
	color: #444;
}

#modal .verbatim-list > li {
	margin: 8px 0;
	padding: 8px 12px;
	background: #fff;
	border-left: 4px solid #ccc;
	font-size: 13px;
	line-height: 1.4em;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* List Border Colors matching tags */
#col-representation .verbatim-list > li { border-left-color: #60A6AD; }
#col-behavior .verbatim-list > li       { border-left-color: #F2B400; }
#col-workplace .verbatim-list > li      { border-left-color: #EC8CA4; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
	.modal-row {
		flex-direction: column; /* Stack Graph on top of Details */
	}
	
	.modal-col.graph-col {
		width: 100%;
		margin-bottom: 30px;
	}
	
	.modal-right {
		grid-template-columns: 1fr; /* Stack the 3 columns vertically */
		width: 100%;
	}
	
	#miniGraph {
		height: 200px;
	}
}