html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

/* Đảm bảo body có chiều cao tối thiểu để trang luôn đủ dài */
html, body {
  min-height: 100%;
}

body {
  margin-bottom: 0; /* Xóa margin-bottom mặc định */
  padding-bottom: 0; /* Xóa padding-bottom mặc định */
  margin-bottom: 0; /* Xóa margin-bottom đang đẩy footer lên */
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Đảm bảo body chiếm ít nhất toàn bộ chiều cao viewport */
}

main {
  flex: 1; /* Cho phép main mở rộng để đẩy footer xuống cuối */
}

.footer {
  position: relative; /* Thay đổi từ absolute thành relative */
  width: 100%;
  padding: 1rem 0;
  margin-top: 1rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Avatar styling */
img.avatar-image, 
.user-menu img.rounded-circle {
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-menu img.rounded-circle {
    width: 30px !important;
    height: 30px !important;
}

#avatar-preview {
    width: 150px !important;
    height: 150px !important;
}

#modal-avatar-preview {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto;
}

/* Fix image loading */
img[src=""] {
    display: none;
}

/* Avatar loading animation */
.avatar-loading {
    position: relative;
    overflow: hidden;
    background-color: #e9ecef;
}

.avatar-loading::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Word suggestions style */
.suggestions {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 10px;
    margin-top: 5px;
    position: absolute;
    width: calc(100% - 20px);
    z-index: 1000;
}

.suggestions p {
    margin: 0;
    padding: 5px 0;
}

/* Loading indicator */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styling for test question navigation */
.question-navigation-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-nav-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.question-nav-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.question-nav-btn.btn-success {
    color: white;
}

.question-nav-btn.btn-primary {
    color: white;
}