/* File: public/assets/tryon-tool.css */

/* CSS Variables */
.ai-tryon-app-container {
    --bg-color: var(--ai-tryon-bg-color, #FFFFFF);
    --text-color: var(--ai-tryon-text-color, #000000);
    --primary-color: #007cba;
    --border-color: #e5e7eb; 
    --bg-light: #f9fafb;     
    --bg-result: #f3f4f6;   
}
/* Layout chính 2 cột (Grid) */
.ai-tryon-wrap-new {
    display: grid;
    grid-template-columns: 400px 1fr; 
    gap: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    max-width: 1400px;
    margin: 20px auto;
}
/* Cột điều khiển (Trái) */
.ai-tryon-controls {
    padding: 24px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    gap: 24px;
}
/* Cột kết quả (Phải) */
.ai-tryon-results { padding: 24px; display: flex; align-items: center; justify-content: center; }
.ai-tryon-section { width: 100%; }
.ai-tryon-title { font-size: 18px; font-weight: 600; margin-top: 0; margin-bottom: 5px; color: var(--text-color); }
.ai-tryon-subtitle { font-size: 14px; margin-top: 0; margin-bottom: 15px; color: #555; }

/* Tab Styles (Dùng chung cho Quần áo và Người mẫu) */
.ai-tryon-tabs {
    display: flex;
    border-radius: 8px;
    background: #e5e7eb;
    padding: 4px;
    margin-bottom: 5px;
}
.ai-tryon-tabs button {
    flex: 1; padding: 8px 12px; border: none; background: transparent;
    cursor: pointer; font-size: 13px; font-weight: 500;
    border-radius: 6px; color: #333;
	margin-bottom : 0;
}
.ai-tryon-tabs button.active {
    background: #fff; color: var(--primary-color); font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Upload Box */
.ai-tryon-upload-box {
    border: 2px dashed var(--border-color); border-radius: 8px;
    text-align: center; position: relative; cursor: pointer;
    background: #fff; transition: border-color 0.2s; overflow: hidden;
}
.ai-tryon-upload-box:hover { border-color: var(--primary-color); }
.ai-tryon-upload-box input[type="file"] {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: -1;
}
.ai-tryon-preview-area {
    padding: 10px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 120px; position: relative; z-index: 1;
}
.ai-tryon-preview-area span { font-size: 14px; font-weight: 500; color: var(--primary-color); }
.ai-tryon-preview-area img { max-width: 100%; max-height: 200px; height: auto; border-radius: 4px; }
.ai-tryon-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ----- CSS MỚI ĐỂ KHÓA UPLOAD ----- */
.ai-tryon-upload-box.disabled {
    cursor: not-allowed;
    background-color: #f0f0f0; /* Màu xám */
    opacity: 0.7;
}
.ai-tryon-upload-box.disabled:hover {
    border-color: var(--border-color); /* Không đổi màu viền khi hover */
}
.ai-tryon-upload-box.disabled .ai-tryon-preview-area span {
    color: #999; /* Màu text xám */
    text-decoration: line-through; /* Gạch ngang chữ */
}
/* ---------------------------------- */

/* Grid Người mẫu */
.ai-tryon-model-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px;
    max-height: 400px; 
    overflow-y: auto;
    padding: 5px;
}
.ai-tryon-preset-model-item {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    aspect-ratio: 3/4; 
}
.ai-tryon-preset-model-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.ai-tryon-preset-model-item:hover { border-color: #aaa; }
.ai-tryon-preset-model-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0,124,186,0.5);
}
.ai-tryon-preset-model-item.selected::after {
    content: '✔'; position: absolute; top: 5px; right: 5px;
    background: var(--primary-color); color: white; border-radius: 50%;
    width: 20px; height: 20px; display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold;
}

/* Grid Quần áo */
.ai-tryon-grid-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 20px;
    margin-top: 0px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}
.ai-tryon-grid-title.no-upload {
    margin-top: 5px; 
    border-top: none;
    padding-top: 0;
}
.ai-tryon-cloth-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}
.ai-tryon-preset-cloth-item {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    aspect-ratio: 3/4; 
    background: #fff;
}
.ai-tryon-preset-cloth-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    display: block;
    padding: 5px; 
}
.ai-tryon-preset-cloth-item:hover {
    border-color: #aaa;
}
.ai-tryon-preset-cloth-item.selected {
    border-color: var(--primary-color);
}

/* (Phần còn lại của CSS: Form Elements, Nút Process... giữ nguyên) */
.ai-tryon-controls label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 5px; }
.ai-tryon-controls select { width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; }
#ai_tryon_process_button { width: 100%; padding: 12px; font-size: 16px; font-weight: 600; background: var(--primary-color); color: #fff; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; }
#ai_tryon_process_button:hover { background-color: #005a8a; }
#ai_tryon_process_button:disabled { background: #aaa; cursor: not-allowed; }
.ai-tryon-result-area { width: 100%; height: 100%; min-height: 600px; border-radius: 8px; background: var(--bg-result); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.ai-tryon-placeholder { text-align: center; padding: 20px; color: #555; }
.ai-tryon-placeholder-icon { font-size: 48px; margin-bottom: 10px; }
#ai_tryon_result_image { width: 100%; height: 100%; object-fit: contain; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.ai-tryon-spinner { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 15px auto; }
@keyframes pulsate { 0% { opacity: 0.2; } 50% { opacity: 1.0; } 100% { opacity: 0.2; } }
.ai-tryon-dots.pulsate { display: inline-block; animation: pulsate 1.5s infinite; }
.ai-tryon-switch-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 10px; background: #fff; border-radius: 8px; }
.ai-tryon-switch-wrap label { margin-bottom: 0; }
.ai-tryon-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.ai-tryon-switch input { opacity: 0; width: 0; height: 0; }
.ai-tryon-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.ai-tryon-slider.round { border-radius: 34px; }
.ai-tryon-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .ai-tryon-slider { background-color: var(--primary-color); }
input:checked + .ai-tryon-slider:before { transform: translateX(22px); }
@media only screen and (max-width: 68em) {
    .ai-tryon-wrap-new { display: block !important; }
}