* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    /* Hiệu ứng fade-in cho toàn bộ trang */
    animation: fadeIn 0.8s ease-out;
}

/* =========== HIỆU ỨNG FADE-IN =========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hiệu ứng fade-in cho các thẻ card */
.card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    margin-bottom: 25px;
    transition: transform 0.3s ease, opacity 0.5s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-5px);
}

/* =========== HIỆU ỨNG CLICK =========== */
/* Hiệu ứng khi click vào nút */
.btn:active {
    transform: translateY(1px) scale(0.98);
    transition: transform 0.1s ease;
}

/* Hiệu ứng ripple (gợn sóng) khi click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Hiệu ứng khi click vào option (trắc nghiệm) */
.option {
    display: block;
    margin: 10px 0;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.option:active {
    transform: scale(0.98);
}

.option:hover {
    background-color: #eef5ff;
    border-color: #2575fc;
}

.option.selected {
    background-color: #e6f0ff;
    border-color: #2575fc;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
}

/* Hiệu ứng khi chọn option */
.option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2575fc;
}

/* =========== HIỆU ỨNG LƯỚT XUỐNG (SCROLL) =========== */
/* Hiệu ứng cho các phần tử khi xuất hiện khi scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========== HIỆU ỨNG NHẬP VĂN BẢN =========== */
.text-answer {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    margin-top: 5px;
    transition: all 0.3s ease;
    background-color: white;
}

.text-answer:focus {
    border-color: #2575fc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
    transform: translateY(-2px);
}

/* Hiệu ứng placeholder */
.text-answer::placeholder {
    color: #aaa;
    transition: color 0.3s ease;
}

.text-answer:focus::placeholder {
    color: #777;
}

/* Hiệu ứng khi nhập văn bản (typing effect) */
.typing-effect {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid #6a11cb;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #6a11cb; }
}

/* =========== HIỆU ỨNG CHỌN (SELECTION) =========== */
::selection {
    background-color: rgba(106, 17, 203, 0.3);
    color: #333;
}

/* Hiệu ứng cho các nút khi được chọn */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.3);
}

/* Hiệu ứng cho link-box khi được chọn */
.link-box {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-family: monospace;
    word-break: break-all;
    font-size: 1.1rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.link-box:active {
    transform: scale(0.98);
}

.link-box.selected {
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    background-color: #f9f5ff;
}

/* =========== HIỆU ỨNG PULSE CHO CÁC NÚT QUAN TRỌNG =========== */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

/* =========== HIỆU ỨNG CHO SCORE CIRCLE =========== */
.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(#6a11cb 0% 75%, #f0f0f0 75% 100%);
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    animation: circleAppear 1s ease-out forwards;
}

@keyframes circleAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* =========== HIỆU ỨNG LOADING =========== */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #6a11cb;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite, colorChange 3s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes colorChange {
    0%, 100% { border-top-color: #6a11cb; }
    50% { border-top-color: #2575fc; }
}

/* =========== HIỆU ỨNG CHUYỂN ĐỔI MÀN HÌNH =========== */
.hidden {
    display: none !important;
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* =========== HIỆU ỨNG CHO SHARE ICONS =========== */
.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-icon:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.share-icon:active:after {
    animation: ripple 0.6s ease-out;
}

.share-icon:hover {
    transform: translateY(-5px) scale(1.1);
}

/* =========== HIỆU ỨNG CHO PROGRESS BAR =========== */
.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    border-radius: 5px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg, 
        rgba(255, 255, 255, 0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.2) 75%, 
        transparent 75%, 
        transparent
    );
    z-index: 1;
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* =========== HIỆU ỨNG CHO ANSWER REVIEW =========== */
.answer-review-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    background-color: #f9f9f9;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.5s ease-out forwards;
    animation-delay: calc(var(--item-index) * 0.1s);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.correct-answer {
    border-left: 5px solid #4CAF50;
}

.incorrect-answer {
    border-left: 5px solid #f44336;
}

/* =========== HIỆU ỨNG CHO FRIENDS ICON =========== */
.friends-icon {
    font-size: 5rem;
    color: #6a11cb;
    margin: 20px 0;
    animation: bounce 2s infinite, colorRotate 5s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes colorRotate {
    0% { color: #6a11cb; }
    50% { color: #2575fc; }
    100% { color: #6a11cb; }
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    padding: 20px;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.welcome-screen {
    text-align: center;
}

.btn {
    display: inline-block;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 10px 20px;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

.question-container {
    margin-top: 20px;
}

.question {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #ddd;
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--question-index) * 0.1s);
}

.question-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #444;
    font-weight: 600;
}

.question-type {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: #666;
}

.option input {
    margin-right: 10px;
}

.link-container {
    background-color: #f0f7ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    border: 2px dashed #6a11cb;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% {
        border-color: #6a11cb;
    }
    50% {
        border-color: #2575fc;
    }
}

.copy-btn {
    background-color: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-btn:hover {
    background-color: #580bb9;
}

.results-container {
    text-align: center;
}

.score-circle-inner {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.score-percent {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6a11cb;
    animation: countUp 1.5s ease-out forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-label {
    font-size: 1rem;
    color: #666;
}

.result-message {
    font-size: 1.5rem;
    margin: 20px 0;
    color: #444;
}

.relationship-level {
    font-size: 1.8rem;
    color: #6a11cb;
    font-weight: 700;
    margin: 15px 0;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-status {
    font-weight: 600;
    margin-top: 5px;
}

.correct-text {
    color: #4CAF50;
}

.incorrect-text {
    color: #f44336;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out 0.5s forwards;
    opacity: 0;
}

.instruction {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #555;
    border-left: 4px solid #6a11cb;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.facebook {
    background-color: #3b5998;
}

.zalo {
    background-color: #0068ff;
}

.link-icon {
    background-color: #6a11cb;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-circle-inner {
        width: 120px;
        height: 120px;
    }
    
    .score-percent {
        font-size: 2rem;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

/* Các hiệu ứng Animation, Card, Button, Input đã giữ lại và tối ưu từ bản gốc */

/* CUSTOM STYLES */

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    padding: 20px;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    animation: slideDown 0.8s ease-out;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    margin-bottom: 25px;
    transition: transform 0.3s ease, opacity 0.5s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.hidden {
    display: none !important;
}

.btn {
    display: inline-block;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.text-answer {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    margin-top: 5px;
    transition: all 0.3s ease;
    background-color: white;
}
.text-answer:focus {
    border-color: #2575fc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
    transform: translateY(-2px);
}

/* INPUT GROUP */
.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
}

/* QUESTION EDITOR STYLES */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.btn-delete {
    background: #f44336;
    padding: 8px 15px !important;
    border-radius: 5px !important;
}

/* OPTION MANAGEMENT */
.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.option-row input[type="radio"] {
    min-width: 20px;
}
.btn-remove-option {
    background-color: #f44336;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn-remove-option:hover {
    background-color: #d32f2f;
}
.btn-add-option {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 5px;
    transition: background-color 0.2s;
}
.btn-add-option:hover {
    background-color: #43a047;
}

/* QUIZ STYLES */
.option {
    display: flex; /* Dùng flex để căn chỉnh radio và text */
    align-items: center;
    margin: 10px 0;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}
.option:hover {
    background-color: #eef5ff;
    border-color: #2575fc;
}
.option.selected {
    background-color: #e6f0ff;
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    font-weight: 600;
}
.hidden-radio {
    /* Ẩn radio button mặc định để dùng CSS style cho label */
    display: none; 
}
.option span {
    margin-left: 10px;
}


/* LEADERBOARD STYLES */
.leaderboard-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.8s ease-out;
}
.leaderboard-section h3 {
    margin-bottom: 15px;
    color: #6a11cb;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.95rem;
}
.leaderboard-table th, .leaderboard-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.leaderboard-table th {
    background-color: #eee;
    color: #444;
    font-weight: 600;
}
.leaderboard-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

/* TOP RANKING VISUALS */
.top-rank-row {
    background-color: #fffbe6 !important;
    font-weight: 600;
    border-left: 5px solid #ffc107;
}

.current-user-row {
    background-color: #e6f0ff !important;
    font-weight: 700;
    border: 2px solid #2575fc;
    animation: pulseBorder 1s infinite alternate;
}

.gold { color: #FFD700; font-size: 1.2em; text-shadow: 1px 1px 1px #800; }
.silver { color: #C0C0C0; font-size: 1.2em; text-shadow: 1px 1px 1px #800; }
.bronze { color: #CD7F32; font-size: 1.2em; text-shadow: 1px 1px 1px #800; }

@keyframes pulseBorder {
    from {
        box-shadow: 0 0 0 0 rgba(37, 117, 252, 0.4);
    }
    to {
        box-shadow: 0 0 0 5px rgba(37, 117, 252, 0);
    }
}

/* =================================================== */
/* CSS CHO MÀN HÌNH LÀM BÀI (Quiz Screen) */
/* =================================================== */

.option {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f9f9f9;
}

.option:hover {
    background-color: #eee;
    border-color: #6a11cb;
}

.option.selected {
    background-color: #e0e7ff; /* Màu xanh nhạt khi chọn */
    border-color: #6a11cb; /* Viền tím đậm */
    font-weight: bold;
}

.hidden-radio {
    display: none;
}

/* =================================================== */
/* CSS CHO MÀN HÌNH KẾT QUẢ (Answer Review) */
/* =================================================== */

.answer-review-item {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 5px solid;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.answer-review-item.correct-answer {
    border-color: #4CAF50; /* Xanh lá */
    background-color: #f0fff0;
}

.answer-review-item.incorrect-answer {
    border-color: #F44336; /* Đỏ */
    background-color: #fff0f0;
}

.answer-status {
    margin-top: 10px;
    font-weight: bold;
}

.correct-text {
    color: #4CAF50;
}

.incorrect-text {
    color: #F44336;
}

/* Các lựa chọn trong phần review */
.options-review {
    margin: 10px 0;
}

.option-review-item {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-size: 0.9em;
    opacity: 0.7; /* Làm mờ các đáp án không liên quan */
}

/* 1. Đáp án Đúng */
.option-review-item.correct-choice {
    background-color: #e6ffe6; 
    border-color: #4CAF50;
    color: #1b5e20;
    font-weight: 600;
    opacity: 1; 
}

/* 2. Đáp án Người dùng chọn */
.option-review-item.user-selected {
    border-width: 2px;
    font-style: italic;
    opacity: 1;
}

/* 3. Đáp án Sai VÀ Được chọn bởi người dùng (Sẽ đè lên user-selected) */
.option-review-item.incorrect-choice.user-selected {
    background-color: #ffe6e6; 
    border-color: #F44336; 
    color: #b71c1c;
    font-weight: 600;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 10px;
    margin: 0;
    background-image: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.container {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 700px;
    margin-top: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #6a11cb;
}

h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
}

.subtitle {
    color: #555;
    font-size: 1.1em;
}

.card {
    padding: 25px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Các nút chung */
.btn {
    background-color: #6a11cb;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    margin: 5px;
}

.btn:hover:not(.btn-disabled) {
    background-color: #5500a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn:active:not(.btn-disabled) {
    transform: translateY(0);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 20px;
    background-color: #2575fc;
}

.btn-small:hover:not(.btn-disabled) {
    background-color: #1a5ac9;
}

.btn-delete {
    background-color: #f44336;
}
.btn-delete:hover {
    background-color: #d32f2f;
}

.btn-disabled {
    background-color: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.text-answer {
    width: 98%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.text-answer:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 5px rgba(106, 17, 203, 0.5);
    outline: none;
}

/* Question Creator Styles */
.question-container .question {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 5px solid #6a11cb;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-title {
    margin: 0;
    color: #6a11cb;
    font-size: 1.1em;
}

.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.option-row input[type="radio"] {
    margin-right: 10px;
    accent-color: #6a11cb;
}

.btn-remove-option {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8em;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-option {
    background: #2575fc;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    margin-top: 10px;
    cursor: pointer;
}

/* Link Screen Styles */
.link-container {
    display: flex;
    margin-top: 15px;
    margin-bottom: 20px;
    border: 2px solid #6a11cb;
    border-radius: 10px;
    overflow: hidden;
}

.link-box {
    flex-grow: 1;
    padding: 12px;
    background: #eef;
    font-size: 0.9em;
    word-break: break-all;
    display: flex;
    align-items: center;
    color: #444;
}

.copy-btn {
    background: #6a11cb;
    color: white;
    padding: 12px 15px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.share-icon:hover {
    transform: scale(1.1);
}

.facebook { background: #1877f2; }
.zalo { background: #0084ff; }
.link-icon { background: #4caf50; }

/* Quiz Taker Styles */
.option {
    display: block;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.option:hover {
    border-color: #6a11cb;
}

.option.selected {
    background-color: #e0f7fa;
    border-color: #6a11cb;
    box-shadow: 0 0 5px rgba(106, 17, 203, 0.5);
    font-weight: bold;
    color: #6a11cb;
}

.hidden-radio {
    display: none;
}

/* Progress Bar */
.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #6a11cb;
    transition: width 0.5s ease-in-out;
    border-radius: 10px 0 0 10px;
}

#progressText {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #6a11cb;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #6a11cb;
    animation: spin 1s ease infinite;
    margin: 0 auto 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Screen */
.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: conic-gradient(#6a11cb 0% 0%, #f0f0f0 0% 100%);
    box-shadow: 0 0 0 5px #fff, 0 0 0 7px #6a11cb;
}

.score-circle-inner {
    width: 85%;
    height: 85%;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.score-percent {
    font-size: 2.5em;
    font-weight: bold;
    color: #6a11cb;
}

.score-label {
    font-size: 0.9em;
    color: #555;
}

.relationship-level {
    text-align: center;
    font-size: 1.4em;
    font-weight: bold;
    color: #2575fc;
    margin: 15px 0 10px 0;
}

.result-message {
    text-align: center;
    font-size: 1em;
    color: #777;
    margin-bottom: 30px;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 30px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.leaderboard-table th, .leaderboard-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background-color: #6a11cb;
    color: white;
    font-weight: bold;
}

.leaderboard-table tr:nth-child(even) {
    background-color: #f7f7f7;
}

.top-rank-row {
    font-weight: bold;
    background-color: #fff9c4 !important; /* Vàng nhạt */
}

.current-user-row {
    background-color: #e3f2fd !important; /* Xanh nhạt */
    border: 2px solid #2575fc;
}

.gold { color: gold; }
.silver { color: silver; }
.bronze { color: #cd7f32; }

/* Answer Review */
.answer-review {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.answer-review-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 5px solid;
    background: #f9f9f9;
}

.correct-answer {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.incorrect-answer {
    border-left-color: #f44336;
    background: #ffebee;
}

.answer-status {
    font-weight: bold;
    margin-top: 5px;
}

.correct-text { color: #4caf50; }
.incorrect-text { color: #f44336; }

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    color: #ccc;
    font-size: 0.8em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    .link-container {
        flex-direction: column;
    }
    .copy-btn {
        width: 100%;
        border-radius: 0 0 10px 10px;
    }
    .link-box {
        border-radius: 10px 10px 0 0;
    }
    .leaderboard-table th, .leaderboard-table td {
        font-size: 0.9em;
    }
}
