/* ============================================================
   My Page - Clean Design with Subtle Glassmorphism
   ============================================================ */

/* Background with subtle gradient */
body.page-template-page-mypage {
	background: #f9fafb !important;
	min-height: 100vh;
}

/* Main Container */
.mypage {
	padding: 40px 0;
}

.mypage .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Page Header */
.mypage .page-header {
	padding: 0px;
	margin-bottom: 32px;
	text-align: center;
}

.mypage .page-title {
	color: #1e293b;
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 12px;
	margin-top: 0;
}

.mypage .user-greeting {
	color: #64748b;
	font-size: 1.1rem;
	font-weight: 400;
	margin: 0;
}

/* Navigation Tabs */
.mypage-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 32px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
	position: relative;
	/* Context for sliding highlight */
	isolation: isolate;
	/* Create new stacking context */
}

/* Sliding Background Highlight */
.nav-highlight {
	position: absolute;
	top: 0;
	left: 0;
	/* Width/Height/Transform set by JS */
	background: #2563eb;
	border-radius: 8px;
	/* Matches link border-radius */
	z-index: 1;
	/* Behind the text */
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
	pointer-events: none;
	/* Let clicks pass through to links */
}

.mypage-nav a {
	flex: 1;
	min-width: 140px;
	padding: 12px 20px;
	text-align: center;
	text-decoration: none;
	color: #64748b;
	font-weight: 600;
	font-size: 0.95rem;
	/* Default background */
	border: 2px solid transparent;
	/* Maintain size */
	border-radius: 8px;
	transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
	position: relative;
	z-index: 2;
	/* In front of highlight */
}

.mypage-nav a:hover {
	color: #2563eb;
	transform: translateY(-2px);
}

.mypage-nav a.active {
	background: transparent;
	/* Let highlight show through */
	color: #fff;
	/* No border or box-shadow on the link itself, handled by highlight */
}

/* Hover state for active tab shouldn't change background */
.mypage-nav a.active:hover {
	background: transparent;
	color: #fff;
	transform: none;
	/* Don't move active tab on hover */
}

.mypage-nav a.logout {
	flex: 0 0 auto;
	/* Don't grow optionally, or keep consistent */
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	margin-left: auto;
	/* Push to right if desired, or keep in flow */
}

.mypage-nav a.logout:hover {
	background: #dc2626;
	color: #fff;
	box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Ensure logout sits on top nicely and doesn't conflict with slider logic */
.mypage-nav a.logout.active {
	/* Should typically not happen for logout, but safety style */
	background: #dc2626;
	color: #fff;
}

/* Content Area */
.mypage-content {
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
	padding: 40px 48px;
	min-height: 400px;
}

/* View Sections */
.dashboard-view h2,
.favorites-view h2,
.searches-view h2,
.quiz-history-view h2,
.settings-view h2 {
	color: #1e293b;
	font-size: 1.75rem;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #e2e8f0;
}

/* Dashboard Section */
.dashboard-section,
.favorites-section,
.recommendations-section {
	margin-bottom: 40px;
}

.dashboard-section:last-child,
.favorites-section:last-child,
.recommendations-section:last-child {
	margin-bottom: 0;
}

.dashboard-section h3,
.favorites-section h3,
.recommendations-section h3 {
	color: #475569;
	font-size: 1.25rem;
	font-weight: 600;
	margin-top: 0;
	margin-bottom: 16px;
}

/* Lists */
.favorites-list,
.recommendations-list {
	list-style: none;
	padding: 0;
	margin: 0 0 16px 0;
}

.favorites-list li,
.recommendations-list li {
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: all 0.2s ease;
}

.favorites-list li:hover,
.recommendations-list li:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: #2563eb;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
	transform: translateY(-2px);
}

.favorites-list a,
.recommendations-list a {
	color: #1e293b;
	text-decoration: none;
	font-weight: 600;
	flex: 1;
	transition: color 0.2s ease;
}

.favorites-list a:hover,
.recommendations-list a:hover {
	color: #2563eb;
}

.favorites-list .date,
.recommendations-list .meta {
	color: #64748b;
	font-size: 0.9rem;
	margin-left: 16px;
	white-space: nowrap;
}

/* No Data Message */
.no-data {
	color: #64748b;
	text-align: center;
	padding: 40px 20px;
	font-size: 1.05rem;
}

/* Proposals List (Favorites View) */
.proposals-list {
	display: grid;
	gap: 20px;
}

.proposal-item {
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	transition: all 0.2s ease;
}

.proposal-item:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: #2563eb;
	box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

.proposal-title {
	margin-top: 0;
	margin-bottom: 12px;
	font-size: 1.2rem;
	font-weight: 700;
}

.proposal-title a {
	color: #1e293b;
	text-decoration: none;
	transition: color 0.2s ease;
}

.proposal-title a:hover {
	color: #2563eb;
}

.proposal-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
	font-size: 0.9rem;
	color: #64748b;
}

.proposal-meta span {
	display: inline-flex;
	align-items: center;
}

.proposal-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.favorited-date {
	color: #64748b;
	font-size: 0.85rem;
}

/* Buttons */
.btn-primary,
a.btn-primary {
	display: inline-block;
	padding: 12px 28px;
	border-radius: 8px;
	font-weight: 600;
	border: none;
	font-size: 1rem;
	background: #2563eb;
	color: #fff;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
	transition: all 0.2s ease;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}

.btn-primary:hover,
a.btn-primary:hover {
	background: #1d4ed8;
	color: #fff;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
	transform: translateY(-1px);
}

.btn-unfavorite {
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 0.9rem;
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border: 1px solid #fecaca;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-unfavorite:hover {
	background: #dc2626;
	color: #fff;
	border-color: #dc2626;
	box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Count Display */
.count {
	color: #64748b;
	font-size: 0.95rem;
	margin-bottom: 24px;
	padding: 12px 16px;
	background: rgba(226, 232, 240, 0.5);
	border-radius: 8px;
	display: inline-block;
}

/* Dashboard Links */
.dashboard-section>p>a {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.2s ease;
}

.dashboard-section>p>a:hover {
	color: #1d4ed8;
	text-decoration: underline;
}

/* Settings View */
.settings-view .form-group {
	margin-bottom: 24px;
}

.settings-view label {
	display: block;
	color: #374151;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 8px;
}

.settings-view input[type="text"],
.settings-view input[type="email"],
.settings-view input[type="password"] {
	width: 100%;
	max-width: 500px;
	padding: 12px 16px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	background: rgba(255, 255, 255, 0.9);
	color: #1f2937;
	font-size: 1rem;
	transition: all 0.2s ease;
}

.settings-view input:focus {
	outline: none;
	border-color: #2563eb;
	background: rgba(255, 255, 255, 1);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.settings-view .full-width {
	width: 100%;
	max-width: 600px;
}

.settings-view .description {
	color: #6b7280;
	font-size: 0.875rem;
	margin-top: 6px;
	line-height: 1.5;
}

.settings-view .qualification-checkboxes {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 300px;
	overflow-y: auto;
	padding: 16px;
	background: rgba(249, 250, 251, 0.8);
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-top: 12px;
}

.settings-view .checkbox-inline {
	display: flex;
	align-items: center;
	color: #374151;
	padding: 0px 12px;
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 400;
	font-size: 0.95rem;
}

.settings-view .checkbox-inline:hover {
	background: rgba(255, 255, 255, 0.6);
}

.settings-view .checkbox-inline input {
	margin-right: 10px;
	accent-color: #2563eb;
	width: 18px;
	height: 18px;
}

.settings-section {
	background: rgba(255, 255, 255, 0.5);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 24px;
}

.settings-section h3 {
	color: #475569;
	font-size: 1.25rem;
	font-weight: 600;
	margin-top: 0;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid #e2e8f0;
}

/* Saved Searches View */
.saved-searches-view h2 {
	color: #1e293b;
	font-size: 1.75rem;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #e2e8f0;
}

.searches-list {
	display: grid;
	gap: 20px;
}

.search-item {
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	transition: all 0.2s ease;
}

.search-item:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: #2563eb;
	box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

.search-name {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 1.2rem;
	font-weight: 700;
	color: #1e293b;
}

.search-params {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.search-params .param {
	display: inline-block;
	padding: 6px 12px;
	background: rgba(37, 99, 235, 0.1);
	color: #1e40af;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
}

/* Saved Searches - Filter Chips */
.search-params .filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: #2563eb;
	color: #fff;
	font-size: 0.75rem;
	border-radius: 20px;
	font-weight: 500;
}

.search-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
	gap: 12px;
	flex-wrap: wrap;
}

.saved-date {
	color: #64748b;
	font-size: 0.85rem;
}

.btn-secondary,
a.btn-secondary {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 0.9rem;
	background: #6b7280;
	color: #fff;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	text-align: center;
}

.btn-secondary:hover,
a.btn-secondary:hover {
	background: #4b5563;
	color: #fff;
	box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
	transform: translateY(-1px);
}

.btn-delete-search {
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 0.9rem;
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border: 1px solid #fecaca;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-delete-search:hover {
	background: #dc2626;
	color: #fff;
	border-color: #dc2626;
	box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Success/Error Messages */
.message {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 0.95rem;
}

.message.success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-left: 4px solid #16a34a;
	color: #166534;
}

.message.error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 4px solid #dc2626;
	color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
	.mypage .page-header {
		padding: 24px 20px;
	}

	.mypage .page-title {
		font-size: 1.5rem;
	}

	.mypage .user-greeting {
		font-size: 1rem;
	}

	.mypage-nav {
		flex-direction: column;
		gap: 8px;
	}

	.mypage-nav a {
		min-width: auto;
		width: 100%;
	}

	.mypage-content {
		padding: 24px 20px;
	}

	.dashboard-view h2,
	.favorites-view h2,
	.searches-view h2,
	.quiz-history-view h2,
	.settings-view h2 {
		font-size: 1.5rem;
	}

	.favorites-list li,
	.recommendations-list li {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.favorites-list .date,
	.recommendations-list .meta {
		margin-left: 0;
	}

	.proposal-actions {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.btn-unfavorite {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.mypage {
		padding: 20px 0;
	}

	.mypage .container {
		padding: 0 12px;
	}

	.mypage .page-header {
		padding: 20px 16px;
		margin-bottom: 20px;
	}

	.mypage-nav {
		padding: 12px;
		margin-bottom: 20px;
	}

	.mypage-content {
		padding: 20px 16px;
	}

	.proposal-item {
		padding: 16px;
	}

	.proposal-meta {
		flex-direction: column;
		gap: 8px;
	}
}

/* ============================================================
   Quiz History View Styles
   ============================================================ */

.quiz-stats {
	display: flex;
	gap: 20px;
	margin-bottom: 32px;
}

.stat-box {
	flex: 1;
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-number {
	font-size: 2.5rem;
	font-weight: 700;
	color: #2563eb;
	line-height: 1.2;
}

.stat-number.stat-correct {
	color: #16a34a;
}

.stat-number.stat-incorrect {
	color: #dc2626;
}

.stat-label {
	font-weight: 600;
	color: #64748b;
	font-size: 0.95rem;
	margin-top: 4px;
}

/* History Tabs */
.quiz-history-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 24px;
	border-bottom: 2px solid #e2e8f0;
	padding-bottom: 0;
}

.tab-btn {
	padding: 12px 16px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	font-size: 0.9rem;
	transition: all 0.2s ease;
	margin-bottom: -2px;
	/* Overlap border */
	outline: none;
}

.tab-btn:hover {
	color: #2563eb;
	background: rgba(37, 99, 235, 0.05);
	border-radius: 8px 8px 0 0;
}


#open-withdrawal-modal {
	background: #fff;
	border: 1px solid #d32f2f;
	color: #d32f2f;
}

.settings-section .btn-secondary:hover {
	color: #d32f2f !important;
}

/* Tab Content */
.tab-content {
	display: none;
	/* Hidden by default */
	animation: fadeIn 0.3s ease;
}

/* Questions List */
.questions-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.questions-list li {
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	transition: all 0.2s ease;
}

.questions-list li:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: #2563eb;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
	transform: translateY(-2px);
}

.question-title {
	flex: 1;
	color: #1e293b;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.answered-date {
	color: #64748b;
	font-size: 0.9rem;
	white-space: nowrap;
	margin-left: 16px;
}

/* ============================================================
   Floating Menu (SP Only)
   ============================================================ */
.mypage-floating-menu {
	display: none;
}

@media (max-width: 768px) {

	/* Hide standard nav */
	.mypage-nav {
		display: none !important;
	}

	/* Backdrop Overlay */
	.mypage-menu-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.5);
		z-index: 11500;
		/* Below menu, above content */
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	.mypage-menu-overlay.active {
		opacity: 1;
		visibility: visible;
	}

	/* Floating Menu Container */
	.mypage-floating-menu {
		display: flex;
		-webkit-tap-highlight-color: transparent;
		outline: none;
		/* Show on SP */
		flex-direction: column;
		/* Stack Top-to-Bottom (SubBtns then Toggle) */
		align-items: flex-end;
		position: fixed;
		bottom: 96px;
		/* 86px + 10px up */
		right: 20px;
		z-index: 12600;
		/* Below search overlay but above backdrop */
		pointer-events: none;
		/* Let clicks pass through empty space */
	}

	/* Main Toggle Button */
	.mypage-menu-toggle {
		-webkit-tap-highlight-color: transparent;
		outline: none;
		width: 60px;
		height: 60px;
		background: #2563eb;
		color: white;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
		cursor: pointer;
		pointer-events: auto;
		transition: background 0.3s ease;
		position: relative;
		z-index: 2;
	}

	.mypage-menu-toggle:active {
		transform: scale(0.95);
	}

	.mypage-menu-toggle.active {
		background: #1e293b;
	}

	.mypage-menu-toggle svg {
		transition: opacity 0.3s ease;
	}

	.mypage-menu-toggle.active svg {
		opacity: 0;
	}

	/* 'X' Icon using CSS */
	.mypage-menu-toggle.active::before,
	.mypage-menu-toggle.active::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 24px;
		height: 2px;
		background-color: #fff;
		transform: translate(-50%, -50%) rotate(45deg);
		transition: all 0.3s ease;
	}

	.mypage-menu-toggle.active::after {
		transform: translate(-50%, -50%) rotate(-45deg);
	}

	/* Sub Buttons Container */
	.mypage-sub-btns {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		gap: 12px;
		margin-bottom: 16px;
		pointer-events: none;
	}

	/* Individual Sub Button */
	.mypage-sub-btn {
		-webkit-tap-highlight-color: transparent;
		outline: none;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 12px;
		opacity: 0;
		transform: translateY(20px) scale(0.8);
		transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		pointer-events: none;
		/* Disabled when hidden */
	}

	.mypage-floating-menu.show-menu .mypage-sub-btn {
		opacity: 1;
		transform: translateY(0) scale(1);
		pointer-events: auto;
	}

	/* Staggered transition delays for entrance */
	.mypage-floating-menu.show-menu .mypage-sub-btn:nth-child(1) {
		transition-delay: 0.15s;
	}

	/* Topmost item (appears last visually if reversed? No, logic is stack upwards) */
	/* Wait, the container is column-reverse, so the bottom-most item in DOM is at bottom. */
	/* Let's assume order in HTML is: Sub Btns Group (containing items), Toggle Button */
	/* And Sub Btns are stacked column (normal) or column-reverse. I'll use column-reverse for the container? */
	/* Actually better: .mypage-floating-menu { flex-direction: column-reverse; } means Toggle is at bottom visually. */
	/* .mypage-sub-btns { flex-direction: column; } means 1st item is top. */

	/* Let's refine delays: Top item (furthest) should appear last? Or first? usually bottom-up. */
	.mypage-floating-menu.show-menu .mypage-sub-btn:nth-last-child(1) {
		transition-delay: 0.05s;
	}

	.mypage-floating-menu.show-menu .mypage-sub-btn:nth-last-child(2) {
		transition-delay: 0.1s;
	}

	.mypage-floating-menu.show-menu .mypage-sub-btn:nth-last-child(3) {
		transition-delay: 0.15s;
	}

	.mypage-floating-menu.show-menu .mypage-sub-btn:nth-last-child(4) {
		transition-delay: 0.2s;
	}

	.mypage-sub-btn-label {
		background: white;
		color: #1e293b;
		padding: 6px 12px;
		border-radius: 6px;
		font-size: 0.85rem;
		font-weight: 600;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
		opacity: 0;
		transform: translateX(10px);
		transition: all 0.2s ease;
	}

	.mypage-floating-menu.show-menu .mypage-sub-btn-label {
		opacity: 1;
		transform: translateX(0);
	}

	.mypage-sub-btn-icon {
		width: 48px;
		height: 48px;
		background: white;
		color: #475569;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
		cursor: pointer;
		transition: all 0.2s ease;
	}

	.mypage-sub-btn:active .mypage-sub-btn-icon {
		background: #f1f5f9;
		transform: scale(0.95);
	}

	/* Special colors for specific buttons if needed */
	.mypage-sub-btn.active .mypage-sub-btn-icon {
		background: #2563eb;
		color: white;
	}
}

.tab-content.active {
	display: block;
	/* Visible when active */
}

.tab-content h3 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.25rem;
	color: #334155;
	font-weight: 600;
}

/* Question List */
.questions-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.questions-list li {
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: all 0.2s ease;
}

.questions-list li:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: #2563eb;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
	transform: translateY(-2px);
}

.question-title {
	font-weight: 600;
	color: #1e293b;
	flex: 1;
}

.answered-date {
	color: #64748b;
	font-size: 0.9rem;
	margin-left: 16px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.quiz-link {
	text-align: center;
	margin-top: 40px;
}

/* Animation */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive adjustments for Quiz History */
@media (max-width: 600px) {
	.quiz-stats {
		flex-direction: column;
		gap: 12px;
	}

	.stat-box {
		padding: 16px;
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
	}

	.stat-number {
		font-size: 1.5rem;
		order: 2;
	}

	.stat-label {
		margin-top: 0;
		font-size: 1rem;
		order: 1;
	}

	.questions-list li {
		align-items: flex-start;
		gap: 8px;
	}

	.question-title {
		width: 100%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.answered-date {
		margin-left: 0;
		font-size: 0.85rem;
	}
}

/* ============================================================
   Fix: Saved Searches View Width
   ============================================================ */
.saved-searches-view {
	width: 100%;
	max-width: none !important;
}

.searches-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	width: 100%;
}

.search-item {
	width: 100%;
	box-sizing: border-box;
}

/* ============================================================
   Quiz Question Modal Styles
   ============================================================ */

/* Modal Overlay */
.quiz-question-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 99;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Modal Content */
.quiz-modal-content {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-width: 700px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	animation: slideUp 0.3s ease;
}

@keyframes slideUp {
	from {
		transform: translateY(20px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Modal Header */
.quiz-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 28px;
	border-bottom: 2px solid #e2e8f0;
}

.quiz-modal-header h3 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: #1e293b;
}

.modal-close {
	background: transparent;
	border: none;
	font-size: 2rem;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	line-height: 1;
}

.modal-close:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
}

/* Modal Body */
.quiz-modal-body {
	padding: 28px;
}

.modal-question-text {
	color: #1e293b;
	font-size: 1.15rem;
	line-height: 1.7;
	margin-bottom: 28px;
	font-weight: 500;
}

.modal-question-text p {
	margin: 0 0 12px 0;
}

.modal-question-text p:last-child {
	margin-bottom: 0;
}

/* Options Area */
.modal-options-area {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 28px;
}

.quiz-option-btn {
	padding: 16px 20px;
	background: rgba(255, 255, 255, 0.9);
	border: 2px solid #d1d5db;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 500;
	color: #1e293b;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
	width: 100%;
}

.quiz-option-btn:hover:not(:disabled) {
	background: rgba(37, 99, 235, 0.05);
	border-color: #2563eb;
	transform: translateX(4px);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.quiz-option-btn:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.quiz-option-btn.correct-answer {
	background: rgba(34, 197, 94, 0.1);
	border-color: #22c55e;
	color: #166534;
	font-weight: 600;
}

.quiz-option-btn.wrong-answer {
	background: rgba(239, 68, 68, 0.1);
	border-color: #ef4444;
	color: #991b1b;
	font-weight: 600;
}

/* Feedback Area */
.modal-feedback-area {
	background: rgba(241, 245, 249, 0.8);
	border-radius: 12px;
	padding: 24px;
	margin-top: 28px;
}

.modal-feedback-msg {
	margin-bottom: 16px;
}

.feedback-correct {
	color: #166534;
	font-size: 1.25rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
}

.feedback-incorrect {
	color: #991b1b;
	font-size: 1.25rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
}

.modal-explanation {
	color: #475569;
	font-size: 1rem;
	line-height: 1.7;
}

.modal-explanation h4 {
	margin: 0 0 12px 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1e293b;
}

.modal-explanation p {
	margin: 0 0 10px 0;
}

.modal-explanation p:last-child {
	margin-bottom: 0;
}

/* Modal Footer */
.quiz-modal-footer {
	padding: 20px 28px;
	border-top: 2px solid #e2e8f0;
	display: flex;
	justify-content: flex-end;
	gap: 12px;
}

.quiz-modal-footer .btn-primary,
.quiz-modal-footer .btn-secondary {
	margin: 0;
}

/* Question List Items - Clickable Style */
.questions-list li.quiz-question-item:hover {
	background: rgba(37, 99, 235, 0.05);
	border-color: #2563eb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.quiz-modal-content {
		max-width: 100%;
		border-radius: 12px;
		max-height: 85vh;
	}

	.quiz-modal-header {
		padding: 20px 24px;
	}

	.quiz-modal-header h3 {
		font-size: 1.25rem;
	}

	.quiz-modal-body {
		padding: 24px;
	}

	.modal-question-text {
		font-size: 1.05rem;
	}

	.quiz-option-btn {
		padding: 14px 16px;
		font-size: 0.95rem;
	}

	.quiz-modal-footer {
		padding: 16px 24px;
		flex-direction: column-reverse;
	}

	.quiz-modal-footer .btn-primary,
	.quiz-modal-footer .btn-secondary {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.quiz-question-modal {
		padding: 12px;
	}

	.quiz-modal-content {
		border-radius: 10px;
	}

	.quiz-modal-header {
		padding: 16px 20px;
	}

	.quiz-modal-body {
		padding: 20px;
	}

	.modal-question-text {
		font-size: 1rem;
		margin-bottom: 20px;
	}

	.modal-options-area {
		gap: 10px;
		margin-bottom: 20px;
	}

	.quiz-option-btn {
		padding: 12px 14px;
		font-size: 0.9rem;
	}

	.modal-feedback-area {
		padding: 20px;
	}

	.feedback-correct,
	.feedback-incorrect {
		font-size: 1.1rem;
	}
}

/* ============================================================
   Fix: Saved Searches Button Spacing on SP
   ============================================================ */
@media (max-width: 768px) {

	.saved-searches-view .btn-secondary,
	.saved-searches-view a.btn-secondary {
		/* Use flexbox to center content vertically and fix bottom spacing issue */
		display: inline-flex;
		align-items: center;
		justify-content: center;
		line-height: 1.2;
		padding: 8px 16px;
	}

	/* Ensure icon alignment is handled by flexbox */
	.saved-searches-view .btn-secondary svg,
	.saved-searches-view a.btn-secondary svg {
		margin-left: 4px;
	}
}

/* ============================================================
   Toggle Switch Styles
   ============================================================ */
.toggle-switch {
	position: relative;
	display: inline-block;
	width: 52px;
	height: 28px;
	margin-right: 12px;
	vertical-align: middle;
}

.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .4s;
	border-radius: 34px;
}

.toggle-slider:before {
	position: absolute;
	content: "";
	height: 20px;
	width: 20px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	transition: .4s;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.toggle-slider {
	background-color: #2563eb;
}

input:focus+.toggle-slider {
	box-shadow: 0 0 1px #2563eb;
}

input:checked+.toggle-slider:before {
	transform: translateX(24px);
}

.toggle-label-text {
	vertical-align: middle;
	font-weight: 500;
	font-size: 0.95rem;
	color: #475569;
}