/**
 * Event Profile History Styles
 */

/* ==========================================================================
   Main Container
   ========================================================================== */

.event-profile-history {
	max-width: 1200px;
	margin: 0 auto;
	padding-bottom: 20px;
}

/* ==========================================================================
   Current Event
   ========================================================================== */

.event-profile-current {
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	padding: 40px;
	margin-bottom: 60px;
}

.event-header-large {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
	margin-bottom: 30px;
	border-bottom: 3px solid rgba(0, 0, 0, 0.1);
	padding-bottom: 20px;
}

.event-header-left {
	flex: 0 0 auto;
}

.event-header-right {
	flex: 0 0 auto;
}

.car-photo-header {
	max-height: 220px;
	width: auto;
	max-width: 480px;
	display: block;
	background-color: white;
	background-size: 12px 12px;
	background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.event-year {
	font-size: 3.5em;
	font-weight: 800;
	color: #2c3e50;
	margin: 0;
	line-height: 1;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.event-title {
	font-size: 1.8em;
	color: #34495e;
	margin: 10px 0 20px 0;
	font-weight: 600;
}

.event-meta {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 15px;
}

.car-number {
	font-size: 1.4em;
	font-weight: 700;
	color: #2c3e50;
	background: white;
	padding: 8px 20px;
	border-radius: 25px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.car-name-badge {
	font-size: 1.1em;
	font-weight: 600;
	color: #2c3e50;
	background: rgba(255, 255, 255, 0.7);
	padding: 8px 18px;
	border-radius: 25px;
	font-style: italic;
}

/* Status Badges */
.status-badge {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 25px;
	font-weight: 700;
	font-size: 1.1em;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.status-active   { background-color: #27ae60; color: white; }
.status-pending  { background-color: #f39c12; color: white; }
.status-waiting  { background-color: #3498db; color: white; }
.status-withdrawn { background-color: #95a5a6; color: white; }

/* ==========================================================================
   Content Grid: Image + Info
   ========================================================================== */

.event-content-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	gap: 30px;
	align-items: start;
	margin-bottom: 30px;
}

/* When there is no image, info takes full width */
.event-content-grid:has(.event-info-col:only-child),
.event-content-grid .event-info-col:only-child {
	grid-column: 1 / -1;
}

/* Car Image Column */
.event-car-image-col {
	position: relative;
}

.car-image-wrapper {
	position: relative;
	background: #1a1a2e;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.car-photo {
	display: block;
	width: 100%;
	height: auto;
	background-color: white;
	background-size: 12px 12px;
	background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.image-check-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.8em;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 5px;
}

.image-check-badge.passed  { background: #27ae60; color: white; }
.image-check-badge.failed  { background: #e74c3c; color: white; }
.image-check-badge.pending { background: rgba(0,0,0,0.55); color: white; }

/* Info Column */
.event-info-col {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Magazine Section */
.magazine-section {
	background: white;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.magazine-section h4 {
	color: #2c3e50;
	font-size: 1.3em;
	margin: 0 0 15px 0;
	border-bottom: 2px solid #3498db;
	padding-bottom: 8px;
}

.magazine-text {
	font-size: 1em;
	line-height: 1.8;
	color: #34495e;
}

.keywords-section {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #ecf0f1;
}

.keywords-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.keyword-tag {
	display: inline-block;
	background-color: #3498db;
	color: white;
	padding: 5px 14px;
	border-radius: 20px;
	font-size: 0.9em;
	font-weight: 600;
}

/* Upload Section */
.upload-section {
	background: white;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
	text-align: center;
}

.upload-section h4 {
	color: #2c3e50;
	font-size: 1.3em;
	margin: 0 0 15px 0;
}

.download-button {
	display: inline-block;
	background-color: #27ae60;
	color: white;
	padding: 10px 25px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 1em;
	transition: background-color 0.2s ease;
}

.download-button:hover { background-color: #229954; }
.download-button i { margin-right: 8px; }

.upload-date {
	display: block;
	margin-top: 10px;
	color: #7f8c8d;
	font-size: 0.85em;
}

/* ==========================================================================
   Car Specs – full-width below grid
   ========================================================================== */

.car-specs-section {
	background: white;
	padding: 25px;
	box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.car-specs-section h4 {
	color: #2c3e50;
	font-size: 1.3em;
	margin: 0 0 20px 0;
	border-bottom: 2px solid #e74c3c;
	padding-bottom: 8px;
}

.specs-groups-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 25px;
}

.specs-group h5 {
	color: #34495e;
	font-size: 1em;
	margin: 0 0 10px 0;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.specs-table {
	width: 100%;
	border-collapse: collapse;
}

.specs-table tr { border-bottom: 1px solid #ecf0f1; }
.specs-table tr:hover { background-color: #f8f9fa; }

.specs-table th {
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	color: #2c3e50;
	width: 45%;
	background-color: #f5f7fa;
}

.specs-table td {
	padding: 10px 12px;
	color: #34495e;
}

/* ==========================================================================
   Past Events – Grid of Cards
   ========================================================================== */

.event-timeline {
	background-color: var(--gray-f8);
	padding: 1px 20px 20px 20px;
	margin-top: 30px;
}

.timeline-header {
	font-size: 2em;
	color: #2c3e50;
	margin-bottom: 30px;
	text-align: center;
	font-weight: 700;
}

.timeline-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
	align-items: start;
}

/* Timeline Card */
.timeline-card {
	background: white;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.timeline-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
	transform: translateY(-3px);
}

/* Thumbnail from photorealistic PNG */
.timeline-card-image {
	background: #1a1a2e;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.card-car-photo {
	width: 100%;
	height: 200px;
	aspect-ratio: 2.134 / 1;
	object-fit: contain;
	background: white;
	background-size: 12px 12px;
}

.timeline-card-header {
	display: flex;
	align-items: center;
	padding: 16px 20px;
	cursor: pointer;
	background: linear-gradient(135deg, var(--fsg_cyan_light) 0%, var(--fsg_blue) 100%);
	color: white;
}

.timeline-card-header:hover {
	background: linear-gradient(135deg, var(--fsg_cyan_deep) 0%, var(--fsg_blue) 100%);
}

.timeline-year {
	font-size: 2em;
	font-weight: 800;
	min-width: 90px;
	text-align: center;
}

.timeline-summary {
	flex: 1;
	padding: 0 15px;
}

.timeline-summary h4 {
	margin: 0 0 6px 0;
	font-size: 1.1em;
	font-weight: 600;
}

.timeline-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.car-number-small {
	font-weight: 700;
	background: rgba(255, 255, 255, 0.2);
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 0.85em;
}

.car-name-small {
	font-style: italic;
	font-size: 0.85em;
	opacity: 0.9;
}

.status-badge-small {
	padding: 3px 10px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.8em;
	text-transform: uppercase;
}

.expand-indicator {
	font-size: 1.2em;
	transition: transform 0.3s ease;
	margin-left: 8px;
}

.timeline-card.expanded .expand-indicator {
	transform: rotate(180deg);
}

/* Card Content: hidden by default, shown when parent has .expanded */
.timeline-card-content {
	padding: 20px;
	background: white;
	flex: 1;
	display: none;
}

.timeline-card.expanded .timeline-card-content {
	display: block;
}

.magazine-section-compact {
	background: white;
	padding: 16px;
	margin-bottom: 15px;
}

.magazine-section-compact h5 {
	color: #2c3e50;
	font-size: 1em;
	margin: 0 0 10px 0;
	border-bottom: 2px solid #3498db;
	padding-bottom: 6px;
}

.magazine-text-compact {
	font-size: 0.95em;
	line-height: 1.6;
	color: #34495e;
}

.keywords-section-compact {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ecf0f1;
	font-size: 0.9em;
}

.keyword-tag-small {
	display: inline-block;
	background-color: #3498db;
	color: white;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 0.82em;
	font-weight: 600;
	margin: 2px;
}

.no-magazine-info {
	color: #7f8c8d;
	font-style: italic;
	padding: 15px;
	text-align: center;
}

/* Car Specs – Compact */
.car-specs-section-compact {
	background: white;
	padding: 16px;
	border-radius: 6px;
	margin-bottom: 15px;
}

.car-specs-section-compact h5 {
	color: #2c3e50;
	font-size: 1em;
	margin: 0 0 10px 0;
	border-bottom: 2px solid #e74c3c;
	padding-bottom: 6px;
}

.specs-collapsible {
	margin-bottom: 10px;
	border: 1px solid #ecf0f1;
	border-radius: 4px;
	overflow: hidden;
}

.specs-collapsible summary {
	padding: 10px 12px;
	background-color: #f5f7fa;
	cursor: pointer;
	font-weight: 600;
	color: #34495e;
}

.specs-collapsible summary:hover { background-color: #e9ecef; }

.specs-table-compact { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.specs-table-compact tr { border-bottom: 1px solid #ecf0f1; }
.specs-table-compact th { text-align: left; padding: 8px 10px; font-weight: 600; color: #2c3e50; width: 45%; background-color: #f8f9fa; }
.specs-table-compact td { padding: 8px 10px; color: #34495e; }

/* Upload compact */
.upload-section-compact {
	background: white;
	padding: 12px 16px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.download-button-small {
	background-color: #27ae60;
	color: white;
	padding: 7px 16px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.download-button-small:hover { background-color: #229954; }
.upload-date-small { color: #7f8c8d; font-size: 0.82em; }

/* Empty states */
.no-current-event,
.no-past-events {
	text-align: center;
	padding: 40px;
	color: #7f8c8d;
	font-size: 1.1em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.event-content-grid {
		grid-template-columns: 1fr;
	}

	.event-car-image-col {
		max-width: 480px;
		margin: 0 auto;
		width: 100%;
	}

	.timeline-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.event-profile-current { padding: 20px; }
	.event-year { font-size: 2.5em; }
	.event-title { font-size: 1.3em; }
	.event-meta { flex-direction: column; gap: 8px; }
	.specs-groups-grid { grid-template-columns: 1fr; }

	.timeline-card-header { flex-wrap: wrap; }
	.timeline-year { font-size: 1.6em; min-width: auto; }

	.upload-section-compact { flex-direction: column; text-align: center; }
}
