/**
 * RobotsFight Core - Frontend Styles
 */

/* CSS Variables */
:root {
	--rf-primary: #1a1a2e;
	--rf-secondary: #16213e;
	--rf-accent: #e94560;
	--rf-accent-hover: #d6304e;
	--rf-light: #eaeaea;
	--rf-dark: #0f0f1a;
	--rf-gray: #6c757d;
	--rf-border: #3a3a5a;
	--rf-success: #28a745;
	--rf-warning: #ffc107;
	--rf-danger: #dc3545;
	--rf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--rf-radius: 6px;
	--rf-shadow: 0 4px 12px rgba(0,0,0,0.15);
	--rf-transition: all 0.2s ease;
}

/* Base */
.rf-fight,
.rf-robot,
.rf-team,
.rf-event {
	font-family: var(--rf-font);
}

/* Fight Archive */
.rf-fight-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.rf-fight-filters {
	background: var(--rf-secondary);
	border-radius: var(--rf-radius);
	padding: 20px;
	margin-bottom: 30px;
	border: 1px solid var(--rf-border);
}

.rf-filters-form {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-end;
}

.rf-filter-group {
	flex: 1;
	min-width: 180px;
}

.rf-filter-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--rf-light);
	font-size: 14px;
}

.rf-filter-group select {
	width: 100%;
	padding: 10px 12px;
	background: var(--rf-dark);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	color: var(--rf-light);
	font-size: 14px;
}

.rf-filter-group select:focus {
	outline: none;
	border-color: var(--rf-accent);
	box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.rf-filter-submit {
	display: flex;
	gap: 10px;
}

.rf-fight-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* Fight Card */
.rf-fight-card {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	overflow: hidden;
	transition: var(--rf-transition);
}

.rf-fight-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--rf-shadow);
	border-color: var(--rf-accent);
}

.rf-fight-card-thumbnail {
	position: relative;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: var(--rf-dark);
}

.rf-fight-card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.rf-fight-card:hover .rf-fight-card-thumbnail img {
	transform: scale(1.05);
}

.rf-placeholder-thumbnail {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--rf-gray);
	font-size: 14px;
}

.rf-play-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.4);
	opacity: 0;
	transition: opacity 0.2s ease;
	color: #fff;
}

.rf-fight-card:hover .rf-play-overlay {
	opacity: 1;
}

.rf-play-overlay svg {
	width: 64px;
	height: 64px;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.rf-duration {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0,0,0,0.85);
	color: #fff;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.rf-fight-card-content {
	padding: 16px;
}

.rf-fight-card-header {
	margin-bottom: 12px;
}

.rf-fight-card-title {
	margin: 0 0 6px;
	font-size: 16px;
	line-height: 1.3;
}

.rf-fight-card-title a {
	color: var(--rf-light);
	text-decoration: none;
	transition: color 0.2s ease;
}

.rf-fight-card-title a:hover {
	color: var(--rf-accent);
}

.rf-fight-card-meta {
	font-size: 12px;
	color: var(--rf-gray);
}

.rf-fight-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.rf-badge {
	display: inline-block;
	padding: 2px 8px;
	background: var(--rf-dark);
	border: 1px solid var(--rf-border);
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--rf-light);
}

.rf-badge-weight {
	border-color: var(--rf-accent);
	color: var(--rf-accent);
}

.rf-badge-victory {
	border-color: var(--rf-success);
	color: var(--rf-success);
}

.rf-fight-card-taxonomy {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.rf-tag {
	display: inline-block;
	padding: 2px 8px;
	background: rgba(233, 69, 96, 0.15);
	border-radius: 20px;
	font-size: 11px;
	color: var(--rf-accent);
	text-decoration: none;
	transition: var(--rf-transition);
}

.rf-tag:hover {
	background: var(--rf-accent);
	color: #fff;
}

.rf-fight-card-excerpt {
	font-size: 13px;
	color: var(--rf-gray);
	line-height: 1.5;
	margin-bottom: 12px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rf-fight-card-footer {
	border-top: 1px solid var(--rf-border);
	padding-top: 12px;
}

.rf-fight-card-footer .button {
	width: 100%;
	text-align: center;
}

/* Pagination */
.rf-pagination {
	margin-top: 40px;
	text-align: center;
}

.rf-pagination .page-numbers {
	display: inline-block;
	padding: 8px 16px;
	margin: 0 4px;
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	color: var(--rf-light);
	text-decoration: none;
	transition: var(--rf-transition);
}

.rf-pagination .page-numbers:hover,
.rf-pagination .page-numbers.current {
	background: var(--rf-accent);
	border-color: var(--rf-accent);
	color: #fff;
}

.rf-pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent;
	color: var(--rf-gray);
	cursor: default;
}

.rf-load-more-wrapper {
	text-align: center;
	margin-top: 30px;
}

.rf-load-more-btn {
	padding: 14px 32px;
	font-size: 16px;
	font-weight: 600;
}

.rf-loading-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-left: 10px;
	border: 2px solid transparent;
	border-top-color: currentColor;
	border-radius: 50%;
	animation: rf-spin 0.8s linear infinite;
	vertical-align: middle;
}

@keyframes rf-spin {
	to { transform: rotate(360deg); }
}

/* Single Fight */
.rf-single-fight {
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
}

.rf-fight-header {
	margin-bottom: 30px;
}

.rf-fight-header h1 {
	font-size: 2.5rem;
	margin-bottom: 16px;
	color: var(--rf-light);
}

.rf-fight-meta-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
	font-size: 14px;
	color: var(--rf-gray);
}

.rf-fight-meta-bar a {
	color: var(--rf-accent);
	text-decoration: none;
}

.rf-fight-meta-bar a:hover {
	text-decoration: underline;
}

.rf-video-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	border-radius: var(--rf-radius);
	overflow: hidden;
	background: #000;
	margin-bottom: 30px;
}

.rf-video-wrapper iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.rf-fight-content {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 40px;
}

.rf-fight-main {
	min-width: 0;
}

.rf-fight-sidebar {
	position: sticky;
	top: 100px;
}

.rf-fight-section {
	margin-bottom: 40px;
}

.rf-fight-section h2 {
	font-size: 1.5rem;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--rf-accent);
	color: var(--rf-light);
}

.rf-fight-meta {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	padding: 20px;
}

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

.rf-meta-table th,
.rf-meta-table td {
	padding: 10px 0;
	border-bottom: 1px solid var(--rf-border);
}

.rf-meta-table th {
	width: 160px;
	font-weight: 600;
	color: var(--rf-gray);
	text-align: left;
}

.rf-meta-table td {
	color: var(--rf-light);
}

.rf-meta-table tr:last-child th,
.rf-meta-table tr:last-child td {
	border-bottom: none;
}

.rf-fight-participants h4 {
	margin-bottom: 12px;
	color: var(--rf-light);
}

.rf-participants-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.rf-participant {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	background: var(--rf-dark);
	border-radius: var(--rf-radius);
	margin-bottom: 8px;
}

.rf-participant:last-child {
	margin-bottom: 0;
}

.rf-participant-robot {
	font-weight: 600;
	color: var(--rf-light);
	text-decoration: none;
}

.rf-participant-robot:hover {
	color: var(--rf-accent);
}

.rf-participant-team {
	font-size: 13px;
	color: var(--rf-gray);
}

.rf-participant-team a {
	color: var(--rf-accent);
	text-decoration: none;
}

.rf-winner-badge {
	margin-left: auto;
	background: var(--rf-success);
	color: #fff;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
}

.rf-editorial-summary {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	padding: 20px;
}

.rf-editorial-summary h4 {
	margin-bottom: 12px;
	color: var(--rf-light);
}

.rf-summary-content {
	line-height: 1.7;
	color: var(--rf-light);
}

.rf-related-fights {
	margin-top: 40px;
}

.rf-related-fights h3 {
	font-size: 1.5rem;
	margin-bottom: 20px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--rf-accent);
	color: var(--rf-light);
}

.rf-related-fights-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

/* Robot/Team/Event Cards */
.rf-robot-card,
.rf-team-card,
.rf-event-card {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	overflow: hidden;
	transition: var(--rf-transition);
}

.rf-robot-card:hover,
.rf-team-card:hover,
.rf-event-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--rf-shadow);
	border-color: var(--rf-accent);
}

.rf-card-thumbnail {
	aspect-ratio: 1/1;
	overflow: hidden;
	background: var(--rf-dark);
}

.rf-card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.rf-robot-card:hover .rf-card-thumbnail img,
.rf-team-card:hover .rf-card-thumbnail img,
.rf-event-card:hover .rf-card-thumbnail img {
	transform: scale(1.05);
}

.rf-card-content {
	padding: 16px;
}

.rf-card-title {
	margin: 0 0 8px;
	font-size: 16px;
}

.rf-card-title a {
	color: var(--rf-light);
	text-decoration: none;
}

.rf-card-title a:hover {
	color: var(--rf-accent);
}

.rf-card-meta {
	font-size: 13px;
	color: var(--rf-gray);
}

/* Submit Form */
.rf-submit-fight-form-wrapper {
	max-width: 700px;
	margin: 0 auto;
	padding: 20px;
}

.rf-submit-fight-form-wrapper h2 {
	margin-bottom: 8px;
	color: var(--rf-light);
}

.rf-submit-intro {
	color: var(--rf-gray);
	margin-bottom: 30px;
}

.rf-form {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	padding: 30px;
}

.rf-form-group {
	margin-bottom: 20px;
}

.rf-form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--rf-light);
}

.rf-form-group input[type="text"],
.rf-form-group input[type="url"],
.rf-form-group input[type="date"],
.rf-form-group select,
.rf-form-group textarea {
	width: 100%;
	padding: 10px 12px;
	background: var(--rf-dark);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	color: var(--rf-light);
	font-size: 14px;
	font-family: inherit;
}

.rf-form-group input:focus,
.rf-form-group select:focus,
.rf-form-group textarea:focus {
	outline: none;
	border-color: var(--rf-accent);
	box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.rf-form-group textarea {
	min-height: 100px;
	resize: vertical;
}

.rf-form-help {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--rf-gray);
}

.rf-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.rf-form-agreement {
	margin: 20px 0;
}

.rf-form-agreement label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	color: var(--rf-gray);
	cursor: pointer;
}

.rf-form-agreement input[type="checkbox"] {
	margin-top: 2px;
	accent-color: var(--rf-accent);
}

.rf-form-agreement a {
	color: var(--rf-accent);
}

.rf-form-actions {
	margin-top: 30px;
	text-align: center;
}

.rf-btn-loading {
	display: none;
}

.rf-form-message {
	margin-top: 20px;
	padding: 16px;
	border-radius: var(--rf-radius);
	display: none;
}

.rf-form-message.success {
	background: rgba(40, 167, 69, 0.2);
	border: 1px solid var(--rf-success);
	color: var(--rf-success);
}

.rf-form-message.error {
	background: rgba(220, 53, 69, 0.2);
	border: 1px solid var(--rf-danger);
	color: var(--rf-danger);
}

/* Video Preview */
.rf-video-preview {
	margin-top: 12px;
	border-radius: var(--rf-radius);
	overflow: hidden;
	background: var(--rf-dark);
}

.rf-video-preview iframe {
	width: 100%;
	aspect-ratio: 16/9;
	border: none;
}

/* Popular/Recent Fights */
.rf-popular-fights,
.rf-recent-fights {
	background: var(--rf-secondary);
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	padding: 20px;
}

.rf-popular-fights h3,
.rf-recent-fights h3 {
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--rf-accent);
	color: var(--rf-light);
	font-size: 1.25rem;
}

.rf-popular-fights-list,
.rf-recent-fights-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.rf-popular-fight-item,
.rf-recent-fight-item {
	display: flex;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rf-border);
}

.rf-popular-fight-item:last-child,
.rf-recent-fight-item:last-child {
	border-bottom: none;
}

.rf-popular-fight-thumb,
.rf-recent-fight-thumb {
	width: 160px;
	height: 90px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
}

.rf-popular-fight-thumb img,
.rf-recent-fight-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rf-popular-fight-info,
.rf-recent-fight-info {
	flex: 1;
	min-width: 0;
}

.rf-popular-fight-title,
.rf-recent-fight-title {
	display: block;
	color: var(--rf-light);
	text-decoration: none;
	font-weight: 500;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rf-popular-fight-title:hover,
.rf-recent-fight-title:hover {
	color: var(--rf-accent);
}

.rf-popular-fight-date,
.rf-recent-fight-date {
	font-size: 12px;
	color: var(--rf-gray);
}

/* Breadcrumbs */
.rf-breadcrumbs {
	margin-bottom: 20px;
	font-size: 14px;
}

.rf-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.rf-breadcrumbs li {
	display: flex;
	align-items: center;
}

.rf-breadcrumbs li:not(:last-child)::after {
	content: '/';
	margin-left: 8px;
	color: var(--rf-gray);
}

.rf-breadcrumbs a {
	color: var(--rf-accent);
	text-decoration: none;
}

.rf-breadcrumbs a:hover {
	text-decoration: underline;
}

.rf-breadcrumbs span {
	color: var(--rf-gray);
}

/* Ads */
.rf-ad {
	margin: 20px 0;
	text-align: center;
	clear: both;
}

/* Responsive */
@media (max-width: 768px) {
	.rf-fight-grid {
		grid-template-columns: 1fr;
	}

	.rf-fight-content {
		grid-template-columns: 1fr;
	}

	.rf-fight-sidebar {
		position: static;
	}

	.rf-form-row {
		grid-template-columns: 1fr;
	}

	.rf-filters-form {
		flex-direction: column;
		align-items: stretch;
	}

	.rf-filter-submit {
		justify-content: flex-start;
	}
}

@media (max-width: 480px) {
	.rf-fight-header h1 {
		font-size: 1.75rem;
	}

	.rf-fight-card-thumbnail {
		aspect-ratio: 16/9;
	}
}

/* Print */
@media print {
	.rf-fight-filters,
	.rf-pagination,
	.rf-load-more-wrapper,
	.rf-form-actions,
	.rf-ad {
		display: none !important;
	}
}