/* Authentication Styles for CTRL */

/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-close-btn:hover {
  background: #f0f0f0;
  color: #000;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-family: 'Lucida Console', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #000;
}

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

.auth-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.auth-tab.active {
  color: #000;
  border-bottom-color: #000;
}

.auth-tab:hover {
  color: #000;
  background: #f8f8f8;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  color: #000;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.auth-submit-btn {
  background: #1a1a1a;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.auth-submit-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

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

.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.auth-divider span {
  background: #fff;
  padding: 0 1rem;
  color: #666;
  font-size: 0.9rem;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #fff;
  color: #000;
  padding: 0.75rem 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.auth-google-btn:hover {
  background: #f8f8f8;
  border-color: #ccc;
  transform: translateY(-1px);
}

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

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.auth-footer p {
  color: #666;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.4;
}

.auth-footer a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
}

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

/* Auth Messages */
.auth-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  animation: messageSlideIn 0.3s ease-out;
}

.auth-message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.auth-message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

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

/* User Menu */
.user-menu {
  display: none;
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.user-menu-toggle:hover {
  background: #f0f0f0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: #000;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 500;
  color: #000;
  font-size: 0.9rem;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 100;
  display: none;
  animation: dropdownSlideIn 0.2s ease-out;
}

.user-dropdown.show {
  display: block;
}

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

.user-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: #f8f8f8;
}

.user-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.user-dropdown-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 0.25rem 0;
}

/* Auth Button */
.auth-button {
  background: #1a1a1a;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-button:hover {
  background: #333;
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

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

.auth-button.secondary {
  background: #f0f8ff;
  color: #000;
  border: 1px solid #e6f3ff;
}

.auth-button.secondary:hover {
  background: #e6f3ff;
  color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-modal-content {
    padding: 1.5rem;
    margin: 1rem;
    max-width: none;
    width: calc(100% - 2rem);
  }
  
  .auth-header h2 {
    font-size: 1.25rem;
  }
  
  .auth-tabs {
    margin-bottom: 1.5rem;
  }
  
  .auth-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .form-group input {
    padding: 0.625rem;
  }
  
  .auth-submit-btn,
  .auth-google-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Loading States */
.auth-submit-btn:disabled,
.auth-google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-submit-btn:disabled:hover,
.auth-google-btn:disabled:hover {
  transform: none;
  background: #1a1a1a;
}

/* Focus States for Accessibility */
.auth-tab:focus,
.auth-submit-btn:focus,
.auth-google-btn:focus,
.user-menu-toggle:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.form-group input:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}
