/* =============================================================== */
/* STYLES CHUNG & FONT                                             */
/* =============================================================== */
body {
  font-family: 'Poppins', sans-serif;
  /* UPDATED: Nền gradient pastel mới */
  background: linear-gradient(-45deg, #fbc2eb, #a6c1ee, #8fd3f4, #a1c4fd);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
}

/* Animation cho background */
@keyframes gradientBG {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}


/* =============================================================== */
/* HIỆU ỨNG & ANIMATION                                            */
/* =============================================================== */

/* --- Hiệu ứng tải (Loader) --- */
.loader {
  border: 5px solid #f3f3f3; /* Màu xám nhạt */
  border-top: 5px solid #14b8a6; /* Màu Teal đậm hơn */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
.btn-loader {
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: white;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Hiệu ứng chuyển cảnh (Transitions) --- */
.progress-bar {
  transition: width 0.5s ease-in-out;
}
.step-card:not(.active) {
  display: none;
}
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================================== */
/* ĐỊNH KIỂU CHO CÁC THÀNH PHẦN CỤ THỂ                             */
/* =============================================================== */

/* --- Thước đo điểm tiềm năng (Potential Score Gauge) --- */
.score-gauge {
    background: conic-gradient(
        #14b8a6 calc(var(--progress-value, 0) * 1%), 
        #e5e7eb 0
    );
    position: relative;
}
.score-gauge::before {
    content: '';
    position: absolute;
    inset: 10px;
    background: white;
    border-radius: 50%;
}
.score-gauge .score-text {
    position: relative;
    z-index: 1;
}

/* --- Màn hình so sánh (Comparison View) --- */
.comparison-view {
    scroll-snap-align: start;
}
#comparison-grid-container {
    scroll-snap-type: x mandatory;
}

/* --- Nội dung có thể chỉnh sửa (Editable Content) --- */
[contenteditable="true"] {
  outline: 2px solid transparent;
  transition: background-color 0.2s;
}
[contenteditable="true"]:focus {
  background-color: #f0fdfa; /* light teal */
  outline-color: #14b8a6; /* teal */
}

/* --- Cửa sổ Modal --- */
#modal-container.hidden { display: none; }
.modal-overlay { transition: opacity 0.3s ease-in-out; }
.modal-overlay.opacity-0 { opacity: 0; }
.modal-content { transition: transform 0.3s ease-in-out; }
.modal-content.scale-95 { transform: scale(0.95); }

/* --- Trình chỉnh sửa Landing Page (LP Editor) --- */
#lp-editor label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
#lp-editor input, #lp-editor textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#lp-editor input:focus, #lp-editor textarea:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.4);
}
#lp-editor .editor-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* --- Thanh cuộn (Scrollbar) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a7f3d0;
}

/* --- Các thành phần tương tác chung --- */
button, a, input, select {
  transition: all 0.2s ease-in-out;
}
button:hover, a.hover\\:bg-white\\/50:hover {
  transform: translateY(-1px);
}
button:active {
    transform: scale(0.98);
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid #5eead4; /* teal-300 */
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* --- Hiệu ứng cho thẻ (Interactive Card) --- */
.interactive-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.interactive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* --- Thông báo nhanh (Toast Notification) --- */
.toast {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    animation: toast-enter 0.5s ease-in-out;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.5s, transform 0.5s;
}
.toast.success {
    background-color: #10b981; /* emerald-500 */
}
.toast.error {
    background-color: #ef4444; /* red-500 */
}
.toast.leaving {
    opacity: 0;
    transform: translateX(100%);
}
@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Các chỉ số (Key Metrics) --- */
.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.metric-icon {
  width: 1.75rem; /* 28px */
  height: 1.75rem; /* 28px */
  margin-bottom: 0.25rem;
}
.metric-label {
  font-size: 0.75rem; /* 12px */
  color: #64748b; /* slate-500 */
  font-weight: 500;
}
.metric-value {
  font-size: 1rem; /* 16px */
  color: #1e293b; /* slate-800 */
  font-weight: 600;
}

/* === GUIDE BOT STYLES === */
#guide-chat-widget {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
#guide-chat-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.chat-bubble {
    opacity: 0;
    transform: translateY(20px);
    animation: pop-in 0.5s forwards ease-out;
}
.bot-bubble {
    background-color: #f0fdfa; /* teal-50 */
    color: #134e4a; /* teal-900 */
    border-radius: 20px 20px 20px 5px;
}
.user-bubble {
    background-color: #f1f5f9; /* slate-100 */
    color: #1e293b; /* slate-800 */
    border-radius: 20px 20px 5px 20px;
}
.option-button {
    transition: all 0.2s ease-in-out;
}
.option-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
@keyframes pop-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* === END GUIDE BOT STYLES === */
