/* User Settings Section */
.comic-user {
  padding-bottom: 40px;
}

.user-settings-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  padding-bottom: 15px;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid;
  border-color: #fff;
}

.user-settings-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  margin-top: 15px;
}

/* Sidebar Navigation */
.user-sidebar {
  background: #fff;
  padding: 0;
  max-height: 195px;
}

.user-nav {
  list-style: none;
}

.user-nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  color: #000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.user-nav-link i {
  width: 20px;
  font-size: 18px;
}

.user-nav-link:hover {
  background: rgba(193, 62, 83, 0.1);
  color: var(--primary-color);
}

.user-nav-link.active {
  background: linear-gradient(to right, #eb3349 40%, #f45c43);
  color: #fff;
}

.user-nav-link::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #f45c43;
  position: absolute;
  left: calc(100% - 1px);
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
}

.user-nav-link.active::after {
  opacity: 1;
  visibility: visible;
}

/* Content Area */
.user-tab-content {
  display: none;
}

.user-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab: Theo dõi (Bookmarks) */
.bookmark-table {
  width: 100%;
  border-collapse: collapse;
}

.bookmark-table thead {
  background: #fff;
}

.bookmark-table th {
  padding: 15px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.bookmark-table th:first-child {
  border-top-left-radius: 5px;
}

.bookmark-table th:last-child {
  border-top-right-radius: 5px;
}

.bookmark-table tbody tr {
  border-bottom: 1px solid #fff;
}

.bookmark-table td {
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.manga-info {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 15px;
}

.manga-thumb {
  width: 100px;
  height: 130px;
  object-fit: cover;
  flex-shrink: 0;
}

.manga-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.manga-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.manga-title:hover {
  color: var(--primary-color);
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-item-book-mark {
  display: flex;
  align-items: center;
  gap: 15px;
}

.chapter-link {
  display: inline-block;
  padding: 5px 15px;
  background: #fff;
  color: #666666;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.chapter-link:hover {
  background: var(--primary-color);
  color: white;
}

.chapter-date {
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
}

.updated-time {
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding-left: 15px;
}

.edit-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.edit-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.edit-actions input[type="checkbox"] {
  width: 12px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

i.fa-solid.fa-xmark.remove-btn {
  font-size: 12px;
}

.remove-btn {
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.bookmark-table tfoot td {
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  border-bottom: none;
}

.table-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
}

.check-all-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.check-all-label {
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.delete-btn {
  padding: 10px 24px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: capitalize;
}

.delete-btn:hover {
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.delete-btn:active {
  transform: translateY(0);
}

/* Tab: Lịch sử đọc */
.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.history-thumb {
  width: 60px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
}

.history-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.history-title {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 112px;
}

.history-chapter {
  display: inline-block;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  width: fit-content;
}

.history-chapter:hover {
  color: #ff8a95;
}

.history-time {
  color: #8899a6;
  font-size: 10px;
  font-weight: 400;
}

.history-close {
  position: absolute;
  top: 2px;
  right: -10px;
  width: 25px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 4px;
  flex-shrink: 0;
}

.history-close:hover {
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 820px) {
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 430px) {
  .history-grid {
    grid-template-columns: 1fr;
  }

  .history-thumb {
    width: 60px;
    height: 85px;
  }

  .history-chapter {
    font-size: 13px;
  }
}

/* Tab: Reader Settings */
.settings-section {
  margin-bottom: 20px;
  border-bottom: 1px solid;
  border-color: #fff;
  padding-bottom: 20px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 1px;
  color: #fff;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.setting-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.setting-option label {
  cursor: pointer;
  color: #888;
  font-size: 14px;
}

.setting-option input[type="radio"]:checked + label {
  color: var(--primary-color);
  font-weight: 600;
}

.settings-note {
  margin-top: 10px;
  font-size: 12px;
  color: #fff;
}

.submit-btn {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: #a03344;
  box-shadow: 0 4px 12px rgba(193, 62, 83, 0.3);
}

/* Tab: Tài khoản */
.account-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.avatar-upload-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 4px solid #e0e0e0;
}

.avatar-upload-wrapper:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.user-avatar-setting {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  gap: 8px;
}

.avatar-upload-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay i {
  font-size: 32px;
}

.avatar-overlay span {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.avatar-hint {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
  text-align: center;
}

/* Loading spinner for avatar upload */
.avatar-uploading {
  pointer-events: none;
}

.avatar-uploading .avatar-overlay {
  opacity: 1;
  background: rgba(233, 30, 99, 0.8);
}

.avatar-uploading .avatar-overlay i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.form-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 25px;
  color: #ffffff;
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row label {
  font-size: 14px;
  font-weight: 400;
  color: #8899a6;
  text-align: left;
}

.form-row input {
  width: 100%;
  max-width: 400px;
  padding: 10px 15px;
  background: #fff;
  border: 1px solid #ddd;
  color: #333;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-row input:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.form-row input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-row input::placeholder {
  color: #ccc;
}

.submit-btn {
  margin-top: 5px;
  margin-left: 220px; /* 200px (label width) + 20px (gap) */
  padding: 10px 30px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: #d62839;
  box-shadow: 0 4px 8px rgba(193, 62, 83, 0.4);
}

/* Responsive */
@media (max-width: 820px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-row label {
    text-align: left;
  }

  .form-row input {
    max-width: 100%;
  }

  .submit-btn {
    margin-left: 0;
    margin-top: 15px;
  }

  .account-avatar {
    text-align: center;
  }
}

/* Responsive */
@media (max-width: 820px) {
  .user-settings-container {
    grid-template-columns: 1fr;
  }

  .user-nav-link::after {
    display: none;
  }
}
