/**
 * Tutorial Hub Theme - Vimeo-Style Professional Frontend Styles
 * Modern, creative, and fully responsive design
 */

:root {
	--th-primary: #4f46e5;
	--th-primary-dark: #4338ca;
	--th-secondary: #7c3aed;
	--th-accent: #06b6d4;
	--th-success: #10b981;
	--th-warning: #f59e0b;
	--th-danger: #ef4444;
	--th-dark: #0f172a;
	--th-dark-secondary: #1e293b;
	--th-light: #f8fafc;
	--th-light-secondary: #f1f5f9;
	--th-text: #334155;
	--th-text-light: #64748b;
	--th-border: #e2e8f0;
	--th-white: #ffffff;
	--th-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
	--th-shadow-md: 0 4px 12px rgba(0,0,0,0.12);
	--th-shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
	--th-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--th-border-radius: 12px;
}

* {
	box-sizing: border-box;
}

/* ============================================
   HERO SECTION
   ============================================ */
.th-hero-section {
	position: relative;
	height: 500px;
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 60px;
}

.th-hero-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 60px;
	z-index: 1;
}

.th-hero-container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.4) 100%);
	z-index: -1;
}

.th-hero-content {
	max-width: 550px;
	z-index: 2;
	animation: slideInLeft 0.8s ease-out;
}

.th-hero-title {
	font-size: 3.5rem;
	font-weight: 800;
	color: var(--th-white);
	margin: 0 0 20px 0;
	line-height: 1.2;
	text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.th-hero-description {
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.9);
	margin: 0 0 30px 0;
	line-height: 1.6;
}

.th-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border: none;
	border-radius: var(--th-border-radius);
	font-weight: 600;
	cursor: pointer;
	transition: var(--th-transition);
	text-decoration: none;
	font-size: 1rem;
	white-space: nowrap;
}

.th-btn-primary {
	background: var(--th-primary);
	color: var(--th-white);
}

.th-btn-primary:hover {
	background: var(--th-primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--th-shadow-lg);
}

.th-btn-secondary {
	background: var(--th-white);
	color: var(--th-dark);
	border: 2px solid var(--th-border);
}

.th-btn-secondary:hover {
	border-color: var(--th-primary);
	color: var(--th-primary);
	background: var(--th-light);
}

.th-btn-lg {
	padding: 14px 32px;
	font-size: 1.1rem;
}

.th-btn-icon {
	display: inline-flex;
	font-size: 0.9em;
}

/* Hero Default State */
.th-hero-default {
	background: linear-gradient(135deg, var(--th-primary) 0%, var(--th-secondary) 100%);
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ============================================
   PAGE WRAPPER & LAYOUT
   ============================================ */
.th-main-content {
	width: 100%;
	background: var(--th-white);
}

.th-page-wrapper {
	background: var(--th-light-secondary);
	padding: 40px 20px;
}

.th-layout-container {
	max-width: 1400px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 40px;
}

.th-main-area {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* ============================================
   SHORTS SECTION
   ============================================ */
.th-shorts-section {
	background: var(--th-white);
	padding: 40px;
	border-radius: var(--th-border-radius);
	box-shadow: var(--th-shadow-sm);
}

.th-section-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 30px;
	flex-wrap: wrap;
	gap: 20px;
}

.th-section-title {
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--th-dark);
	margin: 0;
}

.th-section-subtitle {
	font-size: 0.95rem;
	color: var(--th-text-light);
	margin: 8px 0 0 0;
}

.th-view-all {
	color: var(--th-primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	transition: var(--th-transition);
	display: flex;
	align-items: center;
	gap: 4px;
}

.th-view-all:hover {
	color: var(--th-primary-dark);
}

.th-shorts-carousel {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 20px;
	overflow-x: auto;
	scroll-behavior: smooth;
	padding: 10px 0;
}

.th-short-card {
	cursor: pointer;
	transition: var(--th-transition);
}

.th-short-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.th-short-thumbnail {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: 8px;
	overflow: hidden;
	background: var(--th-light-secondary);
	margin-bottom: 10px;
}

.th-short-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--th-transition);
}

.th-short-card:hover .th-short-thumbnail img {
	transform: scale(1.05);
}

.th-short-duration {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.7);
	color: var(--th-white);
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
}

.th-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(79, 70, 229, 0.9);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.2rem;
	opacity: 0;
	transition: var(--th-transition);
}

.th-short-card:hover .th-play-overlay {
	opacity: 1;
}

.th-short-title {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--th-dark);
	margin: 0 0 4px 0;
	line-height: 1.4;
	white-space: normal;
	word-break: break-word;
}

.th-short-meta {
	font-size: 0.8rem;
	color: var(--th-text-light);
	margin: 0;
}

/* ============================================
   FILTER SECTION
   ============================================ */
.th-filter-section {
	background: var(--th-white);
	padding: 30px;
	border-radius: var(--th-border-radius);
	box-shadow: var(--th-shadow-sm);
}

.th-filters-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.th-filters-controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px;
	flex: 1;
}

.th-filter-item {
	display: flex;
	flex-direction: column;
}

.th-filter-input,
.th-filter-select {
	padding: 10px 14px;
	border: 1px solid var(--th-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--th-text);
	background: var(--th-white);
	transition: var(--th-transition);
}

.th-filter-input:focus,
.th-filter-select:focus {
	outline: none;
	border-color: var(--th-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.th-filter-select {
	cursor: pointer;
}

.th-filters-options {
	display: flex;
	align-items: center;
	gap: 15px;
}

.th-autoplay-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 500;
	color: var(--th-text);
	user-select: none;
}

.th-toggle-checkbox {
	cursor: pointer;
	width: 18px;
	height: 18px;
	accent-color: var(--th-primary);
}

/* ============================================
   VIDEO GRID
   ============================================ */
.th-videos-section {
	background: var(--th-white);
	padding: 30px;
	border-radius: var(--th-border-radius);
	box-shadow: var(--th-shadow-sm);
}

.th-videos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}

.th-video-card {
	background: var(--th-white);
	border-radius: 10px;
	overflow: hidden;
	transition: var(--th-transition);
	border: 1px solid var(--th-border);
}

.th-video-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--th-shadow-lg);
	border-color: var(--th-primary);
}

.th-video-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.th-video-thumbnail {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--th-light-secondary);
	overflow: hidden;
}

.th-video-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--th-transition);
}

.th-video-card:hover .th-video-thumbnail img {
	transform: scale(1.05);
}

.th-video-duration {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.8);
	color: var(--th-white);
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	z-index: 2;
}

.th-video-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: var(--th-transition);
	z-index: 1;
}

.th-video-card:hover .th-video-overlay {
	opacity: 1;
}

.th-play-icon {
	width: 50px;
	height: 50px;
	background: rgba(79, 70, 229, 0.9);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.5rem;
	transition: var(--th-transition);
}

.th-video-card:hover .th-play-icon {
	background: rgba(79, 70, 229, 1);
	transform: scale(1.1);
}

.th-video-info {
	padding: 18px;
}

.th-video-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--th-dark);
	margin: 0 0 12px 0;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.th-video-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.th-creator-badge {
	width: 36px;
	height: 36px;
	background: linear-gradient(135deg, var(--th-primary), var(--th-secondary));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 700;
	font-size: 0.95rem;
	flex-shrink: 0;
}

.th-creator-info {
	flex: 1;
	min-width: 0;
}

.th-creator-name {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--th-dark);
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.th-video-stats {
	font-size: 0.8rem;
	color: var(--th-text-light);
	margin: 2px 0 0 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.th-video-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid var(--th-border);
}

.th-rating {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.85rem;
	color: var(--th-warning);
	font-weight: 600;
}

.th-stars {
	display: inline-block;
}

/* Load More Button */
.th-load-more-wrapper {
	display: flex;
	justify-content: center;
	padding: 20px 0;
}

/* ============================================
   SIDEBAR
   ============================================ */
.th-sidebar {
	display: flex;
	flex-direction: column;
	gap: 25px;
	max-height: fit-content;
	position: sticky;
	top: 20px;
}

.th-widget {
	background: var(--th-white);
	border-radius: var(--th-border-radius);
	padding: 22px;
	box-shadow: var(--th-shadow-sm);
	border: 1px solid var(--th-border);
	transition: var(--th-transition);
}

.th-widget:hover {
	box-shadow: var(--th-shadow-md);
	border-color: var(--th-primary);
}

.th-widget-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--th-dark);
	margin: 0 0 16px 0;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--th-light-secondary);
}

/* Widget Search */
.th-widget-search-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--th-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95rem;
	transition: var(--th-transition);
}

.th-widget-search-input:focus {
	outline: none;
	border-color: var(--th-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Widget Lists */
.th-trending-list,
.th-categories-list,
.th-creators-list,
.th-recent-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.th-trending-item,
.th-category-item,
.th-creator-item,
.th-recent-item {
	border-bottom: 1px solid var(--th-light-secondary);
	padding: 12px 0;
}

.th-trending-item:last-child,
.th-category-item:last-child,
.th-creator-item:last-child,
.th-recent-item:last-child {
	border-bottom: none;
}

.th-trending-link,
.th-category-link,
.th-creator-link,
.th-recent-link {
	text-decoration: none;
	color: var(--th-text);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	transition: var(--th-transition);
}

.th-trending-link:hover,
.th-category-link:hover,
.th-creator-link:hover,
.th-recent-link:hover {
	color: var(--th-primary);
}

.th-trending-title,
.th-category-name,
.th-creator-name,
.th-recent-title {
	font-weight: 500;
	font-size: 0.9rem;
	flex: 1;
	line-height: 1.4;
}

.th-trending-meta,
.th-category-count,
.th-creator-tutorials,
.th-recent-date {
	font-size: 0.8rem;
	color: var(--th-text-light);
	flex-shrink: 0;
	text-align: right;
}

/* Creator Link Styles */
.th-creator-link {
	display: flex;
	align-items: center;
	gap: 12px !important;
}

.th-creator-badge-large {
	width: 40px;
	height: 40px;
	background: linear-gradient(135deg, var(--th-primary), var(--th-secondary));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 700;
	flex-shrink: 0;
}

.th-creator-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.th-creator-tutorials {
	font-size: 0.75rem !important;
	text-align: left !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
	.th-layout-container {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.th-sidebar {
		position: static;
		max-height: none;
	}

	.th-hero-title {
		font-size: 2.5rem;
	}

	.th-videos-grid {
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
		gap: 20px;
	}

	.th-filters-controls {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 768px) {
	.th-page-wrapper {
		padding: 20px 15px;
	}

	.th-layout-container {
		max-width: 100%;
	}

	.th-hero-section {
		height: 350px;
		margin-bottom: 30px;
	}

	.th-hero-container {
		padding: 40px 30px;
	}

	.th-hero-title {
		font-size: 2rem;
	}

	.th-hero-description {
		font-size: 1rem;
		margin-bottom: 20px;
	}

	.th-section-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.th-filters-controls {
		grid-template-columns: 1fr;
		width: 100%;
	}

	.th-filters-wrapper {
		flex-direction: column;
		align-items: stretch;
	}

	.th-filters-options {
		width: 100%;
		justify-content: flex-start;
	}

	.th-videos-grid {
		grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
		gap: 15px;
	}

	.th-shorts-carousel {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
		gap: 15px;
	}

	.th-video-info {
		padding: 12px;
	}

	.th-video-title {
		font-size: 0.85rem;
		margin-bottom: 8px;
	}

	.th-creator-badge {
		width: 32px;
		height: 32px;
		font-size: 0.85rem;
	}

	.th-creator-name {
		font-size: 0.8rem;
	}

	.th-video-stats {
		font-size: 0.75rem;
	}
}

@media (max-width: 480px) {
	.th-hero-section {
		height: 280px;
		margin-bottom: 20px;
	}

	.th-hero-container {
		padding: 30px 20px;
		justify-content: center;
		align-items: flex-end;
	}

	.th-hero-title {
		font-size: 1.5rem;
	}

	.th-hero-description {
		font-size: 0.9rem;
		margin-bottom: 15px;
	}

	.th-btn-lg {
		padding: 10px 24px;
		font-size: 0.95rem;
	}

	.th-section-title {
		font-size: 1.4rem;
	}

	.th-shorts-section,
	.th-filter-section,
	.th-videos-section {
		padding: 20px;
	}

	.th-videos-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 12px;
	}

	.th-shorts-carousel {
		grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
		gap: 10px;
	}

	.th-sidebar {
		gap: 15px;
	}

	.th-widget {
		padding: 16px;
	}

	.th-widget-title {
		font-size: 1rem;
		margin-bottom: 12px;
	}

	.th-video-meta {
		gap: 8px;
		margin-bottom: 8px;
	}

	.th-creator-badge {
		width: 28px;
		height: 28px;
		font-size: 0.75rem;
	}

	.th-filters-controls {
		grid-template-columns: 1fr;
		gap: 10px;
	}
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.th-video-card {
	animation: slideUp 0.5s ease-out;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
	.th-filters-wrapper,
	.th-sidebar,
	.th-load-more-wrapper {
		display: none;
	}

	.th-layout-container {
		grid-template-columns: 1fr;
	}
}
