/* Temel Popup Ayarları */
#authPopupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

#authPopupOverlay.show {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Popup Arkaplanı */
#authPopupBackdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Popup İçerik Alanı - Kompakt tasarım */
#authPopupContent {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(145deg, var(--z-surface-1) 0%, var(--z-bg-deep) 100%);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
              0 0 0 1px rgba(255, 255, 255, 0.1),
              0 0 40px var(--z-accent-glow);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 2;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#authPopupOverlay.show #authPopupContent {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Popup Kapatma Butonu */
#authCloseBtn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

#authCloseBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Popup Başlık Alanı - Kompakt */
#authPopupHeader {
  padding: 25px 30px 15px;
  text-align: center;
}

#authLogo {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

#authBrandLogo {
  height: 50px;
  max-width: 150px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

#authTitle {
  margin: 0 0 5px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

#authSubtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Popup İçerik Alanı - Kompakt */
#authPopupBody {
  padding: 5px 30px 20px;
  flex: 1;
  overflow-y: auto;
}

/* Tab tasarımı */
#authTabs {
  position: relative;
}

#formTab, #socialTab {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#formTab.active, #socialTab.active {
  display: block;
  opacity: 1;
}

#authTabsControl {
  display: flex;
  margin-top: 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
}

#authTabsControl button {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
}

#authTabsControl button.active {
  background: var(--z-accent-glow);
  color: #000;
}

/* Input alanları - Kompakt */
#formFields {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

#usernameGroup, #passwordGroup {
  margin-bottom: 0;
  position: relative;
}

#usernameWrapper, #passwordWrapper {
  position: relative;
  transition: all 0.3s ease;
}

#usernameWrapper.error, #passwordWrapper.error {
  animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

#usernameWrapper.error::before, #passwordWrapper.error::before {
  content: 'Bu alan gereklidir';
  position: absolute;
  bottom: -18px;
  left: 2px;
  font-size: 11px;
  color: var(--z-danger);
  z-index: 5;
}

#usernameWrapper.error #id_login, #passwordWrapper.error #id_password {
  border-color: var(--z-danger) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

#usernameIcon, #passwordIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  transition: color 0.2s ease;
  z-index: 2;
  pointer-events: none;
}

#id_login, #id_password {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0 12px 0 36px;
  color: #ffffff;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

#id_login:focus, #id_password:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--z-border-accent);
  box-shadow: 0 0 0 3px var(--z-accent-glow);
  outline: none;
}

#id_login:focus ~ #usernameIcon {
  color: var(--z-accent-light);
}

#id_password:focus ~ #passwordIcon {
  color: var(--z-accent-light);
}

#id_login::placeholder, #id_password::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Password Göster/Gizle Butonu */
#passwordToggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  transition: color 0.2s ease;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#passwordToggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Login Seçenekleri */
#loginOptions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 8px;
  gap: 10px;
}

/* Remember Me Checkbox */
#rememberMeOption {
  display: flex;
  align-items: center;
}

#id_remember {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

#rememberLabel {
  position: relative;
  padding-left: 25px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
}

#rememberLabel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  transition: all 0.2s ease;
}

#id_remember:checked + #rememberLabel::before {
  background: var(--z-accent-light);
  border-color: var(--z-accent-light);
}

#id_remember:checked + #rememberLabel::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Forgot Password Linki */
#forgotLink {
  font-size: 13px;
  color: var(--z-accent);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

#forgotLink::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--z-accent-light);
  transition: width 0.3s ease;
}

#forgotLink:hover {
  color: var(--z-accent-light);
}

#forgotLink:hover::after {
  width: 100%;
}

/* Submit Butonu */
#loginSubmitBtn {
  width: 100%;
  height: 46px;
  background: var(--z-accent-gradient);
  border: none;
  border-radius: 10px;
  color: #000000;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  gap: 8px;
}

#loginSubmitBtn:hover:not(:disabled) {
  background: var(--z-accent-gradient); filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--z-accent-glow);
}

#loginSubmitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#submitBtnText {
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
}

#submitBtnIcon {
  position: relative;
  z-index: 2;
  opacity: 0;
  width: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  overflow: hidden;
}

#loginSubmitBtn:hover:not(:disabled) #submitBtnText {
  transform: translateX(-7px);
}

#loginSubmitBtn:hover:not(:disabled) #submitBtnIcon {
  opacity: 1;
  width: auto;
  transform: translateX(0);
}

#submitBtnLoader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #000000;
  z-index: 3;
}

/* Social Login Buttons */
#socialLoginOptions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 5px 0;
}

#socialLoginPlaceholder {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.6);
}

#googleLogin, #facebookLogin, #githubLogin {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  gap: 10px;
}

#googleLogin {
  background: rgba(219, 68, 55, 0.1);
  border-color: rgba(219, 68, 55, 0.3);
}

#facebookLogin {
  background: rgba(66, 103, 178, 0.1);
  border-color: rgba(66, 103, 178, 0.3);
}

#githubLogin {
  background: rgba(36, 41, 46, 0.1);
  border-color: rgba(36, 41, 46, 0.3);
}

#googleLogin:hover, #facebookLogin:hover, #githubLogin:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #ffffff;
}

/* Sosyal İkonlar */
#googleIcon, #facebookIcon, #githubIcon {
  font-size: 16px;
}

#googleIcon {
  color: #DB4437;
}

#facebookIcon {
  color: #4267B2;
}

#githubIcon {
  color: #ffffff;
}

/* Popup Footer - Kompakt */
#authPopupFooter {
  padding: 15px 30px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

#signupText {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

#signupLink {
  color: var(--z-accent-light);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

#signupLink::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--z-accent-light);
  transition: width 0.3s ease;
}

#signupLink:hover {
  color: var(--z-accent-light);
  text-decoration: none;
}

#signupLink:hover::after {
  width: 100%;
}

/* Error message styling */
#loginErrorMessage {
  padding: 10px;
  margin-top: 15px;
  border-radius: 5px;
  background-color: rgba(248, 215, 218, 0.9);
  color: var(--z-danger);
  border: 1px solid rgba(245, 198, 203, 0.9);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
}

#loginErrorMessage i {
  font-size: 14px;
}

/* Responsive Ayarlar */
@media (max-width: 576px) {
  #authPopupOverlay {
    padding: 15px;
    align-items: flex-end;
  }
  
  #authPopupContent {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }
  
  #authPopupHeader {
    padding: 20px 20px 10px;
  }
  
  #authPopupBody {
    padding: 0 20px 15px;
  }
  
  #authPopupFooter {
    padding: 15px 20px;
  }
  
  #authBrandLogo {
    height: 45px;
  }
  
  #loginOptions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  #forgotLink {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  #authPopupContent {
    max-width: 100%;
    margin: 0;
  }
  
  #authPopupHeader {
    padding: 15px 15px 10px;
  }
  
  #authPopupBody {
    padding: 0 15px 10px;
  }
  
  #authPopupFooter {
    padding: 10px 15px;
  }
}

/* Animasyonlar */
@keyframes shake {
  10%, 90% {
    transform: translateX(-1px);
  }
  20%, 80% {
    transform: translateX(2px);
  }
  30%, 50%, 70% {
    transform: translateX(-3px);
  }
  40%, 60% {
    transform: translateX(3px);
  }
}

.shake {
  animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

/* Loading spinner animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#submitBtnLoader svg {
  animation: spin 1s linear infinite;
}

/* Focus states for accessibility */
#authCloseBtn:focus,
#loginSubmitBtn:focus,
#emailTabBtn:focus,
#socialTabBtn:focus,
#passwordToggle:focus {
  outline: 2px solid var(--z-accent);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #authPopupContent {
    border: 2px solid #ffffff;
  }
  
  #id_login, #id_password {
    border-width: 2px;
  }
  
  #loginSubmitBtn {
    border: 2px solid #000000;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  #authPopupContent,
  #loginSubmitBtn,
  #submitBtnIcon,
  #submitBtnText,
  .shake {
    transition: none !important;
    animation: none !important;
  }
  
  #authCloseBtn:hover {
    transform: none;
  }
}
/* Loading state styles */
#loginSubmitBtn.loading {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Shake animation for validation errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* Input error states */
#usernameWrapper.error,
#passwordWrapper.error {
    border-color: var(--z-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.is-invalid {
    border-color: var(--z-danger) !important;
}

.is-valid {
    border-color: var(--z-success) !important;
}

/* Alert animations */
.alert {
    animation: slideInDown 0.3s ease-out;
}

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