/* =========================================================
   Learn Ajmat - Authentication System Styles (auth.css)
   Clean, modern, accessible OAuth & Email/Password components
   ========================================================= */

/* Header User Badge */
.header_user_badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  margin-left: 10px;
  vertical-align: middle;
}

.user_profile_trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 5px 14px 5px 6px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1e293b;
  font-weight: 500;
  font-size: 13.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  user-select: none;
}

.user_profile_trigger:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.user_avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #044b94;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* User Dropdown Menu - Fully Isolated & Reset */
.user_dropdown_menu,
.header_auth_slot .user_dropdown_menu,
.top_btn_box .user_dropdown_menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff !important;
  width: 250px !important;
  min-width: 250px !important;
  max-width: 260px !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid #e2e8f0 !important;
  z-index: 99999 !important;
  padding: 6px !important;
  box-sizing: border-box !important;
  text-align: left !important;
  float: none !important;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownPop {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.header_user_badge.open .user_dropdown_menu {
  display: block !important;
}

.user_dropdown_header,
.top_btn_box .user_dropdown_header {
  padding: 10px 12px 10px 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin-bottom: 4px !important;
  text-align: left !important;
  float: none !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: transparent !important;
}

.user_dropdown_header .user_name {
  font-weight: 600 !important;
  color: #0f172a !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 0 2px 0 !important;
  text-align: left !important;
}

.user_dropdown_header .user_email {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  text-align: left !important;
}

/* User Dropdown Items */
.user_dropdown_menu a,
.user_dropdown_menu a.user_dropdown_item,
.user_dropdown_menu div.user_dropdown_item,
.user_dropdown_item,
.top_btn_box .user_dropdown_item,
.top_btn_box .user_dropdown_menu a {
  float: none !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 38px !important;
  height: auto !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #334155 !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  text-align: left !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  gap: 10px !important;
}

.user_dropdown_menu a:hover,
.user_dropdown_menu .user_dropdown_item:hover,
.top_btn_box .user_dropdown_item:hover,
.top_btn_box .user_dropdown_menu a:hover {
  background: #f1f5f9 !important;
  color: #044b94 !important;
}

.user_dropdown_item svg,
.top_btn_box .user_dropdown_item svg {
  flex-shrink: 0 !important;
  stroke: #64748b !important;
  margin: 0 !important;
  transition: stroke 0.15s ease !important;
}

.user_dropdown_item:hover svg,
.top_btn_box .user_dropdown_item:hover svg {
  stroke: #044b94 !important;
}

.user_dropdown_menu .user_dropdown_item.logout_btn,
.top_btn_box .user_dropdown_menu .user_dropdown_item.logout_btn {
  color: #ef4444 !important;
  margin-top: 4px !important;
  border-top: 1px solid #f1f5f9 !important;
  border-radius: 0 0 8px 8px !important;
  padding-top: 10px !important;
}

.user_dropdown_menu .user_dropdown_item.logout_btn:hover,
.top_btn_box .user_dropdown_menu .user_dropdown_item.logout_btn:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.user_dropdown_menu .user_dropdown_item.logout_btn svg,
.top_btn_box .user_dropdown_menu .user_dropdown_item.logout_btn svg {
  stroke: #ef4444 !important;
}

.user_dropdown_menu .user_dropdown_item.logout_btn:hover svg,
.top_btn_box .user_dropdown_menu .user_dropdown_item.logout_btn:hover svg {
  stroke: #dc2626 !important;
}

/* Modal Overlay */
.auth_modal_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth_modal_overlay.active {
  display: flex;
  opacity: 1;
}

.auth_modal_container {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.auth_modal_overlay.active .auth_modal_container {
  transform: translateY(0) scale(1);
}

.auth_modal_close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
}

.auth_modal_close:hover {
  background: #e2e8f0;
  color: #000000;
}

.auth_modal_body {
  padding: 32px 30px;
  max-height: 90vh;
  overflow-y: auto;
}

.auth_header {
  text-align: center;
  margin-bottom: 24px;
}

.auth_header .brand_badge {
  display: inline-block;
  background: #e0f2fe;
  color: #044b94;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.auth_header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 6px;
}

.auth_header p {
  color: #64748b;
  font-size: 13.5px;
  margin: 0;
}

/* Auth Tabs */
.auth_tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.auth_tab_btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth_tab_btn.active {
  background: #ffffff;
  color: #044b94;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* OAuth Providers Buttons */
.oauth_providers_box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn_oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #000000;
}

.btn_oauth svg, .btn_oauth img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn_oauth:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn_oauth.google_btn:hover {
  background: #f8fafc;
}

.btn_oauth.facebook_btn {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}

.btn_oauth.facebook_btn:hover {
  background: #166fe5;
}

.btn_oauth.x_btn {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.btn_oauth.x_btn:hover {
  background: #000000;
}

.btn_oauth.github_btn {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.btn_oauth.github_btn:hover {
  background: #000000;
}

/* Auth Divider */
.auth_divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth_divider::before,
.auth_divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth_divider span {
  padding: 0 12px;
}

/* Forms */
.auth_form_group {
  margin-bottom: 16px;
}

.auth_form_group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.auth_form_group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #000000;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth_form_group input:focus {
  border-color: #044b94;
  box-shadow: 0 0 0 3px rgba(4, 75, 148, 0.15);
}

.auth_actions_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 13px;
}

.auth_remember_me {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  cursor: pointer;
}

.auth_forgot_link {
  color: #044b94;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth_forgot_link:hover {
  text-decoration: underline;
}

.btn_auth_submit {
  width: 100%;
  background: linear-gradient(135deg, #044b94 0%, #044b94 100%);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(4, 75, 148, 0.25);
}

.btn_auth_submit:hover {
  background: linear-gradient(135deg, #044b94 0%, #044b94 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(4, 75, 148, 0.4);
}

.btn_auth_submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Alert Notification in Modal */
.auth_alert {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.auth_alert.error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #a3241c;
}

.auth_alert.success {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #55cd6c;
}

.auth_alert.info {
  display: block;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #044b94;
}

/* Config Status Banner */
.auth_config_notice {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 16px;
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth_config_notice code {
  background: #e2e8f0;
  color: #000000;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
