/* ============================================================================
   Spyral Theme - Character Module Styling
   World of Warcraft Inspired Design
   ============================================================================ */

/* Character Container */
#character-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: Arial, sans-serif;
	color: #c8d9e8;
	box-sizing: border-box;
}

.character-spyral {
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid rgba(102, 204, 255, 0.3);
	border-radius: 8px;
	overflow: hidden;
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.character-error {
	padding: 40px 20px;
	text-align: center;
	background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(255, 0, 0, 0.1));
	border-radius: 8px;
}

.error-header {
	margin-bottom: 20px;
}

.error-header h2 {
	color: #ff6666;
	text-shadow: 0 2px 8px rgba(255, 0, 0, 0.5);
	font-size: 24px;
	margin: 0;
}

.error-body p {
	color: #a0aeb8;
	font-size: 14px;
	margin: 0;
}

/* ============================================================================
   CHARACTER HEADER
   ============================================================================ */

.character-header {
	display: flex;
	align-items: center;
	padding: 20px;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), rgba(102, 204, 255, 0.05));
	border-bottom: 2px solid rgba(102, 204, 255, 0.4);
	min-height: 120px;
	position: relative;
	overflow: hidden;
}

.character-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, transparent 40%, rgba(246, 200, 92, 0.05) 50%, transparent 60%);
	pointer-events: none;
}

.header-left {
	flex-shrink: 0;
	margin-right: 20px;
	position: relative;
	z-index: 1;
}

.character-avatar {
	width: 100px;
	height: 100px;
	border-radius: 8px;
	overflow: hidden;
	border: 3px solid #66ccff;
	box-shadow: 0 0 20px rgba(102, 204, 255, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.5);
	background: rgba(0, 0, 0, 0.5);
}

.character-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.header-right {
	flex: 1;
	position: relative;
	z-index: 1;
}

.character-name {
	margin: 0 0 10px 0;
	font-size: 32px;
	font-weight: bold;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 10px rgba(102, 204, 255, 0.5);
	color: #66ccff;
	letter-spacing: 1px;
}

.character-name .char-lvl {
	font-size: 18px;
	font-weight: normal;
	color: #8aa8c0;
	margin-left: 6px;
	text-shadow: none;
}

/* Class-specific name colors */
.character-name.class-1,
.character-name.class-11 { color: #f6c85c; } /* Warrior - Gold */

.character-name.class-2,
.character-name.class-6 { color: #9482ca; } /* Paladin, Death Knight - Purple */

.character-name.class-3,
.character-name.class-4 { color: #fff569; } /* Hunter, Rogue - Yellow */

.character-name.class-5 { color: #3fc7eb; } /* Priest - Light Blue */

.character-name.class-7 { color: #ff7d0a; } /* Shaman - Orange */

.character-name.class-8 { color: #2459ff; } /* Mage - Blue */

.character-name.class-9 { color: #9d5ff0; } /* Warlock - Violet */

.character-name.class-10,
.character-name.class-12 { color: #ff8000; } /* Druid, Monk - Orange */

.character-name.class-13 { color: #0070dd; } /* Demon Hunter - Purple Blue */

.character-info {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	font-size: 14px;
	align-items: center;
}

.race-class {
	color: #c8d9e8;
	padding: 4px 10px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 4px;
	border-left: 3px solid #66ccff;
}

.guild-tag {
	color: #f6c85c;
}

.guild-tag a {
	color: #f6c85c;
	text-decoration: none;
	transition: all 0.3s;
}

.guild-tag a:hover {
	color: #ffdd99;
	text-shadow: 0 0 8px rgba(246, 200, 92, 0.8);
}

.realm-name {
	color: #a0aeb8;
	font-size: 13px;
	font-style: italic;
}

.faction {
	padding: 4px 12px;
	border-radius: 4px;
	font-weight: bold;
	font-size: 12px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.faction.faction-alliance {
	background: rgba(102, 204, 255, 0.3);
	color: #66ccff;
	border: 1px solid rgba(102, 204, 255, 0.6);
}

.faction.faction-horde {
	background: rgba(255, 128, 0, 0.3);
	color: #ff8000;
	border: 1px solid rgba(255, 128, 0, 0.6);
}

/* Item slots - global styles for tooltip hover */
.item {
	width: 70px;
	height: 70px;
	position: relative;
}

.item a {
	background-image: url(../../../images/misc/item_frame.png);
	width: 68px;
	height: 68px;
	margin-top: -6px;
	margin-left: -6px;
	position: absolute;
	z-index: 999;
	display: block;
}

.item .item-trans {
	width: 22px;
	height: 22px;
	left: 0;
	bottom: 14px;
	margin: 0;
	z-index: 1000;
	position: absolute;
	border-width: 6px;
	border-style: solid;
	border-color: transparent transparent #e060df #e060df;
	border-radius: 0 0 0 3px;
	background-image: none;
	background-color: transparent;
}

/* ============================================================================
   EQUIPMENT DISPLAY
   ============================================================================ */

.character-equipment {
	padding: 20px;
	background: rgba(0, 0, 0, 0.2);
}

/* Force horizontal layout for equipment row */
.character-equipment > .row {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	justify-content: flex-start !important;
	align-items: stretch !important;
	width: 100%;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-sizing: border-box;
}

.character-equipment .col-items {
	flex: 0 0 70px !important;
	width: 70px !important;
	max-width: 70px !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 6px;
}

.character-equipment .col-main {
	flex: 1 1 auto !important;
	min-width: 0;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
}

.equipment-grid {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0;
	margin-bottom: 20px;
	width: 100%;
}

.equipment-left,
.equipment-right {
	flex: 0 0 70px !important;
	width: 70px !important;
	max-width: 70px !important;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.equipment-center {
	flex: 1 1 auto !important;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.character-model {
	position: relative;
	width: 140px;
	height: 140px;
	border-radius: 8px;
	overflow: hidden;
	background: linear-gradient(135deg, rgba(102, 204, 255, 0.1), rgba(0, 0, 0, 0.5));
	border: 2px solid rgba(102, 204, 255, 0.4);
	box-shadow: 0 0 15px rgba(102, 204, 255, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.model-face {
	width: 100%;
	height: 100%;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	background-color: rgba(0, 0, 0, 0.3);
}

.level-badge {
	position: absolute;
	bottom: 5px;
	right: 5px;
	width: 40px;
	height: 40px;
	background: linear-gradient(135deg, #f6c85c, #ffa500);
	color: #000;
	font-weight: bold;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	box-shadow: 0 0 10px rgba(246, 200, 92, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
	border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Equipment Item Styling */
.equipment-left > div,
.equipment-right > div {
	width: 60px;
	height: 60px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(102, 204, 255, 0.3);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s;
	position: relative;
	overflow: hidden;
}

.equipment-left > div:hover,
.equipment-right > div:hover {
	background: rgba(102, 204, 255, 0.2);
	border-color: rgba(102, 204, 255, 0.6);
	box-shadow: 0 0 12px rgba(102, 204, 255, 0.4);
	transform: scale(1.05);
}

.equipment-left > div img,
.equipment-right > div img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.equipment-bottom {
	display: flex;
	justify-content: center;
	gap: 15px;
	padding-top: 10px;
	border-top: 1px solid rgba(102, 204, 255, 0.2);
	flex-wrap: wrap;
}

.weapon-slot {
	width: 70px;
	height: 70px;
	background: rgba(0, 0, 0, 0.4);
	border: 2px solid rgba(246, 200, 92, 0.3);
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s;
	overflow: hidden;
}

.weapon-slot:hover {
	background: rgba(246, 200, 92, 0.15);
	border-color: rgba(246, 200, 92, 0.6);
	box-shadow: 0 0 15px rgba(246, 200, 92, 0.4);
	transform: scale(1.08);
}

.weapon-slot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ============================================================================
   HEALTH AND MANA BARS
   ============================================================================ */

.character-bars {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	padding: 15px 20px;
	background: rgba(0, 0, 0, 0.3);
	border-top: 1px solid rgba(102, 204, 255, 0.2);
	border-bottom: 1px solid rgba(102, 204, 255, 0.2);
}

.stat-bar {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bar-label {
	color: #c8d9e8;
	font-size: 13px;
	font-weight: bold;
	min-width: 80px;
}

.bar-value {
	color: #f6c85c;
	font-size: 12px;
	font-weight: bold;
	min-width: 60px;
	text-align: right;
}

.bar-fill {
	flex: 1;
	height: 20px;
	background: linear-gradient(90deg, rgba(102, 204, 255, 0.3), rgba(102, 204, 255, 0.6));
	border-radius: 3px;
	overflow: hidden;
	border: 1px solid rgba(102, 204, 255, 0.5);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 10px rgba(102, 204, 255, 0.3);
	position: relative;
}

.bar-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	opacity: 0.5;
}

.health-bar .bar-fill {
	background: linear-gradient(90deg, rgba(255, 100, 100, 0.3), rgba(255, 100, 100, 0.6));
	border-color: rgba(255, 100, 100, 0.5);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 100, 100, 0.3);
}

.mana-bar .bar-fill,
.energy-bar .bar-fill,
.rage-bar .bar-fill {
	background: linear-gradient(90deg, rgba(102, 204, 255, 0.3), rgba(102, 204, 255, 0.6));
	border-color: rgba(102, 204, 255, 0.5);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 10px rgba(102, 204, 255, 0.3);
}

@media (max-width: 768px) {
	.character-bars {
		grid-template-columns: 1fr;
	}
}

/* ============================================================================
   ATTRIBUTES SECTION
   ============================================================================ */

.character-attributes {
	padding: 20px;
	background: rgba(0, 0, 0, 0.2);
	border-top: 1px solid rgba(102, 204, 255, 0.2);
}

.attributes-header {
	color: #f6c85c;
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid rgba(246, 200, 92, 0.4);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.attributes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
}

.attribute-column {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.attribute-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: rgba(0, 0, 0, 0.3);
	border-left: 3px solid rgba(102, 204, 255, 0.3);
	border-radius: 3px;
	transition: all 0.3s;
}

.attribute-row:hover {
	background: rgba(102, 204, 255, 0.1);
	border-left-color: rgba(102, 204, 255, 0.6);
	box-shadow: 0 0 8px rgba(102, 204, 255, 0.2);
}

.attr-name {
	color: #c8d9e8;
	font-size: 13px;
	font-weight: 600;
}

.attr-value {
	color: #f6c85c;
	font-size: 14px;
	font-weight: bold;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ============================================================================
   PVP STATS SECTION
   ============================================================================ */

.character-pvp {
	padding: 20px;
	background: rgba(0, 0, 0, 0.2);
	border-top: 1px solid rgba(102, 204, 255, 0.2);
	margin-top: 20px;
}

.pvp-header {
	color: #ff8000;
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid rgba(255, 128, 0, 0.4);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.pvp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
}

.pvp-stat {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 15px;
	background: linear-gradient(135deg, rgba(255, 128, 0, 0.1), rgba(0, 0, 0, 0.3));
	border: 1px solid rgba(255, 128, 0, 0.3);
	border-radius: 4px;
	transition: all 0.3s;
}

.pvp-stat:hover {
	background: linear-gradient(135deg, rgba(255, 128, 0, 0.2), rgba(0, 0, 0, 0.4));
	border-color: rgba(255, 128, 0, 0.6);
	box-shadow: 0 0 10px rgba(255, 128, 0, 0.3);
}

.stat-label {
	color: #c8d9e8;
	font-size: 13px;
	font-weight: 600;
}

.stat-value {
	color: #ff8000;
	font-size: 14px;
	font-weight: bold;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.stat-value.highlight-honor {
	color: #f6c85c;
}

.stat-value.highlight-arena {
	color: #66ccff;
}

/* ============================================================================
   ITEM TOOLTIP
   ============================================================================ */

.character-item-tooltip {
	background: rgba(0, 0, 0, 0.8);
	border: 1px solid rgba(102, 204, 255, 0.4);
	border-radius: 4px;
	padding: 10px;
	max-width: 350px;
	z-index: 1000;
}

/* Quality-based borders */
.character-item-tooltip.quality-0,
.item-header.quality-0 {
	border-color: rgba(200, 200, 200, 0.4); /* Common - Gray */
}

.character-item-tooltip.quality-1,
.item-header.quality-1 {
	border-color: rgba(0, 255, 0, 0.4); /* Uncommon - Green */
}

.character-item-tooltip.quality-2,
.item-header.quality-2 {
	border-color: rgba(0, 112, 255, 0.4); /* Rare - Blue */
}

.character-item-tooltip.quality-3,
.item-header.quality-3 {
	border-color: rgba(160, 128, 255, 0.4); /* Epic - Purple */
}

.character-item-tooltip.quality-4,
.item-header.quality-4 {
	border-color: rgba(255, 128, 0, 0.4); /* Legendary - Orange */
}

.character-item-tooltip.quality-5,
.item-header.quality-5 {
	border-color: rgba(255, 128, 0, 0.4); /* Artifact - Orange */
}

.item-header {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(102, 204, 255, 0.2);
}

.item-icon {
	position: relative;
	flex-shrink: 0;
}

.item-icon img {
	width: 50px;
	height: 50px;
	border-radius: 3px;
	border: 1px solid rgba(102, 204, 255, 0.3);
	object-fit: cover;
}

.enchant-glow {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 3px;
	box-shadow: inset 0 0 10px rgba(246, 200, 92, 0.5), 0 0 10px rgba(246, 200, 92, 0.3);
	pointer-events: none;
}

.item-basic {
	flex: 1;
	min-width: 0;
}

.item-name {
	margin: 0 0 5px 0;
	font-size: 14px;
	font-weight: bold;
	color: #c8d9e8;
	word-wrap: break-word;
}

.item-name.quality-0 { color: #808080; }
.item-name.quality-1 { color: #1eff00; }
.item-name.quality-2 { color: #0070dd; }
.item-name.quality-3 { color: #a335ee; }
.item-name.quality-4 { color: #ff8000; }
.item-name.quality-5 { color: #e6cc80; }

.item-quality {
	font-size: 12px;
	color: #a0aeb8;
}

.item-description {
	padding: 10px;
	background: rgba(0, 0, 0, 0.4);
	border-left: 3px solid rgba(246, 200, 92, 0.4);
	margin-bottom: 10px;
	font-size: 12px;
	color: #f6c85c;
	border-radius: 3px;
	font-style: italic;
}

.item-details {
	padding: 10px 0;
	font-size: 12px;
	border-bottom: 1px solid rgba(102, 204, 255, 0.2);
	margin-bottom: 10px;
}

.detail-row {
	display: flex;
	justify-content: space-between;
	padding: 3px 0;
}

.detail-row.stat-row {
	color: #66ccff;
}

.detail-label {
	color: #a0aeb8;
}

.detail-value {
	color: #c8d9e8;
	font-weight: 600;
}

.item-level {
	background: rgba(246, 200, 92, 0.2);
	padding: 2px 6px;
	border-radius: 2px;
	color: #f6c85c;
}

.item-stats {
	padding: 10px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 3px;
	margin-bottom: 10px;
	border-left: 3px solid rgba(102, 204, 255, 0.4);
}

.stats-header {
	color: #66ccff;
	font-size: 12px;
	font-weight: bold;
	margin-bottom: 8px;
	text-transform: uppercase;
}

.stat-line {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	padding: 3px 0;
}

.stat-name {
	color: #a0aeb8;
}

.stat-amount {
	color: #00ff00;
	font-weight: bold;
}

.item-enchantments {
	padding: 10px;
	background: rgba(246, 200, 92, 0.1);
	border-radius: 3px;
	margin-bottom: 10px;
	border-left: 3px solid rgba(246, 200, 92, 0.6);
}

.enchant-header {
	color: #f6c85c;
	font-size: 12px;
	font-weight: bold;
	margin-bottom: 6px;
	text-transform: uppercase;
}

.enchant-line {
	color: #c8d9e8;
	font-size: 12px;
	padding: 2px 0;
}

.item-set-info {
	padding: 10px;
	background: rgba(102, 204, 255, 0.1);
	border-radius: 3px;
	margin-bottom: 10px;
	border: 1px solid rgba(102, 204, 255, 0.3);
	font-size: 12px;
}

.set-name {
	color: #66ccff;
	font-weight: bold;
	margin-bottom: 6px;
}

.set-pieces {
	margin-bottom: 6px;
}

.set-piece {
	color: #a0aeb8;
	padding: 2px 0;
	padding-left: 15px;
}

.set-piece.worn {
	color: #00ff00;
}

.set-bonuses {
	border-top: 1px solid rgba(102, 204, 255, 0.2);
	padding-top: 6px;
}

.set-bonus {
	color: #f6c85c;
	padding: 2px 0;
	padding-left: 10px;
}

.item-source {
	font-size: 12px;
	color: #a0aeb8;
	padding: 8px 0;
	border-top: 1px solid rgba(102, 204, 255, 0.2);
}

.source-label {
	font-weight: bold;
}

.source-value {
	color: #c8d9e8;
}

.item-binding,
.item-unique {
	font-size: 12px;
	color: #a0aeb8;
	padding: 6px 8px;
	margin-top: 6px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 3px;
	border-left: 3px solid rgba(255, 128, 0, 0.4);
	font-style: italic;
}

.binding-player {
	border-left-color: rgba(102, 204, 255, 0.4);
}

.binding-account {
	border-left-color: rgba(246, 200, 92, 0.4);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
	.character-header {
		flex-direction: column;
		text-align: center;
	}

	.header-left {
		margin-right: 0;
		margin-bottom: 15px;
	}

	.header-right {
		width: 100%;
	}

	.character-info {
		justify-content: center;
	}

	/* Keep equipment row horizontal */
	.character-equipment > .row {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
	}

	.equipment-grid {
		flex-wrap: wrap;
		justify-content: center;
	}

	.equipment-left,
	.equipment-right {
		order: 2;
	}

	.equipment-center {
		order: 1;
		margin-bottom: 20px;
		width: 100%;
	}

	.attributes-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	#character-container {
		padding: 10px;
	}

	.character-header {
		padding: 15px;
		min-height: auto;
	}

	.character-avatar {
		width: 80px;
		height: 80px;
	}

	.character-name {
		font-size: 24px;
	}

	.character-equipment {
		padding: 15px;
	}

	/* Keep equipment row horizontal on mobile */
	.character-equipment > .row {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		overflow-x: auto;
	}

	.equipment-grid {
		gap: 15px;
	}

	.equipment-left,
	.equipment-right {
		grid-template-columns: 1fr;
		width: 100%;
	}

	.equipment-bottom {
		gap: 10px;
	}

	.weapon-slot {
		width: 60px;
		height: 60px;
	}

	.character-bars {
		grid-template-columns: 1fr;
	}

	.attributes-grid {
		grid-template-columns: 1fr;
	}

	.pvp-stats {
		grid-template-columns: 1fr;
	}

	.character-info {
		flex-direction: column;
		align-items: center;
		gap: 8px;
		font-size: 12px;
	}

	.race-class,
	.faction {
		font-size: 11px;
	}
}
