/* Custom styles to complement Tailwind */
:root {
	--bg-primary: #111827;
	--bg-secondary: #1f2937;
	--bg-tertiary: #374151;
	--bg-quaternary: #4b5563;
	--bg-modal-overlay: rgba(0, 0, 0, 0.75);
	--bg-modal-content: rgba(31, 41, 55, 0.75);
	--bg-modal-body: rgba(31, 41, 55, 0.65);
	--text-primary: #ffffff;
	--text-secondary: #9ca3af;
	--text-muted: #6b7280;
	--border-color: #4b5563;
	--accent-color: #e11d48;
	--accent-color-hover: #be123c;
	--accent-secondary: #ca8a04;
	--shadow-color: rgba(0, 0, 0, 0.3);
	--shadow-color-light: rgba(0, 0, 0, 0.1);
}

body.theme-light {
	--bg-primary: #f8fafc;
	--bg-secondary: #ffffff;
	--bg-tertiary: #f1f5f9;
	--bg-quaternary: #e2e8f0;
	--bg-modal-overlay: rgba(51, 65, 85, 0.5);
	--bg-modal-content: rgba(255, 255, 255, 0.9);
	--bg-modal-body: rgba(255, 255, 255, 0.8);
	--text-primary: #334155;
	--text-secondary: #64748b;
	--text-muted: #94a3b8;
	--border-color: #e2e8f0;
	--accent-color: #0ea5e9;
	--accent-color-hover: #0284c7;
	--accent-secondary: #0ea5e9;
	--shadow-color: rgba(0, 0, 0, 0.1);
	--shadow-color-light: rgba(0, 0, 0, 0.05);
}

body {
	font-family: "Inter", sans-serif;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	transition: background-color 0.3s ease, color 0.3s ease;
}

.title-font {
	font-family: "Playfair Display", serif;
}

.text-accent {
	color: var(--accent-color);
}
.text-accent-hover:hover {
	color: var(--accent-color-hover);
}
.text-secondary {
	color: var(--text-secondary);
}
.text-muted {
	color: var(--text-muted);
}
.bg-secondary {
	background-color: var(--bg-secondary);
}
.bg-tertiary {
	background-color: var(--bg-tertiary);
}
.border-tertiary {
	border-color: var(--border-color);
}
.section-card {
	border: 1px solid var(--border-color);
}

.card-slot,
.card-item,
.combo-card-slot {
	transition: all 0.3s ease;
	transform-style: preserve-3d;
}

.card-item {
	position: relative;
}

.card-item:hover {
	transform: translateY(-10px) scale(1.05);
	box-shadow: 0 20px 25px -5px var(--shadow-color), 0 10px 10px -5px var(--shadow-color-light);
	z-index: 20;
}

.card-slot-empty {
	background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%234B5563FF' stroke-width='2' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
	background-color: var(--bg-tertiary);
}

.combo-result-enter {
	animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.combo-card-overlay {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0) 100%);
}

.modal-overlay {
	position: fixed;
	inset: 0;
	background-color: var(--bg-modal-overlay);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 50;
}
.modal-overlay.hidden {
	display: none;
}

.modal-content {
	background-color: transparent;
	position: relative;
	animation: zoomIn 0.3s ease-out;
	overflow: hidden;
	border-radius: 0.75rem;
	box-shadow: 0 25px 50px -12px var(--shadow-color);
	width: 100%;
	max-width: 500px;
	min-height: 300px;
	display: flex;
	flex-direction: column;
}

#modal-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: blur(4px) brightness(0.7);
	transform: scale(1.1);
	z-index: -1;
}

.modal-content > div:not(#modal-bg) {
	background-color: var(--bg-modal-content);
	backdrop-filter: blur(2px);
}

.modal-content > div:first-of-type:not(#modal-bg) {
	border-top-left-radius: 0.75rem;
	border-top-right-radius: 0.75rem;
}

#modal-body {
	flex-grow: 1;
	background-color: var(--bg-modal-body) !important;
}

.modal-close-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	background-color: var(--accent-color);
	border-radius: 9999px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.25rem;
	font-weight: bold;
	line-height: 1;
	z-index: 20;
}

@keyframes zoomIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.gallery-switch {
	display: inline-flex;
	background-color: var(--bg-tertiary);
	border-radius: 9999px;
	padding: 0.25rem;
}

.switch-btn {
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	font-weight: 600;
	color: var(--text-secondary);
	transition: all 0.2s ease-in-out;
}

.switch-btn.active-base {
	background-color: var(--accent-secondary);
	color: #ffffff;
	box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -2px var(--shadow-color-light);
}

.switch-btn.active-final {
	background-color: #64748b;
	color: #ffffff;
	box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -2px var(--shadow-color-light);
}

.switch-btn.active-common {
	background-color: #92400e;
	color: #ffffff;
}
.switch-btn.active-uncommon {
	background-color: #475569;
	color: #ffffff;
}
.switch-btn.active-rare {
	background-color: #ca8a04;
	color: #ffffff;
}
.switch-btn.active-epic {
	background-color: #4338ca;
	color: #ffffff;
}

.text-filter-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.text-filter-input {
	background-color: var(--bg-tertiary);
	border-radius: 9999px;
	padding: 0.625rem 2.5rem 0.625rem 1rem;
	color: var(--text-primary);
	border: 1px solid var(--border-color);
	transition: border-color 0.2s ease-in-out;
}

.text-filter-input::placeholder {
	color: var(--text-secondary);
}

.text-filter-input:focus {
	outline: none;
	border-color: var(--accent-color);
}

.text-filter-clear-btn {
	position: absolute;
	right: 0.5rem;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 9999px;
	background-color: var(--bg-quaternary);
	color: var(--text-secondary);
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.text-filter-clear-btn.hidden {
	display: none;
}

.card-manage-btn {
	position: absolute;
	bottom: 2.75rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	border-radius: 9999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: bold;
	color: white;
	cursor: pointer;
	transition: background-color 0.2s;
	z-index: 16;
}

.add-btn {
	background-color: #16a34a;
}
.add-btn:hover {
	background-color: #15803d;
}
.add-btn.disabled {
	background-color: var(--bg-quaternary);
	cursor: not-allowed;
}

.remove-btn {
	background-color: #dc2626;
}
.remove-btn:hover {
	background-color: #b91c1c;
}

.card-count-badge {
	position: absolute;
	bottom: 2.75rem;
	left: 0.5rem;
	min-width: 1.75rem;
	height: 1.75rem;
	padding: 0 0.25rem;
	border-radius: 9999px;
	background-color: rgba(17, 24, 39, 0.8);
	color: #f3f4f6;
	font-size: 0.875rem;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 16;
}

.deck-list-container {
	background-color: var(--bg-tertiary);
	border-radius: 0.5rem;
	padding: 1rem;
	min-height: 200px;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 1rem;
}

.deck-list-container .card-item {
	flex-grow: 1;
	flex-basis: 100px;
	max-width: 120px;
}

.deck-list-container .card-stats-overlay {
	padding: 0.2rem;
	gap: 0.2rem;
}

.deck-list-container .stat-level {
	width: 1.5rem;
	height: 1.5rem;
	font-size: 0.8rem;
	border-width: 1px;
}

.deck-list-container .stat-attack,
.deck-list-container .stat-health {
	padding: 0.1rem 0.35rem;
	font-size: 0.7rem;
	border-width: 1px;
}

.deck-list-container .stat-icon {
	width: 0.5rem;
	height: 0.5rem;
}

.style-bar-container {
	margin-top: 0.5rem;
}
.style-bar {
	width: 100%;
	height: 8px;
	background: linear-gradient(to right, #1e3a8a, #3b82f6, #9333ea, #dc2626, #7f1d1d);
	border-radius: 9999px;
	position: relative;
}
.style-indicator {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	background-color: white;
	border-radius: 50%;
	border: 2px solid var(--border-color);
	transform: translate(-50%, -50%);
	transition: left 0.5s ease-in-out;
}

.toast {
	padding: 1rem 1.5rem;
	border-radius: 0.5rem;
	color: white;
	font-weight: 600;
	box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -4px var(--shadow-color-light);
	animation: slideInUp 0.5s ease-out, fadeOut 0.5s ease-in 4.5s forwards;
}
.toast.success {
	background-color: #16a34a;
}
.toast.error {
	background-color: #dc2626;
}
.toast.info {
	background-color: #2563eb;
}

@keyframes slideInUp {
	from {
		transform: translateY(100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes fadeOut {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

.skill-item-wrapper input[type="radio"]:checked + .skill-item {
	background-color: rgba(202, 138, 4, 0.2);
	outline: 2px solid var(--accent-secondary);
}

.skill-item {
	transition: background-color 0.2s ease-in-out, outline 0.2s ease-in-out;
	border: 2px solid transparent;
	background-color: var(--bg-secondary);
}

.skill-item-wrapper:has(input:not(:disabled)) .skill-item:hover {
	background-color: var(--bg-tertiary);
}

.info-icon-wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.info-icon {
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background-color: var(--bg-quaternary);
	color: var(--text-secondary);
	font-size: 0.75rem;
	font-style: italic;
	font-weight: bold;
	text-align: center;
	line-height: 1rem;
	cursor: help;
}

.skill-tooltip {
	visibility: hidden;
	width: 220px;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	text-align: center;
	border-radius: 6px;
	padding: 8px;
	position: absolute;
	z-index: 20;
	top: 120%;
	margin-top: 4px;
	left: 50%;
	margin-left: -110px;
	opacity: 0;
	transition: opacity 0.3s;
	border: 1px solid var(--border-color);
	font-size: 0.875rem;
	font-weight: normal;
	pointer-events: none;
}

#combo-info-tooltip {
	width: 280px;
	margin-left: -140px;
}

.info-icon-wrapper:hover .skill-tooltip {
	visibility: visible;
	opacity: 1;
}

.card-stats-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 0.5rem;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	pointer-events: none;
	z-index: 16;
}

.stat-level,
.stat-attack,
.stat-health {
	background-color: rgba(17, 24, 39, 0.75);
	border: 2px solid #d5a100;
	border-radius: 9999px;
	color: white;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-level {
	width: 2.25rem;
	height: 2.25rem;
	font-size: 1.25rem;
	pointer-events: auto;
	cursor: pointer;
}

.stat-attack {
	color: #ef4444;
}

.stat-health {
	color: #3b82f6;
}

.stat-attack,
.stat-health {
	padding: 0.25rem 0.6rem;
	gap: 0.25rem;
	font-size: 1.1rem;
}

.stat-icon {
	width: 1rem;
	height: 1rem;
}

#combo-builder-section #slot-1 .card-stats-overlay,
#combo-builder-section #slot-2 .card-stats-overlay {
	padding: 0.25rem;
	gap: 0.25rem;
}
#combo-builder-section #slot-1 .stat-level,
#combo-builder-section #slot-2 .stat-level {
	width: 1.8rem;
	height: 1.8rem;
	font-size: 1rem;
}
#combo-builder-section #slot-1 .stat-attack,
#combo-builder-section #slot-1 .stat-health,
#combo-builder-section #slot-2 .stat-attack,
#combo-builder-section #slot-2 .stat-health {
	padding: 0.15rem 0.4rem;
	font-size: 0.9rem;
}
#combo-builder-section #slot-1 .stat-icon,
#combo-builder-section #slot-2 .stat-icon {
	width: 0.7rem;
	height: 0.7rem;
}

#combo-builder-section #combo-card-slot .card-stats-overlay {
	padding: 0.6rem;
}
#combo-builder-section #combo-card-slot .stat-level {
	width: 2.5rem;
	height: 2.5rem;
	font-size: 1.4rem;
}
#combo-builder-section #combo-card-slot .stat-attack,
#combo-builder-section #combo-card-slot .stat-health {
	padding: 0.3rem 0.7rem;
	font-size: 1.2rem;
}
#combo-builder-section #combo-card-slot .stat-icon {
	width: 1.1rem;
	height: 1.1rem;
}

.sort-dropdown-button {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background-color: var(--bg-tertiary);
	border-radius: 9999px;
	font-weight: 600;
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}
.sort-dropdown-menu {
	position: absolute;
	right: 0;
	top: 100%;
	margin-top: 0.5rem;
	background-color: var(--bg-secondary);
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	box-shadow: 0 10px 15px -3px var(--shadow-color);
	z-index: 30;
	width: 220px;
	padding: 0.5rem;
}

.sort-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem;
	border-radius: 0.25rem;
	color: var(--text-primary);
}

.sort-item:hover {
	background-color: var(--bg-tertiary);
}

.sort-item input {
	accent-color: var(--accent-secondary);
}

.sort-order-toggle {
	width: 1.5rem;
	height: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 0.25rem;
	color: var(--text-secondary);
}

.sort-order-toggle:hover {
	background-color: var(--bg-quaternary);
	color: var(--text-primary);
}

.card-item img {
	transition: filter 0.3s ease, transform 0.3s ease;
	position: relative;
	z-index: 1;
}

.card-item .card-info-overlay {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	border-radius: 0.5rem;
	z-index: 20;
}

.card-item:hover .card-info-overlay {
	opacity: 1;
}

.card-item:hover img {
	filter: blur(4px) brightness(0.7);
	transform: scale(1.05);
}

.card-info-icon {
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.8);
	color: #111827;
	font-size: 2rem;
	font-weight: bold;
	font-style: italic;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: help;
	position: relative;
	transform: scale(0.8);
	transition: transform 0.3s ease;
	pointer-events: auto;
}

.card-item:hover .card-info-icon {
	transform: scale(1);
}

.card-info-tooltip {
	visibility: hidden;
	opacity: 0;
	position: absolute;
	top: 100%;
	margin-top: 0.5rem;
	left: 50%;
	transform: translateX(-50%);
	width: 280px;
	background-color: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	padding: 0.75rem;
	z-index: 100;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	pointer-events: none;
	text-align: left;
	box-shadow: 0 10px 15px -3px var(--shadow-color);
}

.card-info-icon:hover .card-info-tooltip {
	visibility: visible;
	opacity: 1;
}

.card-info-tooltip h4 {
	font-weight: 700;
	color: #f59e0b;
	font-size: 1rem;
	text-align: center;
	padding-bottom: 0.25rem;
	margin-bottom: 0.5rem;
	border-bottom: 1px solid #f59e0b;
}

.card-info-tooltip ul {
	list-style-type: disc;
	list-style-position: inside;
	margin-bottom: 0.75rem;
	color: var(--text-primary);
	font-size: 0.8125rem;
}

.card-info-tooltip p {
	color: var(--text-secondary);
	font-size: 0.8125rem;
	font-style: normal;
	text-align: center;
}

.source-link {
	transition: color 0.2s ease-in-out;
	color: var(--accent-color);
}
.source-link:hover {
	color: var(--accent-color-hover);
}

/* Button Styles */
.btn-accent {
	background-color: var(--accent-color);
	color: white;
}
.btn-accent:hover {
	background-color: var(--accent-color-hover);
}
.btn-secondary {
	background-color: var(--bg-tertiary);
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}
.btn-secondary:hover {
	background-color: var(--bg-quaternary);
}
.btn-blue {
	background-color: #2563eb;
	color: white;
}
.btn-blue:hover {
	background-color: #1d4ed8;
}
.btn-green {
	background-color: #16a34a;
	color: white;
}
.btn-green:hover {
	background-color: #15803d;
}
