/* ============================================
   LORDFILM TEMPLATE - Engine Overrides
   ============================================ */

/* DLE Engine Fixes */
.dle-popup-bg {
	background: rgba(0, 0, 0, 0.8) !important;
	backdrop-filter: blur(10px);
}

.dle-popup {
	background: var(--bg-card) !important;
	border: 1px solid var(--border) !important;
	border-radius: var(--radius-lg) !important;
	box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}

.dle-popup-head {
	background: var(--bg-secondary) !important;
	border-bottom: 1px solid var(--border) !important;
	padding: 16px 20px !important;
}

.dle-popup-head span {
	color: var(--text) !important;
	font-weight: 700 !important;
}

.dle-popup-close {
	color: var(--text-muted) !important;
	opacity: 1 !important;
}

.dle-popup-close:hover {
	color: var(--accent) !important;
}

.dle-popup-body {
	padding: 20px !important;
}

/* DLE Buttons */
.dlebutton,
.bbcodes input[type="button"],
input.bbcodes {
	background: var(--accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--radius) !important;
	padding: 10px 16px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: background 0.2s !important;
}

.dlebutton:hover,
.bbcodes input[type="button"]:hover,
input.bbcodes:hover {
	background: var(--accent-hover) !important;
}

/* DLE Inputs */
.dle-popup input[type="text"],
.dle-popup textarea,
.dle-popup select {
	background: var(--bg) !important;
	border: 1px solid var(--border) !important;
	border-radius: var(--radius) !important;
	color: var(--text) !important;
	padding: 10px 14px !important;
}

.dle-popup input[type="text"]:focus,
.dle-popup textarea:focus,
.dle-popup select:focus {
	border-color: var(--accent) !important;
	outline: none !important;
}

/* Navigation Pages */
.navigation a,
.navigation span {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 40px !important;
	height: 40px !important;
	padding: 0 12px !important;
	background: var(--bg-card) !important;
	border: 1px solid var(--border) !important;
	border-radius: var(--radius) !important;
	color: var(--text-secondary) !important;
	font-weight: 600 !important;
	margin: 0 2px !important;
	text-decoration: none !important;
}

.navigation a:hover {
	background: var(--bg-hover) !important;
	color: var(--text) !important;
	border-color: var(--accent) !important;
}

.navigation span.nav_ext {
	background: transparent !important;
	border: none !important;
	color: var(--text-muted) !important;
}

.navigation span.navigation_active,
.navigation span:not(.nav_ext) {
	background: var(--accent) !important;
	color: #fff !important;
	border-color: var(--accent) !important;
}

/* Captcha */
.sec_code {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px;
	background: var(--bg-card);
	border-radius: var(--radius);
}

.sec_code img {
	border-radius: 4px;
}

.sec_code input[type="text"] {
	max-width: 150px;
	padding: 10px 14px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 14px;
}

.sec_code input[type="text"]:focus {
	outline: none;
	border-color: var(--accent);
}

/* Rating */
.rating ul,
.rating-votes {
	display: flex;
	align-items: center;
	gap: 4px;
}

.rating ul li a {
	display: block;
	width: 20px;
	height: 20px;
}

/* Spoiler */
.spoiler-head {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 16px;
	color: var(--text);
	cursor: pointer;
	font-weight: 600;
	margin-bottom: 8px;
}

.spoiler-head:hover {
	background: var(--bg-hover);
}

.spoiler-body {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	margin-bottom: 16px;
}

/* Quote */
blockquote,
.quote {
	background: var(--bg-secondary);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	padding: 16px;
	margin: 16px 0;
	color: var(--text-secondary);
	font-style: italic;
}

/* Code */
code,
pre {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 2px 6px;
	font-family: 'Fira Code', 'Consolas', monospace;
	font-size: 0.9em;
	color: var(--accent);
}

pre {
	padding: 16px;
	overflow-x: auto;
}

pre code {
	background: none;
	border: none;
	padding: 0;
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}

th, td {
	padding: 10px 14px;
	border: 1px solid var(--border);
	text-align: left;
}

th {
	background: var(--bg-secondary);
	font-weight: 700;
	color: var(--text);
}

tr:nth-child(even) {
	background: var(--bg-card);
}

/* Links in content */
.fullstory a:not(.btn-watch):not(.player-tab):not(.vote-btn),
.movie-description-full a,
.comment-text a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-color: transparent;
	transition: text-decoration-color 0.2s;
}

.fullstory a:hover:not(.btn-watch):not(.player-tab):not(.vote-btn),
.movie-description-full a:hover,
.comment-text a:hover {
	text-decoration-color: var(--accent);
}

/* Images in content */
.fullstory img,
.movie-description-full img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
	margin: 16px 0;
}

/* BB Codes */
.bb-bold { font-weight: 700; }
.bb-italic { font-style: italic; }
.bb-underline { text-decoration: underline; }
.bb-strike { text-decoration: line-through; }

/* Edit/Delete icons */
a.edit_link,
a.del_link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	background: var(--bg-secondary);
	border-radius: 4px;
	font-size: 12px;
	color: var(--text-muted);
	transition: all 0.2s;
}

a.edit_link:hover {
	background: var(--bg-hover);
	color: var(--accent);
}

a.del_link:hover {
	background: rgba(255, 71, 87, 0.1);
	color: #ff4757;
}

/* Social buttons */
.social-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0;
}

.social-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--bg-secondary);
	border-radius: 50%;
	color: var(--text-secondary);
	transition: all 0.2s;
}

.social-btn:hover {
	background: var(--bg-hover);
	color: var(--text);
}

/* XFields */
.xfieldsrow {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.xfieldscaption {
	min-width: 120px;
	color: var(--text-muted);
	font-weight: 600;
}

.xfieldsdata {
	color: var(--text);
}

.xfieldsdata a {
	color: var(--accent);
}

.xfieldsdata a:hover {
	text-decoration: underline;
}

/* Favorites */
.fav-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 14px;
	background: var(--bg-secondary);
	border-radius: var(--radius);
	color: var(--text-secondary);
	font-size: 13px;
	transition: all 0.2s;
}

.fav-link:hover {
	background: var(--bg-hover);
	color: #ff4757;
}

.fav-link.active {
	color: #ff4757;
}

/* Search Results */
.search_results {
	margin: 20px 0;
}

.search_results mark,
.search_results .match {
	background: rgba(139, 92, 246, 0.2);
	color: var(--accent);
	padding: 0 2px;
	border-radius: 2px;
}

/* Tags */
.tags-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tags-links a {
	display: inline-block;
	padding: 6px 10px;
	background: var(--bg-secondary);
	border-radius: 4px;
	font-size: 12px;
	color: var(--text-secondary);
	transition: all 0.2s;
}

.tags-links a:hover {
	background: var(--accent);
	color: #fff;
}

/* Tooltip */
.tooltip {
	position: absolute;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 14px;
	font-size: 12px;
	color: var(--text);
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
	z-index: 1000;
	max-width: 300px;
}

/* Loading states */
.loading {
	position: relative;
	pointer-events: none;
	opacity: 0.6;
}

.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

/* Empty state */
.empty-state {
	text-align: center;
	padding: 40px;
	color: var(--text-muted);
}

.empty-state-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.empty-state-text {
	font-size: 15px;
	margin-bottom: 16px;
}

/* Form error states */
.error-field {
	border-color: #ff4757 !important;
}

.error-message {
	color: #ff4757;
	font-size: 12px;
	margin-top: 6px;
}

/* Success message */
.success-message {
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid var(--green);
	color: var(--green);
	padding: 14px;
	border-radius: var(--radius);
	margin: 16px 0;
}

/* Warning message */
.warning-message {
	background: rgba(245, 197, 24, 0.1);
	border: 1px solid var(--yellow);
	color: var(--yellow);
	padding: 14px;
	border-radius: var(--radius);
	margin: 16px 0;
}

/* Clearfix */
.clearfix::after {
	content: '';
	display: table;
	clear: both;
}

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Visibility */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
