/* Modern styling for cadistas1910.com pages */

/* Page Container */
.page-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Intro Container */
.intro-container {
	background: transparent;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: none;
}

.intro-container p {
	font-size: 16px;
	line-height: 1.6;
	margin: 0;
}

/* Form Container */
.form-container {
	background: #fff;
	padding: 24px;
	border-radius: 8px;
	margin: 20px 0 40px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	position: relative;
	overflow: visible;
}

.form-container select,
.form-container input[type="text"],
.form-container input[type="search"] {
	padding: 10px 14px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	font-size: 15px;
	transition: all 0.3s ease;
	width: 100%;
	box-sizing: border-box;
	background: #fff;
}

.form-container select:focus,
.form-container input[type="text"]:focus,
.form-container input[type="search"]:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Search Container */
.search-container {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	margin: 20px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	display: flex;
	gap: 10px;
	align-items: center;
}

.search-input {
	padding: 10px 14px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	font-size: 15px;
	transition: all 0.3s ease;
	flex: 1;
	box-sizing: border-box;
	background: #fff;
}

.search-input:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-button {
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	background: #2196F3;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.search-button:hover {
	background: #1976D2;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Buttons */
.botonazul2 {
	padding: 12px 32px;
	border-radius: 6px;
	transition: all 0.3s ease;
	cursor: pointer;
	font-size: 16px;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	white-space: nowrap;
	overflow: visible;
}

.botonazul2:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Results Container */
.results-container {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Override results-container background when inside w3-white container */
.w3-white .results-container {
	background: transparent;
	box-shadow: none;
}

/* Specific styles for busca pages - wider containers (800px + 100px = 900px) */
/* Override parent container width for busca pages */
.w3-content-800:has(> .search-container-modern),
.w3-content-800:has(> .results-container) {
	max-width: 900px !important;
}

.w3-content-1000:has(> .search-container-modern),
.w3-content-1000:has(> .results-container) {
	max-width: 1000px !important;
}

.w3-content-1200:has(> .search-container-modern),
.w3-content-1200:has(> .results-container) {
	max-width: 1200px !important;
}

.w3-content-800 > .search-container-modern {
	max-width: 900px !important;
	margin-left: auto;
	margin-right: auto;
}

.w3-content-800 > .results-container {
	max-width: 900px !important;
	margin-left: auto;
	margin-right: auto;
}

.w3-content-1000 > .results-container {
	max-width: 1000px !important;
	margin-left: auto;
	margin-right: auto;
}

.w3-content-1200 > .results-container {
	max-width: 1200px !important;
	margin-left: auto;
	margin-right: auto;
}

/* Allow results-container to not constrain width when it contains w3-content-1000 or w3-content-1200 */
.results-container .w3-content-1000,
.w3-white .results-container .w3-content-1000,
#txtHint .results-container .w3-content-1000,
.results-container .w3-content-1200,
.w3-white .results-container .w3-content-1200,
#txtHint .results-container .w3-content-1200 {
	width: 100% !important;
}

/* Remove max-width constraint and horizontal padding from results-container when it contains w3-content-1000 or w3-content-1200 */
.results-container:has(> .w3-content-1000),
.results-container:has(.w3-content-1000),
.results-container:has(> .w3-content-1200),
.results-container:has(.w3-content-1200),
#txtHint:has(.w3-content-1000),
#txtHint:has(.w3-content-1200) {
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	width: auto !important;
}

/* Tables */
.rTable {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	background: #fff;
	/* Keep table display for proper alignment */
	display: table;
	width: 100%;
}

/* Ensure w3-content-1000 is actually 1000px when it contains rTable */
.w3-content-1000:has(.rTable),
.results-container .w3-content-1000:has(.rTable),
#txtHint .w3-content-1000:has(.rTable) {
	max-width: 1000px !important;
	min-width: 1000px !important;
}

/* Ensure w3-content-1200 is actually 1200px when it contains rTable - very specific selectors */
div.w3-content-1200:has(.rTable),
div.results-container div.w3-content-1200:has(.rTable),
div#txtHint div.w3-content-1200:has(.rTable),
div.w3-white div.results-container div.w3-content-1200:has(.rTable) {
	max-width: 1200px !important;
	width: 1200px !important;
	min-width: 1200px !important;
}

/* Ensure rTable expands fully when inside w3-content-1200 (exclude legend which is in w3-content-200) - very specific */
div.w3-content-1200 > div.rTable,
div.w3-content-1200 div.rTable:not(div.w3-content-200 div.rTable),
div.results-container div.w3-content-1200 div.rTable:not(div.w3-content-200 div.rTable),
div#txtHint div.w3-content-1200 div.rTable:not(div.w3-content-200 div.rTable) {
	width: 1200px !important;
	max-width: 1200px !important;
	min-width: 1200px !important;
	display: table !important;
}

/* Exclude legend table from width expansion */
.w3-content-200 .rTable {
	width: auto !important;
	max-width: 200px !important;
}

.rTableRow {
	transition: all 0.2s ease;
	border-bottom: 1px solid #f0f0f0;
	/* Keep table-row display for proper cell alignment */
	display: table-row;
}

.rTableRow:hover {
	background: #f8f9fa;
	transform: translateX(2px);
}

.rTableRow:last-child {
	border-bottom: none;
}

.rTableHeading,
.rTableHeadingYellow {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	font-weight: 600;
	/* Keep table-header-group display for proper alignment */
	display: table-header-group;
}

/* Override for regular HTML table rows */
table .rTableHeading,
table .rTableHeadingYellow {
	display: table-row;
}

.rTableHeading .rTableHead,
.rTableHeadingYellow .rTableHead {
	color: #fff !important;
}

/* Ensure links in table headers are also white */
.rTableHeading .rTableHead a,
.rTableHeadingYellow .rTableHead a,
.rTableHeading .rTableHead .enlace_nosub,
.rTableHeadingYellow .rTableHead .enlace_nosub {
	color: #fff !important;
}

.rTableHeading .rTableHead a:hover,
.rTableHeadingYellow .rTableHead a:hover,
.rTableHeading .rTableHead .enlace_nosub:hover,
.rTableHeadingYellow .rTableHead .enlace_nosub:hover {
	color: #fff !important;
	text-decoration: underline;
}

.rTableHead {
	padding: 16px;
	font-size: 15px;
	letter-spacing: 0.5px;
	/* Keep table-cell display for proper alignment */
	display: table-cell;
	vertical-align: middle;
}

.rTableCell {
	padding: 16px;
	vertical-align: middle;
	/* Keep table-cell display for proper alignment */
	display: table-cell;
}

.rTableCell a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rTableCell a:hover {
	color: #2196F3;
	text-decoration: underline;
}

/* Table cell wrapping */
.rTableCell.allow-wrap {
	white-space: normal !important;
	word-break: keep-all;
}

.rTableCell.no-wrap {
	white-space: nowrap;
}

/* Fix for hidden cells in tables - ensure they don't create gaps */
@media all and (min-width: 480px) {
	.rTable .divocultogrande.rTableCell,
	.rTable .divocultogrande.rTableHead {
		display: none !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		border: none !important;
		min-width: 0 !important;
		max-width: 0 !important;
		overflow: hidden !important;
	}
}

/* Circular Portrait Images */
.circular--portrait {
	position: relative;
	width: 60px;
	height: 60px;
	overflow: hidden;
	border-radius: 50%;
	margin: 0 auto;
	border: 2px solid #e0e0e0;
}

.cropimage {
	display: inline;
	margin-left: -4px;
	margin-right: -4px;
	margin-top: -4px;
	margin-bottom: -4px;
	height: 120%;
	width: 115%;
	object-fit: cover;
}

/* Links */
.enlace_nosub {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.enlace_nosub:hover {
	color: #2196F3;
	text-decoration: underline;
}

/* Articles List */
.articles-list-container {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-item {
	background: #fff;
	padding: 20px;
	margin-bottom: 16px;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	transition: all 0.2s ease;
}

.article-item:hover {
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	transform: translateY(-2px);
}

.article-item:last-child {
	margin-bottom: 0;
}

/* Description Container */
.description-container {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Chart containers */
#piechart1, #piechart2, #piechart3 {
	background: transparent !important;
}

/* Legend Container */
.legend-container {
	background: transparent;
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 24px;
	box-shadow: none;
	display: flex;
	justify-content: center;
}

.legend-table {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	background: #fff;
	/* Allow legend table to size naturally */
	width: auto;
	min-width: 200px;
	display: table;
}

.legend-table .rTableRow {
	border-radius: 6px;
	margin-bottom: 8px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.legend-table .rTableRow:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Historial specific */
.historial-container {
	background: transparent;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: none;
}

.historial-intro {
	background: transparent;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 24px;
	box-shadow: none;
}

/* Search container modern variant */
.search-container-modern {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	margin: 20px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}


/* Search inputs */
#cadena_buscar,
#search_presidente,
#myInput {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	font-size: 16px;
	transition: all 0.3s ease;
	box-sizing: border-box;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: none;
	background: #fff;
}

#cadena_buscar:focus,
#search_presidente:focus,
#myInput:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
	background-image: none;
	background: #fff;
}

/* Remove webkit search decoration (grey loupe) */
#myInput::-webkit-search-decoration,
#myInput::-webkit-search-cancel-button,
#myInput::-webkit-search-results-button,
#myInput::-webkit-search-results-decoration {
	-webkit-appearance: none;
	display: none;
}

/* Clear button */
.btn-clear {
	width: 100%;
	padding: 12px 16px;
	background: #2196F3;
	border: 2px solid #2196F3;
	border-radius: 6px;
	cursor: pointer;
	font-size: 16px;
	transition: all 0.3s ease;
	color: #fff;
	text-align: center;
	font-weight: 500;
}

.btn-clear:hover {
	background: #1976D2;
	border-color: #1976D2;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Presidents container */
.presidents-container {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#presidentes_table {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	background: #fff;
}

#presidentes_table .rTableRow {
	transition: all 0.2s ease;
	border-bottom: 1px solid #f0f0f0;
}

#presidentes_table .rTableRow:hover {
	background: #f8f9fa;
	transform: translateX(2px);
}

#presidentes_table .rTableRow:last-child {
	border-bottom: none;
}

#presidentes_table .rTableHeading {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	font-weight: 600;
}

#presidentes_table .rTableHead {
	padding: 16px;
	font-size: 15px;
	letter-spacing: 0.5px;
}

#presidentes_table .rTableCell {
	padding: 16px;
	vertical-align: middle;
}

#presidentes_table .rTableCell40 a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
	font-size: 16px;
}

#presidentes_table .rTableCell40 a:hover {
	color: #2196F3;
	text-decoration: underline;
}

/* Table cell variants */
.rTableCell40 a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
	font-size: 16px;
}

.rTableCell40 a:hover {
	color: #2196F3;
	text-decoration: underline;
}

/* Circular portrait image enhancements */
.circular--portrait img,
.circular--portraitmed img {
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	transition: transform 0.2s ease;
}

.rTableRow:hover .circular--portrait img,
.rTableRow:hover .circular--portraitmed img {
	transform: scale(1.05);
}

/* No results message */
#no_results_msg {
	padding: 40px 20px;
	text-align: center;
	color: #666;
	font-style: italic;
}

/* Articles container */
.articles-container {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.articles-list {
	background: #fff;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.articles-list a {
	display: block;
	padding: 12px 16px;
	margin-bottom: 8px;
	color: #333;
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	border-radius: 6px;
	transition: all 0.2s ease;
	border-left: 4px solid transparent;
}

.articles-list a:hover {
	background: #f8f9fa;
	color: #2196F3;
	border-left-color: #2196F3;
	transform: translateX(4px);
}

/* Intro container text alignment */
.intro-container.text-center {
	text-align: center;
}

/* Page heading */
h1 {
	margin: 20px 0;
	text-align: center;
}

