.fadeIn {
    animation: fadeIn 1s ease-in-out;
}


body {
  font-family: 'Poppins', sans-serif !important;
}


/* body {
  font-family: 'Montserrat', sans-serif !important;
} */



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



#result {
    font-size: 18px;
    padding: 15px;
    border-radius: 8px;
}


@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out infinite;
}


/* Định dạng phần profile */
.header_profile a {
    margin-left: 20px;
    text-decoration: none;
    font-size: 18px;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.header_profile a:hover {
    color: var(--main-color);
}

.header_profile{
    width: 250px;
}

.avatar-circle {
    width: 40px; 
    height: 40px;
    margin-left: 20px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}
.user-info {
    display: flex;
    align-items: center;
    /* width: 250px; */
}
.user-info img {
    margin-right: 10px;
}



/* Page register */

.register-container {
    display: flex;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 40px;
    height: 600px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* .register-form, .register-background {
    width: 50%;
    height: 100%;
    transition: transform 0.5s ease, opacity 0.5s ease, color 0.5s ease, background-color 0.5s ease;
} */

.register-form {
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--secondary-color);
    width: 70%;
}


.register-container:hover .register-form {
    /* transform: translateX(100%); */
    color: var(--main-color);
}

.register-container:hover .register-form input{
    outline: 1px solid var(--main-color);
}

.register-container:hover .register-form button {
    background-color: var(--main-color);
}




.register-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.register-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: 1px solid var(--secondary-color);
}

.register-form button {
    width: 100%;
    height: 50px;
    padding: 10px;
    background-color: var(--secondary-color);
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    /* transition: background-color 0.5s ease, color 0.5s ease; */
}


/* Page login */
.login-container {
    display: flex;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 40px;
    height: 400px;
    width: 100%;
    overflow: hidden;
    position: relative;
}



.login-form {
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--secondary-color);
}





.login-container:hover .login-form {
    /* transform: translateX(100%); */
    color: var(--main-color);
}

.login-container:hover .login-form input{
    outline: 1px solid var(--main-color);
}

.login-container:hover .login-form button {
    background-color: var(--main-color);
}

.google-login{
    text-decoration: none;
    color: red;
    background-color: #000;
    padding: 10px;
    border-radius: 5px;
}

.forgot-password{
    padding: 10px;
    /* text-align: center; */
    text-decoration: none;
}




.login-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: 1px solid var(--secondary-color);
}

.login-form button {
    width: 100%;
    height: 50px;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    /* transition: background-color 0.5s ease, color 0.5s ease; */
}


.header_language a.active img {
    border: 2px solid red;
    border-radius: 50%;
}

#joinRoomForm{
    padding-right: 10px;
}

.is-invalid {
    border: 2px solid red !important;
}


/* Hiển thị lỗi input email */
.input-error-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.input-error {
    border: 5px solid red !important;
    padding-right: 35px; /* chừa chỗ cho icon */
}

.input-error-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: red;
    font-size: 18px;
    cursor: pointer;
}

.input-error-tooltip {
    position: absolute;
    right: 30px;
    top: -40px;
    background-color: #f44336;
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    white-space: nowrap;
    display: none;
    z-index: 999;
}

.input-error-icon:hover + .input-error-tooltip {
    display: block;
}

/* Không nhập đúng mật khẩu */
.is-invalid {
    border: 1px solid red !important;
}


/* CSS cho phần chọn ảnh trong form đăng ký */

/* .role-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.role-option {
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 10px;
    border-radius: 10px;
    transition: border 0.3s, transform 0.2s;
}

.role-option img {
    width: 120px;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.role-option input[type="radio"] {
    display: none;
}

.role-option input[type="radio"]:checked + img,
.role-option:has(input[type="radio"]:checked) {
    border: 2px solid red;
    transform: scale(1.05);
} */


.role-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.role-option {
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 10px;
    border-radius: 10px;
    transition: border 0.3s, transform 0.2s;
}

.role-option img {
    width: 120px;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.role-option input[type="radio"] {
    display: none;
}

.role-option.active {
    border: 2px solid red;
    transform: scale(1.05);
}

select[name="role"] {
    display: none; /* Ẩn dropdown */
}



.cursor {
  display: inline-block;
  animation: blink 0.7s infinite;
  color: black;
  font-weight: bold;
}

#loading-spinner {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}



/* Làm led đen đỏ cho các div */

.led-frame {
  position: relative;
  padding: 8px;
  border-radius: 16px;
  z-index: 1;
  overflow: hidden;
}

/* LED hiệu ứng chạy xung quanh */
.led-frame::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    red 0%, black 25%, red 50%, black 75%, red 100%
  );
  background-size: 400% 400%;
  animation: ledBorderMove 5s linear infinite;
  z-index: 0;
  padding: 10px;
  box-sizing: border-box;

  /* mask để chỉ giữ viền ngoài */
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Chuyển động chạy viền */
@keyframes ledBorderMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 400% 0%; }
}


/* Làm nút bắt đầu có đèn led */
.animated-gradient-btn {
  position: relative;
  overflow: hidden;
  color: white;
  border: none;
  z-index: 1;
  background: linear-gradient(270deg, red, black, red);
  background-size: 400% 400%;
  animation: gradientShift 4s linear infinite;
  transition: color 0.3s ease-in-out;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.navbar-brand {
    font-size: 30px;
    font-weight: bold;
    color: #ff0000 !important; 
    text-shadow: 2px 2px 4px #000; /* bóng đen */
    font-family: 'Poppins', sans-serif;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #cc0000; /* đỏ đậm khi hover */
    transform: scale(1.05);
    text-decoration: none;
}

footer a:hover {
  color: red;
  text-decoration: underline;
}


.dropdown-menu .dropdown-item:hover {
    background-color: red;
    color: #fff;
}

.red-placeholder::placeholder {
    color: rgba(255, 0, 0, 0.6) !important;
}

#question-count::placeholder{
    color: rgba(255, 0, 0, 0.6) !important;
}



#information-mobile {
    padding: 10px 0;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}



#information-mobile .header_language a {
    display: inline-block;
    padding: 3px;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

#information-mobile .header_language a.active {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

#information-mobile .header_language img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

#information-mobile .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#information-mobile .user-info img.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
}

#information-mobile .user-info div {
    flex-grow: 1;
}

#information-mobile .user-info div .fw-bold {
    font-size: 16px;
}

#information-mobile .user-info a.logout {
    color: #dc3545;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    margin-top: 2px;
}

#information-mobile .user-info a.logout:hover {
    text-decoration: underline;
}


.answer-textarea {
    width: 50% !important;
    resize: none !important;
}


.matching-container{
    width: 50% !important;
}



#wheelCanvas{
    width: 500px;
    height: 500px;
}




/* Nền popup màu đen, chữ trắng */
.swal2-popup {
    background: #111; /* Đen */
    color: #fff;      /* Trắng */
}

/* Tiêu đề màu đỏ */
.swal2-title {
    color: #ff3333; /* Đỏ */
}

/* Ô input nền đen, chữ trắng, viền đỏ */
.swal2-input {
    background: #222;
    color: #fff;
    border: 1px solid #ff3333;
}

/* Nút xác nhận đỏ */
.swal2-confirm {
    background-color: #ff3333 !important;
    color: #fff !important;
    border: none;
}

/* Nút hủy đen */
.swal2-cancel {
    background-color: #333 !important;
    color: #fff !important;
    border: 1px solid #555;
}

/* Nút xác nhận hover */
.swal2-confirm:hover {
    background-color: #ff0000 !important;
}

/* Nút hủy hover */
.swal2-cancel:hover {
    background-color: #555 !important;
}



#progress-indicator .question-indicator-box.current,
#progress-tracker-indicator .question-cell.current {
  background-color: #0d6efd; /* xanh dương */
  color: #fff;
  font-weight: 600;
}


.progress-grid {
    display: flex;
    flex-wrap: wrap; /* tự xuống hàng */
    gap: 5px; /* khoảng cách */
    max-width: calc(10 * 40px + 10 * 5px); /* 10 ô + khoảng cách giữa */
}

.question-cell {
    width: 40px; /* kích thước ô */
    height: 40px;
    text-align: center;
}


/*Hiển thị giải thích*/

.explanation-section {
    border-top: 2px solid #dee2e6;
    padding-top: 15px;
    margin-top: 20px !important;
}

.explanation-section .alert-info {
    background-color: #e8f4fd;
    border-color: #b6d7ff;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.explanation-section h6 {
    color: #0c5460;
    margin-bottom: 10px;
}

.explanation-content {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

.explanation-section .fas {
    color: #ffc107;
    margin-right: 5px;
}

/* Animation khi hiện giải thích */
.explanation-section.show {
    display: block !important;
    animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.favorites-test{
    text-decoration: none;
    color: #fff;
}

.favorites-test:hover{
    color: red;
}








/* Dành cho màn hình nhỏ như điện thoại */
@media (max-width: 768px) {
    /* Ví dụ thu nhỏ navbar, font chữ, hoặc ẩn bớt menu */
    nav.navbar {
        padding: 0.5rem 1rem;
    }

    .logout{
        display: none;
    }

    nav.navbar .navbar-brand {
        font-size: 1.2rem;
    }

    nav.navbar .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.5rem;
    }

    /* form#joinRoomForm {
        display: none;
    } */
     

    #navbarNav{
        padding-left: 20px;
    }

    #joinRoomForm{
        padding-top: 10px;
        padding-right: 80px;
    }

    form#joinRoomForm input {
        flex: none;
        width: 100%;
    }

    form#joinRoomForm button {
        width: 100%;
    }

    .header_language img {
        width: 16px !important;
    }

    .header_profile {
        font-size: 1rem;
    }

    /* Thu nhỏ avatar */
    .avatar-circle {
        width: 30px;
        height: 30px;
    }


    .half-width-offcanvas {
        width: 50% !important;
        max-width: none;
    }


    #mobileSidebar {
        background-color: #000; /* Màu đen */
        color: red;
    }

    /* Tiêu đề header */
    #mobileSidebar .offcanvas-header {
        border-bottom: 1px solid red;
    }

    /* Tiêu đề */
    #mobileSidebar .offcanvas-title {
        color: red;
    }

    /* Nút đóng */
    #mobileSidebar .btn-close {
        filter: invert(1); /* Đổi nút close thành trắng */
    }

    /* Danh sách nav */
    #mobileSidebar .nav-link {
        color: red;
        padding: 10px 15px;
        border-radius: 5px;
        transition: background-color 0.3s, color 0.3s;
    }

    /* Hover vào nav-link */
    #mobileSidebar .nav-link:hover {
        background-color: red;
        color: #000; /* chữ đen khi hover */
    }
    
    
    /*#startQuiz{*/
    /*    width: 100% !important;*/
    /*}*/
    
    .img-empty{
        width: 300px !important;
    }
    
    #information{
        display: none;
    }
    
    
    .answer-textarea {
        width: 100% !important;
    }
    
    .matching-container{
        width: 100% !important;
    }
    
    .matching-left{
        width: 50% !important;
    }
    
    .matching-right{
        width: 50% !important;
    }
    
    
    #wheelCanvas{
        width: 300px !important;
        height: 300px !important;
    }
    
    
    
    #progress-indicator .question-indicator-box {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px;
        margin-right: 3px !important;
    }
    #prev-btn, #next-btn {
        padding: 3px 6px;
        font-size: 12px;
    }

    /* Ẩn hoặc thu gọn một số phần không cần thiết trên điện thoại */
    /* Ví dụ ẩn text trong menu, chỉ hiện icon, hoặc ẩn 1 số nút */
}
























