/* ========================================
   Auth Pages - Login / Register / Profile
   News Site Style - Dark Theme
   ======================================== */

/* Auth Page Container */
.auth-page-wrapper {
  min-height: calc(100vh - 200px);
  background: #0a1024;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card-header .auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3);
}

.auth-card-header .auth-icon i {
  color: #fff;
  font-size: 24px;
}

.auth-card-header h1 {
  color: #e2e8f0;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.auth-card-header p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-group label {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
}

.auth-form-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-form-group .input-wrapper i {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.auth-form-group .input-wrapper .toggle-password {
  position: absolute;
  right: 14px;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 1;
  transition: color 0.2s ease;
  pointer-events: auto;
}

.auth-form-group .input-wrapper .toggle-password:hover {
  color: #1976d2;
}

.auth-form-group input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.92rem;
  transition: all 0.25s ease;
  outline: none;
}

.auth-form-group input::placeholder {
  color: #64748b;
}

.auth-form-group input:focus {
  border-color: #1976d2;
  background: rgba(25, 118, 210, 0.04);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.auth-form-group .auth-error {
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 2px;
  display: none;
}

.auth-form-group.has-error input {
  border-color: #ef4444;
}

.auth-form-group.has-error .auth-error {
  display: block;
}

/* Password strength meter */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength .bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.password-strength .bar.weak {
  background: #ef4444;
}

.password-strength .bar.medium {
  background: #f59e0b;
}

.password-strength .bar.strong {
  background: #22c55e;
}

.password-strength-text {
  font-size: 0.75rem;
  margin-top: 4px;
  color: #64748b;
}

/* Form Options (Remember me / Forgot) */
.auth-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-form-options .remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.auth-form-options .remember-me input[type="checkbox"] {
  accent-color: #1976d2;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-form-options .remember-me span {
  color: #94a3b8;
  font-size: 0.85rem;
}

.auth-form-options .forgot-link {
  color: #1976d2;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.auth-form-options .forgot-link:hover {
  color: #42a5f5;
}

/* Submit Button */
.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.35);
}

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

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #64748b;
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

/* Social Login Buttons */
.auth-social-btns {
  display: flex;
  gap: 12px;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.auth-social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.auth-social-btn.google:hover {
  border-color: #ea4335;
  color: #ea4335;
}

.auth-social-btn.github:hover {
  border-color: #f0f6fc;
  color: #f0f6fc;
}

/* Switch Link (No account / Have account) */
.auth-switch {
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  margin-top: 4px;
}

.auth-switch a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-switch a:hover {
  color: #42a5f5;
}

/* Terms checkbox */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-terms input[type="checkbox"] {
  accent-color: #1976d2;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-terms span {
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-terms span a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
}

.auth-terms span a:hover {
  text-decoration: underline;
}

/* Toast Notification */
.auth-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-toast.show {
  transform: translateX(0);
}

.auth-toast.success {
  background: #16a34a;
}

.auth-toast.error {
  background: #dc2626;
}

.auth-toast.info {
  background: #1976d2;
}

.auth-toast i {
  font-size: 1.1rem;
}

.auth-toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.auth-toast-close:hover {
  opacity: 1;
}

/* ========================================
   Profile Page
   ======================================== */

.profile-page-wrapper {
  min-height: calc(100vh - 200px);
  background: #0a1024;
  padding: 50px 20px;
}

.profile-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3);
}

.profile-info {
  flex: 1;
}

.profile-info h2 {
  color: #e2e8f0;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.profile-info .profile-email {
  color: #94a3b8;
  font-size: 0.92rem;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-info .profile-email i {
  color: #1976d2;
}

.profile-info .profile-joined {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 24px;
}

.profile-tab {
  padding: 12px 24px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
}

.profile-tab:hover {
  color: #cbd5e1;
}

.profile-tab.active {
  color: #1976d2;
  border-bottom-color: #1976d2;
}

/* Profile Content Panels */
.profile-panel {
  display: none;
}

.profile-panel.active {
  display: block;
}

/* Profile Cards */
.profile-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}

.profile-card h3 {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-card h3 i {
  color: #1976d2;
}

/* Profile Form (Edit mode) */
.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.profile-form-grid .full-width {
  grid-column: 1 / -1;
}

.profile-form-group label {
  display: block;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.profile-form-group input,
.profile-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.25s ease;
  resize: vertical;
}

.profile-form-group input:focus,
.profile-form-group textarea:focus {
  border-color: #1976d2;
  background: rgba(25, 118, 210, 0.04);
}

.profile-form-group input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-outline {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Saved Articles / Bookmarks list */
.bookmark-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bookmark-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bookmark-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bookmark-item-img {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.bookmark-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-item-content {
  flex: 1;
}

.bookmark-item-content h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.bookmark-item-content h4 a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.25s ease;
}

.bookmark-item-content h4 a:hover {
  color: #1976d2;
}

.bookmark-item-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 6px;
}

.bookmark-item-meta i {
  color: #1976d2;
  margin-right: 4px;
}

.bookmark-item-summary {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-item-remove {
  align-self: flex-start;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.bookmark-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state i {
  font-size: 48px;
  color: #1e293b;
  margin-bottom: 16px;
  display: block;
}

.empty-state h4 {
  color: #94a3b8;
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.empty-state p {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0;
}

/* Danger Zone */
.danger-zone {
  border: 1px solid rgba(239, 68, 68, 0.15) !important;
}

.danger-zone h3 {
  color: #ef4444 !important;
}

.danger-zone h3 i {
  color: #ef4444 !important;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #1a1f35;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}

.modal-dialog h3 {
  color: #e2e8f0;
  font-size: 1.2rem;
  margin: 0 0 10px;
}

.modal-dialog p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 767px) {
  .auth-card {
    padding: 28px 20px;
  }

  .auth-card-header h1 {
    font-size: 1.4rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .profile-actions {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-tabs {
    overflow-x: auto;
  }

  .profile-tab {
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .auth-social-btns {
    flex-direction: column;
  }

  .bookmark-item {
    flex-direction: column;
  }

  .bookmark-item-img {
    width: 100%;
    height: 160px;
  }
}
