/* ========== Button ========== */
#v-vision-try-on-btn {
	background-color: #ff6b6b;
	color: white;
	padding: 12px 24px;
	font-size: 16px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	margin-top: 15px;
	transition: background-color 0.3s ease;
}

#v-vision-try-on-btn:hover {
	background-color: #ff5252;
}

/* ========== Modal ========== */
.v-vision-modal {
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: none;
	overflow-y: auto;
}

.v-vision-modal-content {
	background-color: white;
	margin: 5% auto;
	padding: 30px;
	border: 1px solid #888;
	border-radius: 8px;
	width: 700px;
	max-width: 90%;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	animation: slideIn 0.3s ease;
}

@keyframes slideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.v-vision-close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	line-height: 1;
	transition: color 0.2s;
}

.v-vision-close:hover,
.v-vision-close:focus {
	color: #000;
}

.v-vision-modal-content h2 {
	margin: 0 0 20px 0;
	color: #333;
}

.v-vision-modal-content h3 {
	margin: 0 0 15px 0;
	color: #444;
	font-size: 18px;
}

/* ========== Step Indicator ========== */
.v-vision-steps {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	position: relative;
}

.v-vision-steps::before {
	content: '';
	position: absolute;
	top: 20px;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #e0e0e0;
	z-index: 0;
}

.v-vision-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 1;
	cursor: pointer;
	flex: 1;
}

.step-number {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #e0e0e0;
	color: #666;
	border-radius: 50%;
	font-weight: bold;
	font-size: 16px;
	margin-bottom: 8px;
	transition: background-color 0.3s, color 0.3s;
}

.v-vision-step.active .step-number {
	background-color: #ff6b6b;
	color: white;
}

.step-label {
	font-size: 13px;
	color: #999;
	text-align: center;
	white-space: nowrap;
}

.v-vision-step.active .step-label {
	color: #333;
	font-weight: bold;
}

/* ========== Tabs ========== */
.v-vision-tabs {
	display: flex;
	border-bottom: 2px solid #e0e0e0;
	margin-bottom: 20px;
	gap: 0;
}

.v-vision-tab-btn {
	flex: 1;
	padding: 12px 16px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	font-size: 14px;
	color: #666;
	transition: all 0.3s;
	font-weight: 500;
}

.v-vision-tab-btn:hover {
	color: #333;
	background-color: #f5f5f5;
}

.v-vision-tab-btn.active {
	color: #ff6b6b;
	border-bottom-color: #ff6b6b;
}

.v-vision-tab-content {
	display: none;
}

.v-vision-tab-content.active {
	display: block;
}

/* ========== Gallery ========== */
.v-vision-gallery {
	margin-bottom: 20px;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 15px;
	margin-bottom: 15px;
}

.gallery-item {
	position: relative;
	cursor: pointer;
	overflow: hidden;
	border-radius: 8px;
	background: #f5f5f5;
	aspect-ratio: 1;
	transition: all 0.3s;
	border: 2px solid transparent;
}

.gallery-item:hover {
	transform: scale(1.05);
	border-color: #ff6b6b;
}

.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-item-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s;
	color: white;
	font-size: 12px;
	text-align: center;
	padding: 8px;
}

.gallery-item:hover .gallery-item-overlay {
	opacity: 1;
}

.gallery-item-overlay p {
	margin: 2px 0;
}

.gallery-item.selected {
	border-color: #ff6b6b;
	box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.gallery-item.selected::before {
	content: '✓';
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	background: #ff6b6b;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	z-index: 10;
}

.gallery-loading {
	text-align: center;
	color: #999;
	padding: 40px 20px;
}

.gallery-hint {
	color: #999;
	font-size: 13px;
	margin-top: 10px;
	padding: 8px;
	background: #f9f9f9;
	border-radius: 4px;
}

.gallery-empty {
	text-align: center;
	padding: 40px 20px;
	color: #999;
}

/* ========== Upload ========== */
.v-vision-upload {
	margin-bottom: 20px;
}

.upload-area {
	border: 2px dashed #ddd;
	border-radius: 8px;
	padding: 40px 20px;
	text-align: center;
	background: #fafafa;
	cursor: pointer;
	transition: all 0.3s;
	margin-bottom: 15px;
}

.upload-area:hover {
	border-color: #ff6b6b;
	background: #fff5f5;
}

.upload-area p {
	margin: 0 0 10px 0;
	color: #666;
	font-size: 14px;
}

.upload-area input[type="file"] {
	display: none;
}

.upload-btn {
	display: inline-block;
	padding: 8px 16px;
	background: #ff6b6b;
	color: white;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.3s;
}

.upload-btn:hover {
	background: #ff5252;
}

.v-vision-hint {
	color: #999;
	font-size: 13px;
	margin-bottom: 15px;
	padding: 10px;
	background: #f9f9f9;
	border-radius: 4px;
	line-height: 1.6;
}

.save-to-gallery {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	background: #f5f5f5;
	border-radius: 4px;
}

.save-to-gallery input[type="checkbox"] {
	cursor: pointer;
}

.save-to-gallery label {
	cursor: pointer;
	margin: 0;
	font-size: 14px;
}

/* ========== Container ========== */
.v-vision-container {
	margin-top: 20px;
}

/* ========== Preview ========== */
.preview-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
}

.preview-image {
	display: flex;
	align-items: center;
	justify-content: center;
}

.preview-image img {
	max-width: 100%;
	max-height: 300px;
	border-radius: 8px;
}

.preview-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

#detection-result p {
	margin: 10px 0;
	color: #333;
}

#detection-result p:first-child {
	font-weight: bold;
	color: #27ae60;
}

#detection-details {
	color: #666;
	font-size: 14px;
	line-height: 1.6;
}

/* ========== Result ========== */
.result-container {
	margin-bottom: 20px;
}

.result-comparison {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
}

.result-item {
	text-align: center;
}

.result-item p {
	margin: 0 0 10px 0;
	font-weight: bold;
	color: #333;
}

.result-item img {
	width: 100%;
	max-height: 400px;
	object-fit: cover;
	border-radius: 8px;
}

/* ========== Feedback ========== */
.result-feedback {
	background: #f5f5f5;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 20px;
}

.feedback-item {
	margin-bottom: 15px;
}

.feedback-item:last-child {
	margin-bottom: 0;
}

.feedback-item label {
	display: block;
	margin-bottom: 10px;
	font-weight: bold;
	color: #333;
	font-size: 14px;
}

.feedback-item input[type="checkbox"] {
	margin-right: 8px;
	cursor: pointer;
}

.feedback-item textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
}

/* ========== Rating ========== */
.rating-buttons {
	display: flex;
	gap: 10px;
}

.rating-btn {
	flex: 1;
	padding: 12px;
	background: white;
	border: 2px solid #ddd;
	border-radius: 8px;
	font-size: 28px;
	cursor: pointer;
	transition: all 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rating-btn:hover {
	transform: scale(1.1);
	border-color: #ff6b6b;
}

.rating-btn.selected {
	background: #ff6b6b;
	border-color: #ff6b6b;
	color: white;
}

/* ========== Actions ========== */
.v-vision-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	justify-content: flex-end;
}

.v-vision-actions .button {
	padding: 10px 20px;
	font-size: 14px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
	flex: 1;
}

.v-vision-actions .button-secondary {
	background: #e0e0e0;
	color: #333;
}

.v-vision-actions .button-secondary:hover {
	background: #d0d0d0;
}

.v-vision-actions .button-primary {
	background: #ff6b6b;
	color: white;
}

.v-vision-actions .button-primary:hover:not(:disabled) {
	background: #ff5252;
}

.v-vision-actions .button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.v-vision-preview img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#v-vision-start-btn {
	width: 100%;
	padding: 12px;
	background-color: #4CAF50;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color 0.3s ease;
}

#v-vision-start-btn:hover:not(:disabled) {
	background-color: #45a049;
}

#v-vision-start-btn:disabled {
	background-color: #cccccc;
	cursor: not-allowed;
}

/* Credit Display Styles */
.v-vision-credit-info {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px 16px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border-radius: 8px;
	margin: 15px 0;
	font-size: 14px;
}

.credit-label {
	font-weight: 600;
}

.credit-balance {
	font-weight: 700;
	font-size: 16px;
	min-width: 60px;
	text-align: center;
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 8px;
	border-radius: 4px;
}

.credit-status {
	margin-left: 5px;
	font-size: 13px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
}

.credit-status.credit-ok {
	background: rgba(76, 175, 80, 0.3);
	color: #fff;
}

.credit-status.credit-low {
	background: rgba(255, 152, 0, 0.4);
	color: #fff;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

/* Registration Form Styles */
.v-vision-register-form {
	max-width: 500px;
	margin: 30px auto;
	padding: 40px;
	background: white;
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.v-vision-register-form h2 {
	text-align: center;
	color: #333;
	margin-bottom: 30px;
	font-size: 28px;
	font-weight: 700;
}

.v-vision-register-form .form-group {
	margin-bottom: 20px;
}

.v-vision-register-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #555;
	font-size: 14px;
}

.v-vision-register-form input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.3s ease;
	box-sizing: border-box;
}

.v-vision-register-form input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.v-vision-register-form small {
	display: block;
	margin-top: 5px;
	color: #999;
	font-size: 12px;
}

.v-vision-register-form button {
	width: 100%;
	padding: 14px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	margin-top: 15px;
}

.v-vision-register-form button:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.v-vision-register-form button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.register-message {
	padding: 12px 15px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-size: 14px;
	display: none;
}

.register-message.error {
	display: block;
	background: #fee;
	color: #c33;
	border: 1px solid #fcc;
}

.register-message.success {
	display: block;
	background: #efe;
	color: #3c3;
	border: 1px solid #cfc;
}

.v-vision-register-form .login-link {
	text-align: center;
	margin-top: 20px;
	font-size: 14px;
	color: #666;
}

.v-vision-register-form .login-link a {
	color: #667eea;
	text-decoration: none;
	font-weight: 600;
}

.v-vision-register-form .login-link a:hover {
	text-decoration: underline;
}

/* ============================================
   MY GALLERY PAGE
   ============================================ */

.v-vision-my-gallery-page {
max-width: 1100px;
margin: 0 auto;
padding: 20px 0;
}

.gallery-page-header {
margin-bottom: 24px;
}

.gallery-page-header h2 {
font-size: 28px;
font-weight: 700;
margin: 0 0 8px;
}

.gallery-subtitle {
color: #666;
margin: 0 0 12px;
}

.gallery-page-stats {
font-size: 14px;
color: #888;
}

.gallery-page-actions {
display: flex;
gap: 12px;
margin-bottom: 24px;
align-items: center;
}

.gallery-upload-label {
cursor: pointer;
}

.gallery-upload-progress {
margin-bottom: 16px;
padding: 12px 16px;
background: #f8f9ff;
border-radius: 8px;
border: 1px solid #e0e3ff;
}

.progress-bar {
background: #e0e0e0;
border-radius: 4px;
height: 6px;
margin-bottom: 6px;
overflow: hidden;
}

.progress-fill {
height: 100%;
background: linear-gradient(90deg, #667eea, #764ba2);
border-radius: 4px;
transition: width 0.2s ease;
}

.progress-text {
font-size: 13px;
color: #666;
}

/* Gallery grid on page */
.gallery-page-grid-wrapper {
position: relative;
}

.gallery-page-grid-wrapper .gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 16px;
}

.gallery-page-grid-wrapper .gallery-item {
position: relative;
border-radius: 12px;
overflow: hidden;
background: #f5f5f5;
aspect-ratio: 3/4;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-page-grid-wrapper .gallery-item:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.gallery-page-grid-wrapper .gallery-item img {
width: 100%;
height: 100%;
object-fit: cover;
}

.gallery-page-grid-wrapper .gallery-item-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(0,0,0,0.75));
padding: 40px 12px 12px;
opacity: 0;
transition: opacity 0.2s;
display: flex;
flex-direction: column;
gap: 6px;
}

.gallery-page-grid-wrapper .gallery-item:hover .gallery-item-overlay {
opacity: 1;
}

.gallery-page-grid-wrapper .gallery-item-info {
color: white;
font-size: 12px;
line-height: 1.4;
}

.gallery-page-grid-wrapper .gallery-item-info p {
margin: 0;
}

.gallery-page-grid-wrapper .gallery-delete-btn {
background: rgba(220, 53, 69, 0.9);
color: white;
border: none;
border-radius: 6px;
padding: 6px 12px;
font-size: 12px;
cursor: pointer;
width: 100%;
transition: background 0.2s;
}

.gallery-page-grid-wrapper .gallery-delete-btn:hover {
background: #dc3545;
}

.v-vision-notice {
padding: 16px 20px;
background: #f8f9ff;
border-left: 4px solid #667eea;
border-radius: 4px;
color: #333;
}

@media (max-width: 600px) {
.gallery-page-grid-wrapper .gallery-grid {
grid-template-columns: repeat(2, 1fr);
gap: 10px;
}
.gallery-page-actions {
flex-wrap: wrap;
}
}

/* ========== Style Selector (Step 2 / Blueprint) ========== */
.v-vision-style-selector {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e0e4f0;
}

.style-selector-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.style-btn {
    padding: 6px 14px;
    border: 1.5px solid #c5cadf;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.style-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    font-weight: 600;
}

#v-vision-style-used {
    display: none;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* ── Model Selector ── */
.v-vision-model-selector {
    margin-bottom: 14px;
}

.model-options {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.model-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 2px solid #e0e4f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.model-option input[type="radio"] {
    display: none;
}

.model-option:hover {
    border-color: #667eea;
}

.model-option.active {
    border-color: #667eea;
    background: #f0f2ff;
}

.model-option-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.model-option-cost {
    font-size: 11px;
    font-weight: 700;
    color: #667eea;
}

.model-option-desc {
    font-size: 11px;
    color: #888;
}

/* Custom prompt input */
.style-custom-wrap {
    margin-top: 8px;
}

.style-custom-wrap input {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #c5cadf;
    border-radius: 8px;
    font-size: 12px;
    color: #444;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.style-custom-wrap input:focus {
    border-color: #667eea;
    outline: none;
}
