/* --- CÀI ĐẶT CHUNG & BIẾN --- */
:root {
    --primary-color: #3b82f6;
    --primary-color-dark: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --safe-color: #0ea5e9;
    --bg-light: #f8fafc;
    --bg-darker: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
}

/* --- HIỆU ỨNG --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flash-result {
    0% { transform: scale(1.1); color: var(--primary-color-dark); }
    100% { transform: scale(1); color: inherit; }
}

.flash-result-update {
    animation: flash-result 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- HEADER --- */
.title-gradient {
    background-image: linear-gradient(to right, #2563eb, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.warning-box {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 1.5rem auto 0 auto;
    max-width: 600px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.warning-box a {
    color: #0284c7;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.warning-box strong { color: #92400e; }

/* --- BỐ CỤC CHÍNH & TABS --- */
.main-container {
    background-color: #ffffff;
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-darker);
}

.tab-button {
    flex: 1;
    padding: 1rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-button:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--primary-color-dark);
    border-bottom-color: var(--primary-color-dark);
    background-color: #ffffff;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* --- SECTIONS --- */
.card-section {
    padding: 2rem;
    border-radius: 1rem;
    transition: box-shadow 0.3s ease-in-out;
    border: 1px solid transparent;
}

.suggestion-form-section {
    background-color: #f3f8ff;
    border: 1px solid #dbeafe;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-description {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#main-conversion-section {
    background: #faf7ff;
    border-radius: 1.25rem;
    padding: 2.5rem;
}

#transcript-conversion-section {
    background: #f0fdf4;
    border-radius: 1.25rem;
    padding: 2.5rem;
}


/* --- FORM ELEMENTS --- */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.2s ease-in-out;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.cta-button {
    width: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color-dark));
    color: white;
    font-weight: 700;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(0, 118, 255, 0.39);
    transform: translateY(0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0, 118, 255, 0.45);
}

.update-notice {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    text-align: center;
    height: 1.25rem;
    margin-top: 1rem;
}


/* --- GỢI Ý KẾT QUẢ --- */
.result-heading {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.result-subheading { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.result-description { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }

.breakthrough-heading { color: var(--danger-color); }
.goodfit-heading { color: var(--secondary-color); }
.safe-heading { color: var(--primary-color); }

.major-card {
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}
.major-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }

.major-card.breakthrough { background-color: #fef2f2; border-color: #fecaca; }
.major-card.goodfit { background-color: #f0fdf4; border-color: #bbf7d0; }
.major-card.safe { background-color: #eff6ff; border-color: #bfdbfe; }

.major-name { font-weight: 700; }
.major-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; padding-left: 1.75rem; }
.major-forecast { font-weight: 600; }

.progress-bar-container { margin-top: 0.75rem; }
.progress-bar-labels { display: flex; justify-content: space-between; margin-bottom: 0.25rem; font-size: 0.75rem; font-weight: 500; }
.progress-bar-bg { width: 100%; background-color: #e5e7eb; border-radius: 9999px; height: 0.625rem; }
.progress-bar-fill { height: 0.625rem; border-radius: 9999px; transition: width 0.5s ease; }
.progress-bar-fill.breakthrough { background-color: var(--danger-color); }
.progress-bar-fill.goodfit { background-color: var(--secondary-color); }
.progress-bar-fill.safe { background-color: var(--primary-color); }

.other-combinations { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(0,0,0,0.1); }


/* --- KHỐI QUẢNG CÁO ĐẶC BIỆT --- */
.special-ad-block {
    background: linear-gradient(135deg, #6d28d9, #4f46e5);
    color: white;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}
.ad-cta-button {
    margin-top: 1rem;
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: white;
    color: #4f46e5;
    font-weight: 700;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.ad-cta-button:hover { background-color: #f0f0ff; transform: scale(1.03); }

/* --- CÔNG CỤ QUY ĐỔI --- */
.conversion-result-card {
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
}
.conversion-result-title { font-weight: 600; color: var(--text-secondary); font-size: 0.875rem; }
.conversion-result-score {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--text-primary);
}
#thpt-card { border-color: #93c5fd; background-color: #f0f9ff; }
#hsa-card { border-color: #86efac; background-color: #f0fdf4; }
#tsa-card { border-color: #c4b5fd; background-color: #f5f3ff; }

.subject-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all 0.2s ease;
}
.subject-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.subject-title { font-weight: 600; text-align: center; color: var(--text-primary); margin-bottom: 1rem; }
.subject-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}
.main-subject-selector { margin-top: 1rem; text-align: center; }
.main-subject-selector label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s ease;
}
input[type="radio"]:checked + span { font-weight: 600; }
.main-subject-selector label:has(:checked) {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.transcript-result-display {
    background-color: #e0f2fe;
    color: #0c4a6e;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    margin-top: 2rem;
}
.transcript-result-title { font-weight: 600; }
.transcript-result-score { font-size: 3rem; font-weight: 800; margin-top: 0.5rem; }


/* --- FOOTER & SHARE --- */
.share-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #1877f2;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.share-button:hover { background-color: #166fe5; }

.main-footer {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.footer-links { display: flex; justify-content: center; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--primary-color); text-decoration: underline; }
