@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
	--deep-navy: #0f172a;
	--gold: #2b9aa8;
	--gold-light: #5bbbbe;
	--text-light: #0f172a;
	--text-dim: #334155;
	--glass-bg: rgba(255, 255, 255, 0.85);
	--glass-border: rgba(55, 194, 212, 0.15);
}

.text-gold-light {
	color: #138496 !important;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	background-color: #e4f2ff;
	color: var(--text-light);
	font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	letter-spacing: -0.01em;
	overflow-x: hidden;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Background Animation */
.bg-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	overflow: hidden;
}

.bg-stars {
	position: absolute;
	top: -63%;
    left: -63%;
    width: 225%;
    height: 225%;
	background: url('../img/bg.png') center/60% no-repeat;
	opacity: 0.15;
	filter: invert(1) brightness(1.1) contrast(0.9);
	animation: rotate 240s linear infinite;
}

@media screen and (max-width: 768px) {
	.bg-stars {
		background-size: 136%;
		background-position: center;
	}
}

@media screen and (min-width: 769px) and (max-width: 1700px) {
	.bg-stars {
		background-size: 90%;
	}
}

@keyframes rotate {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/* Typography */
h1,
h2,
h3 {
	font-family: 'Outfit', 'Pretendard', sans-serif;
	letter-spacing: -0.02em;
}

.title-main {
	font-family: 'Outfit', 'Pretendard', sans-serif !important;
	font-size: 3rem;
	font-weight: 700;
	background: linear-gradient(135deg, #138496, var(--gold));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-align: center;
	margin-bottom: 0.5rem;
}

.subtitle {
	text-align: center;
	font-weight: 500;
	color: var(--text-dim);
	margin-bottom: 3rem;
	letter-spacing: 0.15em;
}

/* Layout */
.container {
	max-width: 1000px;
	margin: 0 auto;
	padding: 2rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	z-index: 1;
}

/* Question Area */
.question-box {
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 24px;
	padding: 2rem;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.question-box:focus-within {
	transform: translateY(-5px);
	border-color: var(--gold);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

textarea {
	width: 100%;
	background: transparent;
	border: none;
	color: var(--text-light);
	font-size: 1.25rem;
	line-height: 1.6;
	resize: none;
	outline: none;
	min-height: 200px;
	font-family: inherit;
}

textarea::placeholder {
	color: var(--text-dim);
}

/* Button Styling */
.btn-submit {
	display: block;
	width: 100%;
	margin-top: 2rem;
	padding: 1.2rem;
	background: linear-gradient(135deg, var(--gold), #138496);
	border: none;
	border-radius: 16px;
	color: #ffffff;
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 15px rgba(55, 194, 212, 0.25);
}

.btn-submit:hover {
	transform: scale(1.02);
	box-shadow: 0 6px 20px rgba(55, 194, 212, 0.45);
}

.btn-submit:active {
	transform: scale(0.98);
}

/* Loading Overlay */
#loading-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background: rgba(244, 247, 250, 0.98);
	z-index: 1000;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.loader {
	width: 80px;
	height: 80px;
	border: 3px solid rgba(55, 194, 212, 0.15);
	border-top: 3px solid var(--gold);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 1.5rem;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	font-size: 1.2rem;
	letter-spacing: 0.1em;
	color: #138496;
	animation: pulse 2s infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 0.5;
	}

	50% {
		opacity: 1;
	}
}

/* Result Page Styles */
.result-container {
	display: none;
}

.avatar-container {
	text-align: center;
	margin-bottom: 2rem;
}

.avatar {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	border: 2px solid var(--gold);
	padding: 5px;
	margin: 0 auto;
	background: #ffffff;
}

.fortune-text {
	font-size: 1.1rem;
	line-height: 2.0;
	color: var(--text-light);
	white-space: pre-wrap;
	text-align: left;
	word-break: break-all;
	overflow-wrap: break-word;
}

/* Card Shuffle Animation Simulation */
.card-animation {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background: rgba(244, 247, 250, 0.98);
	z-index: 1500;
	justify-content: center;
	align-items: center;
}

/* Navigation */
.navbar-custom {
	padding: 1rem 2rem;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(15px);
	border-bottom: 1px solid var(--glass-border);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.nav-link-custom {
	color: var(--text-light) !important;
	font-family: 'Outfit', 'Pretendard', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	transition: all 0.3s ease;
	margin-left: 1.5rem;
	text-decoration: none;
}

.nav-link-custom:hover {
	color: var(--gold) !important;
}

/* Service Grid */
.service-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-top: 2rem;
}

.service-card {
	background: var(--glass-bg);
	border: 1px solid var(--glass-border);
	border-radius: 20px;
	padding: 2rem;
	text-align: center;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.service-card:hover {
	transform: translateY(-10px);
	border-color: var(--gold);
	background: rgba(55, 194, 212, 0.05);
}

.service-icon {
	font-size: 2.5rem;
	margin-bottom: 1rem;
	color: var(--gold);
}

.service-title {
	font-family: 'Outfit', 'Pretendard', sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #138496;
}

.service-desc {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text-dim);
	line-height: 1.6;
}

/* Auth Cards */
.auth-card {
	max-width: 450px;
	margin: 4rem auto;
	background: var(--glass-bg);
	backdrop-filter: blur(25px);
	border: 1px solid var(--glass-border);
	border-radius: 30px;
	padding: 3rem;
}

.form-group-custom {
	margin-bottom: 1.5rem;
}

.form-label-custom {
	display: block;
	font-size: 0.85rem;
	color: #138496;
	margin-bottom: 0.5rem;
	letter-spacing: 0.05em;
}

.form-input-custom {
	width: 100%;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(55, 194, 212, 0.3);
	border-radius: 12px;
	padding: 0.8rem 1rem;
	color: var(--text-light);
	outline: none;
	transition: all 0.3s ease;
}

.form-input-custom::placeholder {
	color: rgba(0, 0, 0, 0.4) !important;
	opacity: 1 !important;
}

.form-input-custom:focus {
	border-color: var(--gold);
	background: rgba(255, 255, 255, 1);
	box-shadow: 0 0 10px rgba(55, 194, 212, 0.2);
}

.form-input-custom[readonly],
.form-input-custom:read-only {
	background: rgba(0, 0, 0, 0.03) !important;
	border-color: rgba(0, 0, 0, 0.08) !important;
	color: rgba(0, 0, 0, 0.4) !important;
	cursor: not-allowed;
}

.form-input-custom[readonly]:focus,
.form-input-custom:read-only:focus {
	border-color: rgba(0, 0, 0, 0.08) !important;
	background: rgba(0, 0, 0, 0.03) !important;
	box-shadow: none !important;
}

/* Autofill background and text color override for light theme */
.form-input-custom:-webkit-autofill,
.form-input-custom:-webkit-autofill:hover,
.form-input-custom:-webkit-autofill:focus,
.form-input-custom:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
	-webkit-text-fill-color: var(--text-light) !important;
	transition: background-color 5000s ease-in-out 0s;
}

.auth-footer {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.9rem;
	color: var(--text-dim);
}

.auth-footer a {
	color: #138496;
	text-decoration: none;
}

/* Terms & About */
.info-section {
	line-height: 2;
	color: var(--text-light);
	padding: 2rem 0;
}

.info-section h2 {
	color: #138496;
	margin-top: 2.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--glass-border);
	padding-bottom: 0.5rem;
}

/* My Page Specifics */
.profile-header {
	text-align: center;
	margin-bottom: 3rem;
}

.profile-avatar {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	background: var(--glass-bg);
	border: 2px solid var(--gold);
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 0 auto 1.5rem;
	font-size: 2.5rem;
	color: #138496;
}

.mypage-tabs .nav-link {
	color: var(--text-dim) !important;
	border: none;
	padding: 1rem 2rem;
	font-family: 'Outfit', 'Pretendard', sans-serif;
	letter-spacing: 0.1em;
	transition: all 0.3s;
}

.mypage-tabs .nav-link.active {
	background: transparent !important;
	color: #138496 !important;
	border-bottom: 2px solid #138496;
}

.history-item {
	background: var(--glass-bg);
	border: 1px solid var(--glass-border);
	border-radius: 15px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	transition: transform 0.2s;
}

.history-item:hover {
	transform: scale(1.01);
	border-color: rgba(55, 194, 212, 0.3);
}

.history-date {
	font-size: 0.8rem;
	color: var(--text-dim);
}

.history-title {
	color: #138496;
	font-weight: 700;
	margin: 0.5rem 0;
}

.history-content {
	font-size: 0.9rem;
	color: var(--text-light);
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.coin-badge {
	background: rgba(55, 194, 212, 0.1);
	color: #138496;
	padding: 0.2rem 0.8rem;
	border-radius: 20px;
	font-size: 0.85rem;
	border: 1px solid rgba(55, 194, 212, 0.3);
}

.footer {
	padding: 2rem 2rem;
	text-align: center;
	font-size: 0.8rem;
	color: var(--text-dim);
	border-top: 1px solid var(--glass-border);
	margin-top: 3rem;
}

/* Evaluation Statistics Styles (Index) */
.stats-container {
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(55, 194, 212, 0.2);
	border-radius: 15px;
	padding: 2rem 1.5rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	margin-bottom: 1.5rem;
}

.eval-progress {
	height: 24px;
	width: 100%;
	max-width: 600px;
	background-color: #e2e8f0;
	border-radius: 25px;
	overflow: hidden;
	border: 1px solid #cbd5e1;
	box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
	display: flex;
	margin: 0 auto;
}

.eval-bar-good {
	background: linear-gradient(90deg, #1a73e8, #5bc0de);
	transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.eval-bar-bad {
	background: linear-gradient(90deg, #ff4757, #ff6b81);
	transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.eval-bar-none {
	background: #cbd5e1;
	color: #64748b;
	width: 100%;
	text-align: center;
	line-height: 24px;
	font-size: 0;
}

.eval-bar-text {
	display: none !important;
}

.eval-legend {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	font-size: 0.9rem;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

/* Mobile Payment History Enhancement */
@media screen and (max-width: 768px) {
	#payment .table-responsive {
		overflow: visible;
		border: none;
	}

	#payment .table {
		border: none;
		margin-bottom: 0;
	}

	#payment .table thead {
		display: none;
	}

	#payment .table tbody,
	#payment .table tr,
	#payment .table td {
		display: block;
		width: 100%;
	}

	#payment .table tr {
		background: var(--glass-bg);
		border: 1px solid var(--glass-border);
		border-radius: 20px;
		margin-bottom: 1.2rem;
		padding: 1.2rem;
		transition: transform 0.2s, border-color 0.2s;
	}

	#payment .table tr:active {
		transform: scale(0.98);
		border-color: var(--gold);
	}

	#payment .table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.7rem 0;
		border: none;
		background: transparent !important;
	}

	#payment .table td:not(:last-child) {
		border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	}

	#payment .table td::before {
		font-weight: 600;
		color: #138496;
		font-size: 0.85rem;
		letter-spacing: 0.05em;
	}

	#payment .table td:nth-child(1)::before {
		content: "결제일자";
	}

	#payment .table td:nth-child(2)::before {
		content: "상품명";
	}

	#payment .table td:nth-child(3)::before {
		content: "결제금액";
	}

	#payment .table td:nth-child(4)::before {
		content: "처리상태";
	}

	#payment .table td:nth-child(2) {
		font-size: 1.1rem;
		font-weight: 700;
		color: #138496;
		margin: 0.3rem 0;
		padding: 1rem 0;
		border-bottom: 1px solid var(--glass-border);
	}

	#payment .text-success {
		background: rgba(40, 167, 69, 0.15);
		color: #28a745 !important;
		padding: 3px 12px;
		border-radius: 20px;
		font-size: 0.8rem;
		font-weight: 600;
		border: 1px solid rgba(40, 167, 69, 0.2);
	}

	/* Fortune History Enhancement */
	.history-item .d-flex.justify-content-between.align-items-end {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 12px;
	}

	.history-item .text-gold {
		font-weight: 600;
		font-size: 0.9rem !important;
	}

	.fortune-evaluation {
		width: 100%;
		display: flex !important;
		gap: 8px;
		margin-top: 5px;
	}

	.fortune-evaluation .btn-eval {
		margin: 0 !important;
		flex: 1;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 8px 0 !important;
		font-size: 0.85rem !important;
		border-radius: 12px !important;
	}
}

/* Evaluation Buttons */
.btn-eval {
	background: transparent;
	border: 1px solid #cbd5e1;
	color: #64748b;
	font-size: 1rem;
	border-radius: 20px;
	padding: 8px 20px;
	margin-left: 5px;
	transition: all 0.2s;
}

.btn-eval.eval-good:hover,
.btn-eval.eval-good.active {
	border-color: #5bc0de;
	color: #5bc0de;
	background: rgba(91, 192, 222, 0.1);
}

.btn-eval.eval-bad:hover,
.btn-eval.eval-bad.active {
	border-color: #ff6b6b;
	color: #ff6b6b;
	background: rgba(255, 107, 107, 0.1);
}

/* Divination Danger Warning Box Styling */
.divination-warning-box {
	background: rgba(235, 94, 85, 0.04);
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	border: 1px solid rgba(235, 94, 85, 0.2);
	border-radius: 20px;
	padding: 1.5rem 1.8rem;
	box-shadow: 0 8px 32px 0 rgba(235, 94, 85, 0.05), inset 0 0 15px rgba(235, 94, 85, 0.02);
	max-width: 1000px;
	margin: 0 auto 2.5rem auto;
	transition: all 0.3s ease;
}

.divination-warning-box:hover {
	border-color: rgba(235, 94, 85, 0.45);
	box-shadow: 0 10px 40px rgba(235, 94, 85, 0.12), inset 0 0 20px rgba(235, 94, 85, 0.04);
}

.divination-warning-box .warning-title {
	color: #d9383a;
	font-size: 1.05rem;
	font-weight: 700;
	margin-bottom: 0.8rem;
	display: flex;
	align-items: center;
	letter-spacing: 0.02em;
}

.divination-warning-box .warning-title i {
	font-size: 1.2rem;
	filter: drop-shadow(0 0 5px rgba(235, 94, 85, 0.3));
}

.divination-warning-box .warning-list {
	margin: 0;
	padding-left: 1.2rem;
	list-style-type: decimal;
}

.divination-warning-box .warning-list li {
	color: var(--text-light);
	font-size: 0.9rem;
	line-height: 1.7;
	margin-bottom: 0.6rem;
	font-weight: 400;
}

.divination-warning-box .warning-list li:last-child {
	margin-bottom: 0;
}

.divination-warning-box .warning-list li strong {
	color: #d9383a;
	font-weight: 700;
}

/* 사용자 헤더(header.php)에서 이관된 스타일 코드 */
html {
	overflow-y: scroll;
	scrollbar-gutter: stable;
	/* iOS Safe Area 대응 */
	padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
}

body {
	overflow-x: hidden;
	height: auto !important;
	position: relative !important;
}

/* 앱 전환 애니메이션 */
.ion-page-wrapper {
	animation: appFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	width: 100%;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* 모바일 네비게이션 사용자 정보 최적화 */
@media (max-width: 991px) {
	#nav-auth .nav-item {
		flex-direction: row !important;
		flex-wrap: wrap;
		padding: 1rem 0.5rem;
		border-bottom: 1px solid var(--glass-border);
		margin-bottom: 0.5rem;
		justify-content: flex-start;
		gap: 8px;
	}

	#nav-auth .nav-link {
		padding: 0 !important;
		font-size: 0.8rem !important;
		white-space: nowrap;
		/* 줄바꿈 방지 */
	}

	/* 모바일에서 세로 구분선 제거 및 간격 조정 */
	#nav-auth .nav-link:nth-child(2) {
		border-left: none !important;
		padding-left: 0 !important;
	}

	#nav-auth .nav-link-custom {
		margin-left: auto !important;
		/* 충전 버튼을 우측으로 밀기 */
		margin-right: 0 !important;
		padding: 4px 12px !important;
	}
}

@keyframes appFadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.page-leaving .ion-page-wrapper {
	opacity: 0;
	transition: opacity 0.3s ease;
}