:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4caf50;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --info-color: #2196f3;
}

body {
  font-family: "Segoe UI", "Roboto", sans-serif;
  background-color: #f5f7ff;
  color: var(--dark-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

.navbar {
  background: rgba(255, 255, 255, 0.23);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0px 0px rgba(255, 255, 255, 0);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0;
}

.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
}

.navbar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8),
    transparent,
    rgba(255, 255, 255, 0.3)
  );
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  display: flex;
  align-items: center;
}

.navbar-brand i {
  margin-right: 10px;
  font-size: 1.8rem;
}

.logo-container {
  width: 20%;
}

.logo {
  width: 100%;
}

.main-container {
  margin: 12px auto;
  padding: 0 1.5rem;
  overflow: overlay;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  font-weight: 600;
  padding: 12px 1.5rem;
  border-bottom: none;
}

.card-body {
  padding: 1rem 2rem;
}

.form-control,
.form-select {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(76, 201, 240, 0.25);
  outline: none;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.count-badge {
  background-color: var(--accent-color);
  color: white;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.9rem;
}

.mode-selector {
  display: flex;
  gap: 1rem; /* Khoảng cách giữa các nút */
  justify-content: center; /* Căn giữa các nút trong dòng */
  align-items: center; /* Căn giữa theo chiều dọc */
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-option input[type="radio"] {
  display: none; /* Ẩn nút radio mặc định */
}

.mode-option label {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem; /* Giảm padding để nút nhỏ hơn */
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 25px; /* Góc tròn */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem; /* Giảm kích thước chữ */
}

.mode-option input[type="radio"]:checked + label {
  border-color: var(--primary-color);
  background-color: rgba(67, 97, 238, 0.1); /* Màu nền khi chọn */
  box-shadow: 0 0 0 2px var(--primary-color); /* Đổ bóng */
}

.mode-option label i {
  font-size: 1.2rem; /* Giảm kích thước icon */
  margin-right: 0.5rem; /* Khoảng cách giữa icon và chữ */
  color: var(--primary-color);
}

.mode-option label span {
  font-size: 1rem; /* Điều chỉnh kích thước văn bản */
  color: #333; /* Màu văn bản */
}

/* Hover hiệu ứng khi di chuột vào */
.mode-option label:hover {
  background-color: rgba(67, 97, 238, 0.05);
  box-shadow: 0 0 0 1px rgba(67, 97, 238, 0.2); /* Hiệu ứng hover */
}

.result-container {
  display: none;
  margin-bottom: 65px;
}

.account-result {
  margin-bottom: 1rem;
  overflow: hidden; /* Đảm bảo không bị che khuất khi thu gọn */
  min-height: 50px; /* Thêm min-height để đảm bảo phần tử không bị che dưới footer */
}

.account-header {
  cursor: pointer;
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-toggle-btn {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.account-content {
  padding: 10px;
  display: block;
  height: auto;
  overflow: hidden;
  transition: height 0.5s ease-out;
}

.account-toggle-btn.rotate {
  transform: rotate(180deg);
}

.account-content.open {
  display: block;
  height: auto; /* Khi mở, chiều cao sẽ tự động tính toán */
}
.account-email {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.account-status {
  font-size: 0.9rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.status-success {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--success-color);
}

.status-error {
  background-color: rgba(244, 67, 54, 0.15);
  color: var(--danger-color);
}

.message-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.message-table thead th {
  background-color: #f8f9fa;
  color: var(--dark-color);
  font-weight: 600;
  padding: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

.message-table tbody tr {
  transition: background-color 0.2s ease;
}

.message-table tbody tr:hover {
  background-color: #f8f9fa;
}

.message-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

.message-subject {
  font-weight: 500;
  color: var(--dark-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
}

.message-date {
  color: #6c757d;
  font-size: 0.9rem;
  white-space: nowrap;
}

.code-container {
  display: flex;
  align-items: center;
}

.code-text {
  font-family: "Courier New", monospace;
  background-color: #f8f9fa;
  padding: 0.5rem;
  border-radius: 4px;
  color: var(--primary-color);
  font-weight: 600;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.copy-btn:hover {
  color: var(--secondary-color);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  color: #e0e0e0;
  margin-bottom: 1rem;
}

.footer {
  background-color: var(--dark-color);
  color: white;
  padding: 1rem 0;
  position: fixed;
  bottom: 0;
  width: 100%;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
}

@media (min-width: 768px) {
  .count-badge {
    width: 40% !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .logo-container {
    width: 100%;
  }

  .mode-option label {
    padding: 0.5rem 1rem;
    font-size: 1.1rem; /* Tăng cỡ chữ khi trên di động */
  }

  .mode-option label i {
    font-size: 1.5rem; /* Tăng kích thước icon trên di động */
  }

  .main-container {
    padding: 0;
    margin-bottom: 100px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .message-table {
    font-size: 14px; /* Giảm cỡ chữ */
    display: block;
    overflow-x: auto;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hiệu ứng vòng tròn phóng to */
@keyframes pulseIcon {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-icon {
  position: relative;
}

.pulse-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgb(0, 149, 255);
  border-radius: 50%;
  animation: pulseIcon 1.5s infinite;
}
