/* Authentication Modal Styles - Dark Theme */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 16, 44, 0.3); /* Hafif koyu arkaplan particles için */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* Modal Particles.js Background */
#modal-particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  background: transparent; /* Particles'ın görünmesi için şeffaf */
  overflow: hidden;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  padding: 0;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden; /* container keeps rounded corners */
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 100; /* Particles'ın kesinlikle üstünde olsun */
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 212, 255, 0.2) inset,
    0 8px 32px rgba(0, 212, 255, 0.3);
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    backdrop-filter: blur(20px);
  }
}

.auth-modal-header {
  padding: 32px 32px 0 32px;
  position: relative;
  background: linear-gradient(135deg, rgba(102, 133, 253, 0.1), rgba(102, 133, 253, 0.05));
  border-bottom: 1px solid rgba(102, 133, 253, 0.2);
}

.auth-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(102, 133, 253, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 133, 253, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-close:hover {
  background: rgba(102, 133, 253, 0.2);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 133, 253, 0.3);
}

.auth-modal-title {
  text-align: center;
  margin: 0 0 12px 0;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #a2b5fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.auth-modal-subtitle {
  text-align: center;
  margin: 0 0 32px 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 212, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 32px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  text-align: center;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.auth-tab.active {
  background: linear-gradient(135deg, #00d4ff, #00a8cc);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.auth-modal-body {
  padding: 0 32px 36px 32px; /* slightly larger bottom padding so buttons aren't cut off */
  /* Let body grow/shrink inside flex modal and scroll when needed */
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

/* Reduce inside spacing on small screens so modal content fits */
@media (max-width: 480px) {
  .auth-modal-content { padding: 0; max-width: 95%; border-radius: 14px; }
  .auth-modal-body { padding: 0 20px 20px 20px; max-height: calc(90vh - 200px); }
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form-group {
  margin-bottom: 2px;
}

.auth-form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  padding-top: 25px;
}

.auth-form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.auth-form-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid rgba(102, 133, 253, 0.3);
  border-radius: 12px;
  font-size: 16px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
}

.auth-form-input:focus {
  outline: none;
  border-color: #6685fd;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 0 3px rgba(102, 133, 253, 0.2),
    0 4px 20px rgba(102, 133, 253, 0.15);
  transform: translateY(-1px);
}

.auth-form-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Password Input Container */
.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-container .auth-form-input {
  padding-right: 45px; /* Make room for toggle button */
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Password validation help text */
.auth-form-group .auth-form-help {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
  font-style: italic;
  line-height: 1.3;
}

/* Password strength indicator */
.password-strength-help {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 6px;
  border-left: 3px solid #ff6b6b;
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.password-strength-help.valid {
  border-left-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

/* Password input spacing */
.auth-form-group .password-input-container + .auth-form-help {
  margin-top: 6px;
}

.auth-form-group .password-input-container + .password-strength-help {
  margin-top: 8px;
}

.auth-form-group .password-input-container + .auth-form-help + .password-strength-help {
  margin-top: 6px;
}

/* Password match indicator */
.password-match-help {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.password-match-help.valid {
  border-left: 3px solid #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.password-match-help.invalid {
  border-left: 3px solid #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.auth-form-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #6685fd;
  border-radius: 4px;
}

.auth-form-checkbox label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.4;
}

.auth-form-checkbox a {
  color: #6685fd;
  text-decoration: none;
  font-weight: 500;
}

.auth-form-checkbox a:hover {
  text-decoration: underline;
  color: #8ba3fe;
}

.auth-submit-btn {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #00d4ff, #00a8cc);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 20px;
  box-shadow: 
    0 8px 32px rgba(102, 133, 253, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  letter-spacing: 0.02em;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #00a8cc, #0099bb);
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 212, 255, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

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

.auth-divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 133, 253, 0.4), transparent);
  z-index: 1;
}

.auth-divider span {
  background: rgba(2, 16, 44, 0.9);
  padding: 8px 20px;
  border-radius: 20px;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(102, 133, 253, 0.3);
}

/* Social Buttons - Side by Side */
.auth-social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-social-btn {
  padding: 16px 12px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.auth-social-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #00d4ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

.auth-forgot-link {
  text-align: center;
  margin-top: 20px;
}

.auth-forgot-link a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.auth-forgot-link a:hover {
  color: #6685fd;
  background: rgba(102, 133, 253, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-modal-content {
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
    border-radius: 16px;
  }
  
  .auth-modal-header {
    padding: 24px 24px 0 24px;
  }
  
  .auth-modal-body {
    padding: 0 24px 24px 24px;
  }
  
  .auth-modal-title {
    font-size: 28px;
  }
  
  .auth-modal-close {
    width: 36px;
    height: 36px;
    top: 20px;
    right: 20px;
  }
  
  /* Stack social buttons on mobile */
  .auth-social-buttons {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .auth-social-btn {
    font-size: 15px;
    padding: 16px 20px;
  }
}

/* Loading state */
.auth-submit-btn.loading {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-submit-btn.loading::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message Styling */
.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.auth-message-error {
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-message-success {
  background-color: rgba(16, 185, 129, 0.9);
  color: white;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Loading Button States */
.auth-submit-btn .btn-loading {
  display: none;
}

.auth-submit-btn:disabled {
  background: rgba(0, 212, 255, 0.6);
  cursor: not-allowed;
}

.auth-submit-btn:disabled:hover {
  background: rgba(0, 212, 255, 0.6);
  transform: none;
}

/* Disabled tab look */
.auth-tab.disabled {
  opacity: 0.5;
  cursor: default;
  filter: grayscale(0.2);
}

/* Temporary tooltip bubble created by JS */
.auth-temp-msg {
  pointer-events: none;
  position: fixed;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.95rem;
  z-index: 100000;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}

/* Forgot Password Styles */
.auth-back-link {
  text-align: center;
  margin-top: 1rem;
}

.auth-back-link a {
  color: rgba(0, 212, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.auth-back-link a:hover {
  color: #00d4ff;
  text-decoration: underline;
}

/* Forgot Password Form Adjustments */
#forgotPasswordForm .auth-form-help {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Email Verification Styles */
.verification-header {
  text-align: center;
  margin-bottom: 2rem;
}

.verification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.verification-icon svg {
  width: 48px;
  height: 48px;
  color: white;
}

.verification-header h3 {
  color: white;
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.verification-text {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

#verificationEmailDisplay {
  color: #00d4ff;
  font-weight: 600;
}

/* Verification Code Input */
.verification-code-container {
  position: relative;
}

.verification-code-input {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.3rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.verification-code-hint {
  text-align: center;
  margin-top: 0.5rem;
}

.verification-code-hint small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

/* Verification Actions */
.verification-actions {
  margin-top: 1.5rem;
  text-align: center;
}

.resend-container {
  margin-bottom: 1rem;
}

.resend-container p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
}

.resend-code-btn {
  background: none;
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.resend-code-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #00d4ff;
  transform: translateY(-1px);
}

.resend-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.resend-loading {
  display: none;
}

/* Tab styling for verification */
.auth-tab[data-tab="verify-email"] {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: white;
  border-color: #00d4ff;
}

/* Hide verification tab by default */
.auth-tab[data-tab="verify-email"]:not(.show) {
  display: none;
}

/* Verification form animations */
#verifyEmailForm {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive adjustments for verification */
@media (max-width: 768px) {
  .verification-icon {
    width: 60px;
    height: 60px;
  }
  
  .verification-icon svg {
    width: 36px;
    height: 36px;
  }
  
  .verification-header h3 {
    font-size: 1.3rem;
  }
  
  .verification-code-input {
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
  }
}
