/* Profile Page Styles */
.profile-section {
  padding: 60px 0;
  background-color: var(--bg-color);
}

.profile-container {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

.profile-container:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
}

.profile-header {
  border-radius: 10px 10px 0 0;
  background: linear-gradient(135deg,
      var(--primary-color) 0%,
      var(--accent-color) 100%);
  padding: 25px 30px;
  border-bottom: 4px solid var(--accent-color);
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0) 100%);
  z-index: 1;
}

.profile-title {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-content {
  display: flex;
  min-height: 600px;
}

/* Sidebar Styles */
.profile-sidebar {
  width: 300px;
  background-color: #f8f9fa;
  border-right: 1px solid #e0e0e0;
  padding: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg,
      var(--primary-color) 0%,
      var(--accent-color) 100%);
}

.sidebar-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item {
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}


.sidebar-link i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  color: var(--text-light);
  transition: all 0.2s ease;
}

.sidebar-item:hover .sidebar-link {
  background-color: #f0f0f0;
  color: var(--accent-color);
  padding-left: 25px;
}

.sidebar-item:hover .sidebar-link::before {
  opacity: 1;
}

.sidebar-item:hover .sidebar-link i {
  color: var(--accent-color);
  transform: scale(1.1);
}

.sidebar-item.active .sidebar-link {
  background-color: var(--accent-color);
  color: white;
  padding-left: 25px;
}

.sidebar-item.active .sidebar-link::before {
  opacity: 1;
  background-color: white;
}

.sidebar-item.active .sidebar-link i {
  color: white;
}

/* Main Content Styles */
.profile-main {
  flex: 1;
  padding: 30px;
}

.profile-info-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.profile-info-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-header {
  background-color: #f8f9fa;
  padding: 15px 20px;
  border-bottom: 2px solid var(--accent-color);
  position: relative;
  overflow: hidden;
}

.info-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg,
      var(--primary-color) 0%,
      var(--accent-color) 100%);
}

.info-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.info-content {
  padding: 20px;
}

.info-row {
  display: flex;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  transition: all 0.2s ease;
}

.info-row:hover {
  background-color: #f8f9fa;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 5px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  width: 150px;
  font-weight: 600;
  color: var(--text-light);
}

.info-value {
  flex: 1;
  color: var(--text-color);
}

.info-value--highlight {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1.8rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.change-password-link,
.update-phone-link {
  margin-left: 15px;
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.change-password-link::after,
.update-phone-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.change-password-link:hover::after,
.update-phone-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.mt-4 {
  margin-top: 25px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.form-control {
  font-size: 15px;
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 0, 0, 0.1);
  outline: none;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 1.4rem;
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  border-left: 3px solid #dc3545;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Table Styles */
.history-table-container {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-text {
  margin-top: 5px;
  font-size: 1.4rem;
  font-style: italic;
}

.history-table th {
  background-color: #f8f9fa;
  color: var(--text-color);
  font-weight: 600;
  text-align: left;
  padding: 15px;
  border-bottom: 2px solid var(--accent-color);
}

.history-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.history-table tr:hover td {
  background-color: #f8f9fa;
}

.history-table .text-bold {
  font-weight: 700;
}

.history-table .text-danger {
  color: var(--danger);
}

.history-table .no-data {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
  font-style: italic;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.pagination .page-item {
  margin: 0 5px;
}

.pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  background-color: white;
  color: var(--text-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #ddd;
}

.pagination .page-link:hover {
  background-color: #f8f9fa;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.pagination .page-item.active .page-link {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Mặc định: ẩn dropdown, hiện sidebar (desktop) */
.mobile-profile-menu {
  display: none !important;
}

.profile-sidebar {
  display: block !important;
}

/* <= 1024px: dùng giao diện gọn */
@media (max-width: 1024px) {
  .profile-sidebar {
    display: none !important;
  }

  .mobile-profile-menu {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 60;
    background: #f9fafb;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .mobile-menu-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
  }

  .mobile-menu-label::before {
    content: "📌";
    font-size: 1rem;
    line-height: 1;
  }

  .mobile-menu-select {
    width: 100%;
    padding: 12px 44px 12px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b82f6'><path d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z'/></svg>") no-repeat right 12px center;
    background-size: 18px;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    appearance: none;
    outline: none;
    transition: box-shadow .15s, border-color .15s;
  }

  .mobile-menu-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
  }

  /* Layout gọn */
  .profile-section {
    padding: 16px 0;
  }

  .profile-header {
    padding: 10px 12px;
  }

  .profile-title {
    font-size: 1.25rem;
  }

  .profile-main {
    padding: 10px;
  }

  /* Hàng thông tin gọn */
  .info-row {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }

  .info-label {
    width: 100%;
    margin: 0;
    font-size: .9rem;
    color: #6b7280;
  }

  .info-value {
    font-size: 1rem;
    font-weight: 600;
  }

  /* Nếu còn link menu ở nơi khác */
  .sidebar-link {
    padding: 9px 10px;
    font-size: .95rem;
    border-radius: 8px;
  }

  .sidebar-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
  }
}

/* > 1024px: desktop */
/* Cho mobile + iPad */
@media (max-width:1024px){
  /* đảm bảo content xếp dọc */
  .profile-content{ display:flex; flex-direction:column; }

  /* đẩy dropdown lên đầu và full-width */
  .mobile-profile-menu{
    order:-1;               /* lên đầu */
    width:100% !important;  /* full chiều ngang container */
    margin-top: 8px;
    margin-bottom: 12px;
  }
}



/* Animation for balance */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.profile-balance-danger {
  color: var(--danger);
  animation: pulse 1.5s infinite;
  display: inline-block;
}