/**
 * Tutorial Hub Manager - Frontend Styles (Namespaced)
 * All styles use .thm- prefix to avoid conflicts with theme and other plugins
 */

:root {
	--thm-primary: #3498db;
	--thm-secondary: #2980b9;
	--thm-accent: #9b59b6;
	--thm-success: #27ae60;
	--thm-danger: #e74c3c;
	--thm-dark: #2c3e50;
	--thm-light: #ecf0f1;
	--thm-gray: #95a5a6;
	--thm-white: #ffffff;
	--thm-border: #ddd;
}

/* ============================================
   FILTER SECTION
   ============================================ */
.thm-filter-section {
	background: white;
	padding: 30px;
	border-radius: 12px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.thm-filter-section h3 {
	margin: 0 0 20px;
	color: var(--thm-dark);
	font-size: 18px;
	font-weight: 600;
}

.thm-filter-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.thm-filter-group {
	display: flex;
	flex-direction: column;
}

.thm-filter-group label {
	margin-bottom: 8px;
	font-weight: 600;
	color: var(--thm-dark);
	font-size: 14px;
}

.thm-filter-group input,
.thm-filter-group select {
	padding: 10px 12px;
	border: 1px solid var(--thm-border);
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
	transition: all 0.3s;
	box-sizing: border-box;
}

.thm-filter-group input:focus,
.thm-filter-group select:focus {
	outline: none;
	border-color: var(--thm-primary);
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.thm-filter-button {
	padding: 10px 25px;
	background: var(--thm-primary);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.3s;
	margin-top: auto;
	font-size: 14px;
}

.thm-filter-button:hover {
	background: var(--thm-secondary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* ============================================
   TUTORIALS GRID
   ============================================ */
.thm-tutorials-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 25px;
	margin-bottom: 40px;
}

.thm-tutorial-card {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	transition: all 0.3s;
	display: flex;
	flex-direction: column;
}

.thm-tutorial-card:hover {
	box-shadow: 0 8px 20px rgba(0,0,0,0.12);
	transform: translateY(-8px);
}

.thm-card-image {
	position: relative;
	height: 160px;
	background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 50px;
}

.thm-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thm-duration-badge {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0,0,0,0.7);
	color: white;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

.thm-difficulty-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	color: white;
}

.thm-difficulty-beginner {
	background: var(--thm-success) !important;
}

.thm-difficulty-intermediate {
	background: #f39c12 !important;
}

.thm-difficulty-advanced {
	background: var(--thm-danger) !important;
}

.thm-card-content {
	padding: 20px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.thm-card-content h3 {
	margin: 0 0 10px;
	color: var(--thm-dark);
	font-size: 16px;
	line-height: 1.4;
}

.thm-card-excerpt {
	margin: 0 0 15px;
	color: #666;
	font-size: 13px;
	line-height: 1.5;
	flex-grow: 1;
}

.thm-card-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	padding-top: 15px;
	border-top: 1px solid var(--thm-light);
	font-size: 12px;
	color: var(--thm-gray);
}

.thm-card-rating {
	display: flex;
	align-items: center;
	gap: 5px;
}

.thm-stars {
	color: #f39c12;
}

.thm-card-footer {
	display: flex;
	gap: 10px;
}

.thm-card-link {
	flex: 1;
	text-align: center;
	padding: 10px;
	background: var(--thm-light);
	color: var(--thm-primary);
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 13px;
	transition: all 0.3s;
}

.thm-card-link:hover {
	background: var(--thm-primary);
	color: white;
}

/* ============================================
   RATINGS SECTION
   ============================================ */
.thm-ratings-section {
	background: white;
	padding: 30px;
	border-radius: 12px;
	margin: 30px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.thm-rating-summary {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 30px;
	margin-bottom: 30px;
	padding-bottom: 30px;
	border-bottom: 1px solid var(--thm-light);
}

.thm-rating-average {
	text-align: center;
}

.thm-rating-number {
	font-size: 48px;
	font-weight: bold;
	color: var(--thm-primary);
}

.thm-rating-count {
	color: var(--thm-gray);
	margin-top: 5px;
	font-size: 14px;
}

.thm-rating-distribution {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.thm-rating-bar {
	display: flex;
	align-items: center;
	gap: 12px;
}

.thm-rating-bar-label {
	min-width: 60px;
	font-size: 13px;
	color: var(--thm-gray);
}

.thm-rating-bar-bg {
	flex-grow: 1;
	height: 8px;
	background: var(--thm-light);
	border-radius: 4px;
	overflow: hidden;
}

.thm-rating-bar-fill {
	height: 100%;
	background: #f39c12;
	transition: width 0.3s;
}

.thm-rating-bar-count {
	min-width: 50px;
	text-align: right;
	font-size: 13px;
	color: var(--thm-gray);
}

/* ============================================
   RATING FORM
   ============================================ */
.thm-rating-form {
	background: var(--thm-light);
	padding: 25px;
	border-radius: 12px;
	margin-top: 30px;
}

.thm-rating-form h4 {
	margin: 0 0 20px;
	color: var(--thm-dark);
}

.thm-star-input {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	font-size: 32px;
}

.thm-star {
	cursor: pointer;
	color: #ddd;
	transition: all 0.2s;
}

.thm-star:hover,
.thm-star.active {
	color: #f39c12;
	transform: scale(1.1);
}

.thm-review-input {
	width: 100%;
	min-height: 100px;
	padding: 12px;
	border: 1px solid var(--thm-border);
	border-radius: 6px;
	font-family: inherit;
	margin-bottom: 15px;
	resize: vertical;
	box-sizing: border-box;
}

.thm-rating-submit {
	padding: 12px 30px;
	background: var(--thm-primary);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.3s;
	font-size: 14px;
}

.thm-rating-submit:hover {
	background: var(--thm-secondary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.thm-comments-section {
	background: white;
	padding: 30px;
	border-radius: 12px;
	margin: 30px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.thm-comments-section h3 {
	margin: 0 0 25px;
	color: var(--thm-dark);
	font-size: 20px;
	font-weight: 600;
}

.thm-comment {
	display: flex;
	gap: 15px;
	padding: 20px;
	margin-bottom: 15px;
	background: #f9f9f9;
	border-radius: 8px;
}

.thm-comment-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--thm-primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	flex-shrink: 0;
}

.thm-comment-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.thm-comment-content {
	flex-grow: 1;
}

.thm-comment-author {
	font-weight: 600;
	color: var(--thm-dark);
	margin-bottom: 5px;
}

.thm-comment-date {
	font-size: 12px;
	color: var(--thm-gray);
	margin-bottom: 10px;
}

.thm-comment-text {
	color: #333;
	line-height: 1.6;
	margin: 0;
}

/* ============================================
   NOTICES & MESSAGES
   ============================================ */
.thm-notice {
	padding: 15px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-weight: 500;
}

.thm-notice.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.thm-notice.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.thm-notice.info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

.thm-no-results {
	text-align: center;
	padding: 40px 20px;
	color: #999;
	font-style: italic;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
	.thm-filter-row {
		grid-template-columns: 1fr;
	}
	
	.thm-tutorials-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 15px;
	}
	
	.thm-rating-summary {
		grid-template-columns: 1fr;
	}
	
	.thm-filter-section {
		padding: 20px;
	}
}

@media (max-width: 480px) {
	.thm-tutorials-grid {
		grid-template-columns: 1fr;
	}
	
	.thm-card-meta {
		flex-direction: column;
		gap: 8px;
	}
}
