* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
	background: linear-gradient(135deg, #1a1c2c 0%, #2d1f2c 100%);
	min-height: 100vh;
	padding: 40px 20px;
	color: #333;
}

/* Main container - centers content with max width */
.container {
	max-width: 1200px;
	margin: 0 auto;
}

/* Header section with gold glowing title */
.header {
	text-align: center;
	margin-bottom: 40px;
	position: relative;
}

.header h1 {
	font-size: 3.5rem;
	color: #ffd700;
	text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
	letter-spacing: 4px;
	margin-bottom: 10px;
	font-weight: 700;
}

.header p {
	color: #e0e0e0;
	font-size: 1.2rem;
	letter-spacing: 2px;
}

.header i {
	color: #ffd700;
	margin: 0 10px;
}

/* Tab navigation for different fortune types */
.tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 30px;
	justify-content: center;
}

.tab-btn {
	padding: 15px 40px;
	font-size: 1.2rem;
	border: none;
	border-radius: 50px;
	background: rgba(255, 255, 255, 0.2);
	color: #e0e0e0;
	cursor: pointer;
	transition: all 0.3s;
	border: 2px solid transparent;
	font-weight: 600;
	letter-spacing: 1px;
}

.tab-btn:hover {
	background: rgba(255, 215, 0, 0.3);
	color: #ffd700;
}

.tab-btn.active {
	background: #b8860b;
	color: white;
	border-color: #ffd700;
	box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Main form card with semi-transparent background */
.fortune-card {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 30px;
	padding: 40px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 215, 0, 0.3);
	margin-bottom: 30px;
}

/* Two-column layout for form sections */
.form-section {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 30px;
}

/* Form field container */
.form-group {
	width: 100%;
	overflow: hidden;
	margin-bottom: 25px;
}

/* Full width fields span both columns */
.form-group.full-width {
	grid-column: 1 / -1;
}

/* Form labels with icon spacing */
label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #4a2e1f;
	font-size: 1rem;
	letter-spacing: 1px;
}

label i {
	color: #b8860b;
	margin-right: 8px;
	width: 20px;
}

/* Input field styling */
input, select, textarea {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e5d5b5;
	border-radius: 12px;
	font-size: 1rem;
	transition: all 0.3s;
	background: white;
	font-family: inherit;
}

input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: #b8860b;
	box-shadow: 0 0 15px rgba(184, 134, 11, 0.2);
}

/* Gender selection with color-coded options */
.gender-group {
	display: flex;
	gap: 20px;
	margin-top: 10px;
}

.gender-option {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 8px 20px;
	background: #f0e6d8;
	border: 2px solid #d4b48c;
	border-radius: 30px;
	transition: all 0.3s;
}

/* Male option - blue theme */
.gender-option:has(input[value="male"]):hover {
	background: #e6f0ff;
	border-color: #4a90e2;
}

.gender-option:has(input[value="male"]).selected {
	background: #4a90e2;
	border-color: #2a5c9a;
	color: white;
	box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

/* Female option - pink/red theme */
.gender-option:has(input[value="female"]):hover {
	background: #ffe6f0;
	border-color: #e24a6a;
}

.gender-option:has(input[value="female"]).selected {
	background: #e24a6a;
	border-color: #9a2a3a;
	color: white;
	box-shadow: 0 0 15px rgba(226, 74, 106, 0.3);
}

.gender-option input[type="radio"] {
	display: none;
}

/* Icon color adjustment when selected */
.gender-option.selected i.fa-mars {
	color: white;
}

.gender-option.selected i.fa-venus {
	color: white;
}

.fa-hand-paper.right-hand {
    transform: scaleX(-1);
}

/* Temple dropdown styling */
.temple-select {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e5d5b5;
	border-radius: 12px;
	font-size: 1rem;
	background: white;
	cursor: pointer;
}

/* Image upload grid layout */
.upload-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-top: 10px;
}

/* Individual upload box with dashed border */
.upload-item {
	background: #f9f3e9;
	border-radius: 15px;
	padding: 20px;
	text-align: center;
	border: 2px dashed #d4b48c;
	transition: all 0.3s;
	cursor: pointer;
	position: relative;
	min-height: 180px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.upload-item:hover {
	border-color: #b8860b;
	background: #f0e6d8;
}

.upload-item i {
	font-size: 2.5rem;
	color: #8b5a2b;
	margin-bottom: 10px;
}

.upload-item span {
	display: block;
	color: #5a3e1b;
	font-size: 0.9rem;
}

.upload-item small {
	color: #8b7355;
	font-size: 0.8rem;
}

/* Preview image styling */
.upload-item .preview-img {
	max-width: 100%;
	max-height: 120px;
	border-radius: 8px;
	margin-bottom: 8px;
	display: none;
}

.upload-item.has-image .preview-img {
	display: block;
}

.upload-item.has-image i,
.upload-item.has-image span,
.upload-item.has-image small {
	display: none;
}

.file-name {
	margin-top: 8px;
	font-size: 0.85rem;
	color: #2d5a27;
	word-break: break-all;
	display: none;
}

.upload-item.has-image .file-name {
	display: block;
}

/* Remove image button - appears on hover */
.remove-image {
	position: absolute;
	top: 5px;
	right: 5px;
	background: #c00;
	color: white;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 12px;
	border: none;
	z-index: 10;
	opacity: 0.9;
	transition: opacity 0.2s;
}

.upload-item.has-image:hover .remove-image {
	display: flex;
}

.remove-image:hover {
	background: #900;
	opacity: 1;
}

/* Date and time selection layout */
.datetime-group {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 12px;
	width: 100%;
}

.datetime-field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.datetime-field-label {
	font-size: 1rem;
	font-weight: 600;
	color: #4a2e1f;
	letter-spacing: 0.5px;
}

.datetime-field-label i {
	color: #b8860b;
	margin-right: 5px;
	width: 16px;
}

.datetime-field input[type="date"],
.datetime-field input[type="time"] {
	flex: 1 1 calc(50% - 6px);
	min-width: 140px;
	width: auto;
	max-width: 100%;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	font-size: 16px;
	min-height: 45px;
	padding: 8px 12px;
}

/* Wish type tags - selectable categories */
.wish-types {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 10px;
}

.wish-tag {
	padding: 8px 16px;
	background: #f0e6d8;
	border: 2px solid #d4b48c;
	border-radius: 30px;
	cursor: pointer;
	transition: all 0.3s;
	font-weight: 500;
	color: #5a3e1b;
	font-size: 0.95rem;
}

.wish-tag:hover {
	background: #e5d5b5;
	border-color: #b8860b;
}

.wish-tag.selected {
	background: #b8860b;
	border-color: #8b5a2b;
	color: white;
}

/* Submit button with gradient */
.submit-btn {
	background: linear-gradient(135deg, #b8860b 0%, #8b5a2b 100%);
	color: white;
	border: none;
	padding: 18px 40px;
	font-size: 1.3rem;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s;
	width: 100%;
	font-weight: 600;
	letter-spacing: 2px;
	box-shadow: 0 10px 20px rgba(139, 90, 43, 0.3);
	margin-top: 20px;
}

.submit-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 15px 30px rgba(184, 134, 11, 0.4);
}

.submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Loading overlay with spinner animation */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.8);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	backdrop-filter: blur(5px);
}

.loading-overlay.active {
	display: flex;
}

.loading-content {
	text-align: center;
	color: white;
}

.loading-spinner {
	border: 6px solid #f3f3f3;
	border-top: 6px solid #ffd700;
	border-radius: 50%;
	width: 80px;
	height: 80px;
	animation: spin 1.5s linear infinite;
	margin: 0 auto 20px;
}

.loading-text {
	font-size: 1.5rem;
	letter-spacing: 3px;
	animation: pulse 1.5s ease-in-out infinite;
}

.loading-subtext {
	color: #e0e0e0;
	margin-top: 10px;
	font-size: 1rem;
}

/* Animation keyframes */
@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* Fortune reading results section */
.result-section {
	margin-top: 40px;
	padding: 30px;
	background: #fdf9f2;
	border-radius: 20px;
	border: 2px solid #ffd700;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	display: none;
}

.result-section.active {
	display: block;
}

.result-header {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #e5d5b5;
}

.result-header i {
	font-size: 2.5rem;
	color: #b8860b;
}

.result-header h2 {
	font-size: 2rem;
	color: #4a2e1f;
}

/* Prediction content with traditional font */
.prediction-content {
	font-family: 'KaiTi', 'Microsoft JhengHei', serif;
	line-height: 1.8;
	font-size: 1.1rem;
	color: #2c3e50;
	white-space: pre-wrap;
}

.prediction-content p {
	margin-bottom: 15px;
}

/* Error message styling */
.error-message {
	background: #fee;
	color: #c00;
	padding: 15px 20px;
	border-radius: 10px;
	margin-bottom: 20px;
	border-left: 5px solid #c00;
	display: none;
}

.error-message.active {
	display: block;
}

/* Footer section */
.footer {
	text-align: center;
	color: #e0e0e0;
	margin-top: 40px;
	font-size: 0.9rem;
}

.footer i {
	color: #ffd700;
}

/* Tablet responsive styles */
@media (max-width: 768px) {
	body {
		padding: 20px 10px;
	}
	
	.header h1 {
		font-size: 2.2rem;
	}
	
	.header p {
		font-size: 1rem;
	}
	
	.tabs {
		flex-direction: column;
		gap: 10px;
	}
	
	.tab-btn {
		padding: 12px 20px;
		font-size: 1rem;
	}
	
	.form-section {
		grid-template-columns: 1fr;
	}
	
	.upload-grid {
		grid-template-columns: 1fr;
	}
	
	.datetime-group {
		flex-direction: column;
		gap: 10px;
	}
	
	.datetime-group input[type="date"],
	.datetime-group input[type="time"] {
		width: 100%;
	}
	
	.wish-types {
		justify-content: center;
	}
	
	.wish-tag {
		padding: 6px 12px;
		font-size: 0.9rem;
	}
	
	.fortune-card {
		padding: 20px;
	}
	
	.temple-select {
		font-size: 0.9rem;
	}
	
	.gender-group {
		flex-direction: column;
		gap: 10px;
	}
}

/* Mobile responsive styles */
@media (max-width: 480px) {
	.wish-tag {
		padding: 5px 10px;
		font-size: 0.85rem;
	}
}

/* Disclaimer styling */
.disclaimer {
	max-width: 1200px;
	margin: 30px auto 20px;
	padding: 15px 20px;
	background: rgba(0, 0, 0, 0.3);
	border-left: 4px solid #b8860b;
	border-radius: 8px;
	font-size: 0.85rem;
	color: #e0e0e0;
	backdrop-filter: blur(5px);
}

.disclaimer-content {
	line-height: 1.6;
}

.disclaimer-content p {
	margin-bottom: 8px;
}

.disclaimer-content i {
	color: #ffd700;
	margin-right: 5px;
}

.disclaimer-content strong {
	color: #ffd700;
	font-size: 0.9rem;
}

/* Disclaimer Checkbox - Vertical alignment fix */
.disclaimer-checkbox {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.disclaimer-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #8b6e4b;
    vertical-align: middle;
    display: inline-block;
    position: relative;
    top: -1px;
}

.disclaimer-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

/* iOS specific fix */
@supports (-webkit-touch-callout: none) {
    .disclaimer-checkbox {
        display: flex;
        align-items: center;
    }
    
    .disclaimer-checkbox input[type="checkbox"] {
        transform: translateY(0);
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .disclaimer-checkbox label {
        display: flex;
        align-items: center;
        line-height: 1;
    }
}

/* Disclaimer highlight animation */
.disclaimer.highlight {
    animation: highlightPulse 1.5s ease;
}

@keyframes highlightPulse {
    0% { background-color: transparent; }
    30% { background-color: rgba(139, 110, 75, 0.15); }
    70% { background-color: rgba(139, 110, 75, 0.1); }
    100% { background-color: transparent; }
}

/* Language switcher */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-top: 15px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-family: inherit;
}

.lang-btn:hover {
    background: #ffd700;
    color: #1a1c2c;
}

.lang-btn:hover i {
    color: #1a1c2c;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 150px;
    backdrop-filter: blur(10px);
}

.lang-menu.show {
    display: block;
}

.lang-option {
    display: block;
    padding: 8px 15px;
    color: #4a2e1f;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    text-align: center;
    cursor: pointer;
}

.lang-option:hover {
    background: #ffd700;
    color: #1a1c2c;
}

.lang-option.active {
    background: #b8860b;
    color: white;
    font-weight: bold;
}

/* Required field star */
.required-star {
    color: #c00;
    margin-left: 2px;
}

/* Header font size adjustments */
.header h1 {
	font-size: 2rem;  
}

.result-header h2 {
	font-size: 1.3rem; 
}

/* Responsive styles */
@media (max-width: 768px) {
	.disclaimer {
		padding: 12px 15px;
		font-size: 0.8rem;
	}
	
	.footer small {
		font-size: 0.75rem;
	}
	
    .header h1 {
        font-size: 1.5rem !important;  
    }
	
	.result-header h2 {
		font-size: 1.1rem !important;  
	}
	
    .disclaimer-checkbox input[type="checkbox"] {
        width: 12px !important;
        height: 12px !important;
        top: 0;
    }
    
    .disclaimer-checkbox label {
        font-size: 14px !important;
        line-height: 1.3;
    }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #fff9f0, #fff);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid #ffd700;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4rem;
    color: #b8860b;
    margin-bottom: 20px;
}

.modal-icon i {
    animation: modalPulse 1.5s infinite;
}

@keyframes modalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-message {
    font-size: 1.2rem;
    color: #4a2e1f;
    margin-bottom: 25px;
    line-height: 1.6;
    font-weight: 500;
}

.modal-button {
    background: linear-gradient(135deg, #b8860b, #8b5a2b);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        width: 85%;
    }
    
    .modal-icon {
        font-size: 3rem;
    }
    
    .modal-message {
        font-size: 1rem;
    }
    
    .modal-button {
        padding: 10px 30px;
        font-size: 1rem;
    }
}

/* Loading description styling - smaller size */
.loading-desc {
    margin-top: 15px;
    font-size: 0.85rem;  /* Smaller than loading-subtext */
    color: #e0e0e0;
    opacity: 0.9;
    letter-spacing: 1px;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 0.9; transform: translateY(0); }
}

/* Optional: Add a subtle pulse effect */
.loading-desc {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Mobile responsive adjustment */
@media (max-width: 768px) {
    .loading-desc {
        font-size: 0.75rem;  /* Even smaller on mobile */
        margin-top: 12px;
    }
}

/* Payment Modal */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    backdrop-filter: blur(5px);
}

.payment-modal-overlay.active {
    display: flex;
}

.payment-modal {
    background: linear-gradient(135deg, #fff9f0, #fff);
    border-radius: 30px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
    animation: modalSlideIn 0.3s ease;
}

.payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5d5b5;
}

.payment-modal-header h2 {
    color: #4a2e1f;
    font-size: 1.5rem;
}

.payment-modal-header i {
    color: #b8860b;
    margin-right: 10px;
}

.payment-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #8b7355;
    transition: color 0.3s;
}

.payment-modal-close:hover {
    color: #c00;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-button {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.apple-pay-button {
    background: #000;
    color: white;
    border: 2px solid #333;
}

.apple-pay-button:hover {
    background: #333;
}

.google-pay-button {
    background: #4285f4;
    color: white;
    border: 2px solid #3367d6;
}

.google-pay-button:hover {
    background: #3367d6;
}

.card-button {
    background: linear-gradient(135deg, #b8860b, #8b5a2b);
    color: white;
    border: 2px solid #ffd700;
}

.card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.3);
}

.pay-now-button {
    background: #28a745;
    color: white;
    margin-top: 15px;
}

.pay-now-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.card-element {
    padding: 15px;
    border: 2px solid #e5d5b5;
    border-radius: 12px;
    background: white;
    margin-bottom: 15px;
}

.card-errors {
    color: #c00;
    font-size: 0.9rem;
    margin-bottom: 10px;
    min-height: 20px;
}

.payment-loading {
    text-align: center;
    padding: 20px;
}

.payment-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.payment-modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5d5b5;
    text-align: center;
    color: #8b7355;
    font-size: 0.9rem;
}

.payment-modal-footer i {
    color: #28a745;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .payment-modal {
        padding: 20px;
        width: 95%;
    }
    
    .payment-button {
        padding: 12px 15px;
        font-size: 1rem;
    }
}